On my AWS GPU instance (p2.xlarge), dlib with cuda enabled, batch_face_locations gave me this error
RuntimeError: Unsupported image type, must be 8bit gray or RGB image.
, but face_locations(img, model='cnn') works fine.
The following code works fine on my Mac, but not on the server:
import face_recognition
img = face_recognition.load_image_file('1.jpeg')
face_recognition.batch_face_locations([img])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/miniconda3/lib/python3.6/site-packages/face_recognition/api.py", line 141, in batch_face_locations
raw_detections_batched = _raw_face_locations_batched(images, number_of_times_to_upsample)
File "/home/ubuntu/miniconda3/lib/python3.6/site-packages/face_recognition/api.py", line 124, in _raw_face_locations_batched
return cnn_face_detector(images, number_of_times_to_upsample)
RuntimeError: Unsupported image type, must be 8bit gray or RGB image.
face_recognition.__version__
> '0.1.0'
img.shape
> (366, 650, 3)
i guess there is problem in face_recognition/api.py file.
u can correct it manually :
find _raw_face_locations_batched function and add "batch_size=128" in arguments list
then add "batch_size=batch_size" argument in return cnn_face_detector func.
Most helpful comment
i guess there is problem in face_recognition/api.py file.
u can correct it manually :
find _raw_face_locations_batched function and add "batch_size=128" in arguments list
then add "batch_size=batch_size" argument in return cnn_face_detector func.