Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during face recognition: Unsupported image type, must be 8bit gray or RGB image. #1574

Open
BadOOOFra opened this issue Jun 27, 2024 · 0 comments

Comments

@BadOOOFra
Copy link

  • face_recognition version: 1.3.0
  • Python version: 3.12.4
  • Operating System: MacOS Sonoma Version 14.5 (23F79)

Description

I am trying to implement a face recognition login system using the face_recognition library in a Flask web application. The image is captured from a webcam using JavaScript, converted to a data URL, and sent to the server. However, I am consistently encountering the error Unsupported image type, must be 8bit gray or RGB image despite ensuring the image is in the correct format.

What went wrong:

•	The error occurs during the face_recognition.face_encodings function call.
•	Debugging indicates that the image is converted to RGB and is an 8-bit image, but the error persists.

Expected:

•	The function face_recognition.face_encodings should process the image and return face encodings if faces are detected.

What I Did

Traceback:

DEBUG: STREAM b'IHDR' 16 13
DEBUG: STREAM b'sRGB' 41 1
DEBUG: STREAM b'IDAT' 54 8192
DEBUG: Original image mode: RGBA
DEBUG: Converted image mode: RGB
DEBUG: Image shape: (480, 640, 3), dtype: uint8
ERROR: Error during face recognition: Unsupported image type, must be 8bit gray or RGB image.
INFO: 127.0.0.1 - - [27/Jun/2024 22:23:00] "POST /login HTTP/1.1" 200 -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant