提交 60fe4e8c 编写于 作者: T Tobias Mérinat 提交者: Adam Geitgey

clarify that file object is also a valid parameter

上级 2cbfe1c6
......@@ -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):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册