Building face classifier using knn

The following error is coming while running code as described in video


The error is as follows: trainset=np.concatenate((face_dataset,face_labels),axis=1)

ValueError: all the input arrays must have same number of dimensions
:-Kindly please rectify code

Hey @sulbh579, i ran it on my system, it ran completely fine, also there is this single mistake which i corrected,
out=knn(trainset,face_section.flatten())

You used ‘,’ before flatten() which should be ‘.’.
Make sure you data folder is not empty, also shape of face_dataset should be say (x,30000) and face_labels should be (x,1).

Hope this cleared your doubt.
Plz mark the doubt as resolved in my doubts section. :blush:

This problem is not solving “Make sure you data folder is not empty, also shape of face_dataset should be say (x,30000) and face_labels should be (x,1).”
And This is code of data collection https://ide.codingblocks.com/s/198713

Hey @sulbh579, could you please share the screenshot of the terminal after runnin first the data_collection file and than the face recognition.py. But before that, copy and paste the code from these files to make sure these files are running.

I ran your both files in my system, and they ran completely fine, without any errors.

thanks for resolving doubt

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.