-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
RuntimeError: Unsupported image type, must be 8bit gray or RGB image. #1573
Comments
same problem |
is there any find solution? |
the same problem wuth dlib face lanmarks ERROR: a year ago, it was working neatly |
for me, credit for: https://stackoverflow.com/a/78638053/17027049 |
Same issue, I downgraded numpy to version 1.26.4 and it worked again |
@Hamza-Zartaj have you tried numpy 1.26.4? |
change this: numpy==1.26.3 |
it was not installing i tried installing it. it had some error with latest python 3.12.4 so i was wondering if i need to downgrade my python version to something like 3.11.8 |
same problem. It looks like old error rises from the grave |
I downgraded my numpy from 2.0.0 to 1.26.4 solved my problem. |
Which python version u using for numpy 1.26.4
I tried downgrading numpy but it give some error something to do with
latest python version
So should I downgrade to python 3.11 or more lower like 3.9
…On Tue, 25 Jun 2024 at 8:05 PM, Ogun Serif Onargan ***@***.***> wrote:
On 16th June, numpy v2.0.0 has been released. I downgraded my numpy from
2.0.0 to 1.26.4 solved my problem.
—
Reply to this email directly, view it on GitHub
<#1573 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BFFISJQI2XSJ6OSTPEY5TF3ZJGBKHAVCNFSM6AAAAABJXE775SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBZGIYDMNBYGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@Hamza-Zartaj I was using Python 3.10.5 |
@zoldaten Thank you! it worked. |
I have moved to these versions numpy==1.26.3 opencv-python==4.9.0.80 |
Yep, downgraded numpy to 1.26.4 and its working.. My question is what is the relation between numpy version and the error: "RuntimeError: Unsupported image type, must be 8bit gray or RGB image."? It's probably because openCV array structures are converted to numpy arrays ? |
Can you tell me, whats your python version? |
@dwaipayanddg |
thank you so much. I changed my bumpy to 1.26.4 and reloaded my requirements.txt. Presto. |
use numpy==1.26.4 can complete |
yes downgrde your ython version, else dlib would not work |
j'utilise la version python 3.12.4 et j'ai installé face_recognition version 1.3.0 apres l'execution du script ,je reçois une erreur comme celle ci: RuntimeError: Unsupported image type, must be 8bit gray or RGB image. |
svp aidez moi |
Downgrading worked for me
|
Downgrading worked for me, but is there a fix in the works for face recognition/dlib to work with numpy 2.0? Not sure which project would be responsible for this fix- I imagine it's face recognition? |
@zoldaten 100% worked bruh... Python version: 3.10.x |
Related: davisking/dlib#1134 |
Use Python 3.10.X version with a virtual environment to solve this error. Check out: |
python3.10 works fine, ya |
thanks alot |
pip install numpy==1.26.3 |
import cv2 Load and prepare imagesimage1_path = r"C:\Users\Saidakbar\Desktop\camera_loyiha\pythonProject\faces\Javohirbek.jpg" Load images with error handlingimage1 = cv2.imread(image1_path) Agar tasvirlar yuklangan bo'lsa, ularni RGB formatga o'tkazamizif image1 is not None: if image2 is not None: MySQL connection functiondef connect_database(): Save image name to MySQLdef save_image_path_to_db(img_name): Mark attendancedef markAttendance(name): Encode imagesdef findEncodings(images): Tasvirlarni va ularning nomlarini ro'yxatga qo'shishimages = [] if image2 is not None: Encode known facesencodeListKnown = findEncodings(images) Start the cameracap = cv2.VideoCapture(0) while True:
cap.release() |
I am able to print the names on terminal but its not updated on the .csv and the .csv is not converting into excel...help pls |
thanks it's work for me |
Description
Just trying to launch official example. The issue appears while reading jpg image, not camera input
What I Did
The text was updated successfully, but these errors were encountered: