-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Bounding box is inaccurate #1237
Comments
The issue you're facing with the bounding box coordinates, where the height and width of the boxes are larger than the actual face and sometimes vary randomly, might be due to the difference in the input image sizes between MTCNN and the face recognition model. MTCNN expects the input image size to be relatively small (typically a few hundred pixels), while the face recognition model may require a larger input image size (e.g., 160x160 pixels) for accurate feature extraction. When you extract the face region using the bounding box coordinates from MTCNN, it may result in a face image that doesn't match the size expectation of the face recognition model. To resolve this issue, you need to ensure that the face region extracted from MTCNN is resized to match the input size required by the face recognition model. You can use OpenCV's resize function or other image resizing methods to resize the face region before feeding it into the face recognition model. I hope this will solve the issue. If you need any more help feel free to reply. |
I am facing the same issue. I am detecting the faces and saving the cropped face image on local drive to further train a facial recognition model. But the bounding box is only accurate on top left corner. Other corners are expanded. Below is my code: mtcnn = MTCNN(keep_all=True, device='cuda:0') files = os.listdir(dir_path) for file in files:
`
|
I have this code:
`boxes, probs = mtcnn.detect(rgb_frame)
When I try to draw a rectange around the faces using the bounding box coordinates, the top left is accurate, but the height and width of the boxes are way bigger than the face, and they both sometimes are randomly way longer than they should be. Why is this happening? I am not using any parameters in the MTCNN object.
The text was updated successfully, but these errors were encountered: