Error when entering images of different sizes
prnr opened this issue · comments
Traceback (most recent call last):
File "/home/greon/.local/bin/deface", line 8, in
sys.exit(main())
File "/home/greon/.local/lib/python3.8/site-packages/deface/deface.py", line 383, in main
image_detect(
File "/home/greon/.local/lib/python3.8/site-packages/deface/deface.py", line 191, in image_detect
anonymize_frame(
File "/home/greon/.local/lib/python3.8/site-packages/deface/deface.py", line 82, in anonymize_frame
draw_det(
File "/home/greon/.local/lib/python3.8/site-packages/deface/deface.py", line 42, in draw_det
blurred_box = cv2.blur(
cv2.error: OpenCV(4.7.0) /io/opencv/modules/imgproc/src/box_filter.dispatch.cpp:446: error: (-215:Assertion failed) !_src.empty() in function 'boxFilter'
In addition to the error, there is a problem that the position of the blur does not settle properly on the face if it is not a 4:3 ratio image. How can I solve this?
Can you please provide the image that causes the issue, or a comparable image in the same format so I can try to reproduce this?
Can you please provide the image that causes the issue, or a comparable image in the same format so I can try to reproduce this?
I used the validation dataset of 'wider face'(http://shuoyang1213.me/WIDERFACE/). In addition, the same problem occurred in the coco 2017 validation set, so when I changed all images to the same height and width, it worked without any problem. It seems to be acceptable to a certain level of error, but I don't know exactly.
The unstable position of the blur seems to occur when the height of the image is not completely the same.
Thanks for the additional info. I have reproduced the issue on the WIDERFACE validation set when running batch detection on image folders. Indeed the different shapes were causing the issue. Deface had wrongly assumed that it's enough to do some shape calculations just once on the first image that's fed into it. Now with the latest commits (will make a release later this week) it should work correctly with arbitrary shapes in one call. Can you verify that it works now?
Thanks for the additional info. I have reproduced the issue on the WIDERFACE validation set when running batch detection on image folders. Indeed the different shapes were causing the issue. Deface had wrongly assumed that it's enough to do some shape calculations just once on the first image that's fed into it. Now with the latest commits (will make a release later this week) it should work correctly with arbitrary shapes in one call. Can you verify that it works now?
Perfectly works! Thank you!