yu4u / age-gender-estimation

Keras implementation of a CNN network for age and gender estimation
MIT License
1.46k stars 502 forks source link

Why Resizing? #115

Open sebo361 opened 4 years ago

sebo361 commented 4 years ago

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 https://github.com/yu4u/age-gender-estimation/blob/65e6abe5b518d10933dc18b0b4874e5247f8f7c5/demo.py#L74 ?

Thanks!

yu4u commented 4 years ago

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

trifle commented 3 years ago

@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.