Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to detect faces using predict.py #9

Open
akj2784 opened this issue Jul 18, 2020 · 0 comments
Open

Not able to detect faces using predict.py #9

akj2784 opened this issue Jul 18, 2020 · 0 comments

Comments

@akj2784
Copy link

akj2784 commented Jul 18, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant