-
Notifications
You must be signed in to change notification settings - Fork 124
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
can't run success on inference.py, The error:IndexError: too many indices for array: array is 0-dimensional, but 3 were indexed #28
Comments
Hi, it happens when the MTCNN face detector cannot find face properly. AdaFace/face_alignment/mtcnn.py Line 39 in 2848516
or use a more powerful face detector like https://github.com/serengil/retinaface (this one you have to check whether the alignment is same as MTCNN). Another thing you could do if you need to force inference is just bypass the alignment step and resize the input to 112x112x3 and feed it to the model directly. Since AdaFace model is a convnet, it does not throw error even if the face is not aligned. Just make sure that the color channel is BGR. |
Can I change the face detector code myself using retinaface instead of MTCNN if so where can I change it |
OK thanks |
Following on this, how do we bypass the detection phase? I understand that theres a align function in the class
However, it still goes through face detection, my case is that I already have cropped face images and so therefore the bounding box would be the whole input image Edit: |
Hi @nicken, I used something that comment @mk-minchul, and I solved by the block of de "try: Except" into align.py file and call in there and evaluation model of retinaface or YOLO pretrained for example in prediction mode. So into align.py at get_aligned_face function just change exception code to:
You do not forget to reload the modules and import. I hope to you help you @nicken. I have been trying to training with custom data an I found #75. |
i try run the demo of inference.py when i get code
but i get this error info:
i find get error because the face is none on the face detection and don't known why i can't get face, i only run the code in new env and don't have any change on code
i think maybe the env have different, this is my env:
The text was updated successfully, but these errors were encountered: