yu4u/age-gender-estimation

Why Resizing?

Opened this issue · 2 comments

Hi all, when running demo.py on images with a height or width larger than 640px I get the following error: error: (-215:Assertion failed) inv_scale_x > 0 in function 'resize'.

So I am wondering why you resize in

yield cv2.resize(img, (int(w * r), int(h * r)))
?

Thanks!

yu4u commented

Are you using Python 2.x?
Resizing is required to avoid too large input image size.

@sebo361 cv2 does not have very informative error messages - it will happily load a non-existent file.
Such errors then often occur when the image is NULL because the file didn't exist or was corrput!
Check that the image actually exists and is a valid numpy array.