You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have used 124 images of a kid with wide varieties of photo covering the age group of 1-5 years), did encoding and then trained it and then ran the predict.py file.
�[6;30;42m=====Predicting faces in './test-images\DSC_0010.JPG'=====�[0m
X_faces_loc []
faces_encodings []
Found 0 faces in the image
Traceback (most recent call last):
File "predict.py", line 50, in
closest_distances = clf.kneighbors(faces_encodings, n_neighbors=1)
File "C:\Users\Akash Jain\AppData\Roaming\Python\Python36\site-packages\sklearn\neighbors\base.py", line 403, in kneighbors
X = check_array(X, accept_sparse='csr')
File "C:\Users\Akash Jain\AppData\Roaming\Python\Python36\site-packages\sklearn\utils\validation.py", line 552, in check_array
"if it contains a single sample.".format(array))
ValueError: Expected 2D array, got 1D array instead:
array=[].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
What could be the reason ? I have tried with 5-6 sample images with very clear face but still it doesn't detect. Am I missing something ? Does it need more data to train ? ALso even if it doesnt detect face ideally it should not throw up error.
The text was updated successfully, but these errors were encountered:
I have used 124 images of a kid with wide varieties of photo covering the age group of 1-5 years), did encoding and then trained it and then ran the predict.py file.
�[6;30;42m=====Predicting faces in './test-images\DSC_0010.JPG'=====�[0m
X_faces_loc []
faces_encodings []
Found 0 faces in the image
Traceback (most recent call last):
File "predict.py", line 50, in
closest_distances = clf.kneighbors(faces_encodings, n_neighbors=1)
File "C:\Users\Akash Jain\AppData\Roaming\Python\Python36\site-packages\sklearn\neighbors\base.py", line 403, in kneighbors
X = check_array(X, accept_sparse='csr')
File "C:\Users\Akash Jain\AppData\Roaming\Python\Python36\site-packages\sklearn\utils\validation.py", line 552, in check_array
"if it contains a single sample.".format(array))
ValueError: Expected 2D array, got 1D array instead:
array=[].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
What could be the reason ? I have tried with 5-6 sample images with very clear face but still it doesn't detect. Am I missing something ? Does it need more data to train ? ALso even if it doesnt detect face ideally it should not throw up error.
The text was updated successfully, but these errors were encountered: