face_recognition: Ошибка Unsupported image type

face_recognition не видит что изображения в dtype=uint8, shape=(150, 150, 3), format=RGB Помогите исправить ошибку:

(.venv) PS D:\Unitech> python 03.07_cv_mp_2.py
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
W0000 00:00:1720007781.648296   26228 inference_feedback_manager.cc:114] Feedback manager requires a model with a single signature inference. Disabling support for feedback tensors.
Processing video_01.mp4, Duration: 4.10s, FPS: 30.000243904421986
D:\Unitech\.venv\lib\site-packages\google\protobuf\symbol_database.py:55: UserWarning: SymbolDatabase.GetPrototype() is deprecated. Please use message_factory.GetMessageClass() instead. SymbolDatabase.GetPrototype() will be removed soon.
  warnings.warn('SymbolDatabase.GetPrototype() is deprecated. Please '
Face 0: dtype=uint8, shape=(150, 150, 3), format=RGB
Traceback (most recent call last):
  File "D:\Unitech\03.07_cv_mp_2.py", line 120, in <module>
    face_times = process_videos(video_folder)
  File "D:\Unitech\03.07_cv_mp_2.py", line 86, in process_videos
    face_encoding = face_recognition.face_encodings(face_resized)
  File "D:\Unitech\.venv\lib\site-packages\face_recognition\api.py", line 213, in face_encodings
    raw_landmarks = _raw_face_landmarks(face_image, known_face_locations, model)
  File "D:\Unitech\.venv\lib\site-packages\face_recognition\api.py", line 156, in _raw_face_landmarks
    face_locations = _raw_face_locations(face_image)
  File "D:\Unitech\.venv\lib\site-packages\face_recognition\api.py", line 105, in _raw_face_locations
    return face_detector(img, number_of_times_to_upsample)
RuntimeError: Unsupported image type, must be 8bit gray or RGB image.   

Перед подачей в face_recognition изображения приводятся к общему виду dtype=uint8, shape=(150, 150, 3), format=RGB, но все равно возникает такая ошибка. Как ее исправить ?


Ответы (0 шт):