From 60fe4e8c0054c10171a206f5f01013502c8274e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20M=C3=A9rinat?= Date: Sun, 6 Aug 2017 20:25:17 +0200 Subject: [PATCH] clarify that file object is also a valid parameter --- face_recognition/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/face_recognition/api.py b/face_recognition/api.py index 5bd8d64..a0c9a64 100644 --- a/face_recognition/api.py +++ b/face_recognition/api.py @@ -67,15 +67,15 @@ def face_distance(face_encodings, face_to_compare): return np.linalg.norm(face_encodings - face_to_compare, axis=1) -def load_image_file(filename, mode='RGB'): +def load_image_file(name, mode='RGB'): """ Loads an image file (.jpg, .png, etc) into a numpy array - :param filename: image file to load + :param name: image file name or file object to load :param mode: format to convert the image to. Only 'RGB' (8-bit RGB, 3 channels) and 'L' (black and white) are supported. :return: image contents as numpy array """ - return scipy.misc.imread(filename, mode=mode) + return scipy.misc.imread(name, mode=mode) def _raw_face_locations(img, number_of_times_to_upsample=1): -- GitLab