how can we predict age of person from photo using python

asked 2019-05-15 08:33:27 -0600

I have done it for video but is not able to do it for a photo. when I try to use a photo using the following code:

(ref: https://www.learnopencv.com/age-gende...)

age_net.setInput(blob) age_preds = age_net.forward() : Error comes when I execute this line age = age_list[age_preds[0].argmax()]

the following error comes:

error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\dnn\src\layers\convolution_layer.cpp:282: error: (-2:Unspecified error) Number of input channels should be multiple of 3 but got 1 in function 'cv::dnn::ConvolutionLayerImpl::getMemoryShapes'

Can anyone help me in solving this issue?

edit retag flag offensive close merge delete