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

Differentiating faces after utils/generate_db.py #8

Open
nathan-m-schneider-22 opened this issue Jan 20, 2021 · 10 comments
Open

Differentiating faces after utils/generate_db.py #8

nathan-m-schneider-22 opened this issue Jan 20, 2021 · 10 comments

Comments

@nathan-m-schneider-22
Copy link

After successfully running utils/generate_db.py on several different faces (.jpg images 96x112, all different people) and using that db for inference_video, I'm still having trouble differentiating the faces. I tried to keep each face in the same format as the examples in /image, however, all the faces are assigned the same label.

After the dot product in postprocessing face_recognition, the result is typically around

[[[5.13239309]]
 [[5.13109348]]
 [[5.30474482]]
 [[5.53775566]]
 [[5.09075269]]
 [[5.30884969]]
 [[5.03641731]]]

with index 3 always chosen as the argmax, and that label is always assigned.
db.npy.zip

My main question is: what format should the images be in for the model to successfully differentiate faces / is there a different way to differentiate faces outside of the db method?

@nathan-m-schneider-22
Copy link
Author

update:
I tried to save feature data to a db from the camera to guarantee similarity between db data and camera input. However, the above problem persists

@zye1996
Copy link
Owner

zye1996 commented Jan 21, 2021

hi, I suspect that the model associated with that script is obsolete. You can try another model and I will look into it this weekend.

@nathan-m-schneider-22
Copy link
Author

Thanks for the quick reply! I've actually fixed the problem myself by creating my own db out of features from the camera. My issue was that I saved the features without normalizing them. As such, the dot product in postprocessing-face_recognition was weighted arbitrarily towards certain faces. After collecting new face data and normalizing it, the output result looked less like

[[[5.13239309]]
 [[5.13109348]]
 [[5.30474482]]
 [[5.53775566]]
 [[5.09075269]]
 [[5.30884969]]
 [[5.03641731]]]

And mapped between 0 and 1.

 [[0.94093935]]
 [[0.96431198]]
 [[0.97200852]]

I love this repo, so tomorrow I'll make a PR modifying utils/generate_db.py to make normalized data out of an image directory, along with README documentation to help new users build a db and recognize faces.

@zye1996
Copy link
Owner

zye1996 commented Jan 21, 2021

Thanks for the quick reply! I've actually fixed the problem myself by creating my own db out of features from the camera. My issue was that I saved the features without normalizing them. As such, the dot product in postprocessing-face_recognition was weighted arbitrarily towards certain faces. After collecting new face data and normalizing it, the output result looked less like

[[[5.13239309]]
 [[5.13109348]]
 [[5.30474482]]
 [[5.53775566]]
 [[5.09075269]]
 [[5.30884969]]
 [[5.03641731]]]

And mapped between 0 and 1.

 [[0.94093935]]
 [[0.96431198]]
 [[0.97200852]]

I love this repo, so tomorrow I'll make a PR modifying utils/generate_db.py to make normalized data out of an image directory, along with README documentation to help new users build a db and recognize faces.

That would be awesome! I will also make an interactive tool for users to record the face. Thank you so much!

@nathan-m-schneider-22
Copy link
Author

PR + docs ready, need permissions for nathan-m-schneider-22 to make a PR

@zye1996
Copy link
Owner

zye1996 commented Jan 22, 2021

PR + docs ready, need permissions for nathan-m-schneider-22 to make a PR

Hi I have enabled the PR can you please try one more time and let me know?

@nathan-m-schneider-22
Copy link
Author

remote: Permission to zye1996/Mobilefacenet-TF2-coral_tpu.git denied to nathan-m-schneider-22.
fatal: unable to access 'https://github.com/zye1996/Mobilefacenet-TF2-coral_tpu.git/': The requested URL returned error: 403

@zye1996
Copy link
Owner

zye1996 commented Jan 22, 2021

remote: Permission to zye1996/Mobilefacenet-TF2-coral_tpu.git denied to nathan-m-schneider-22.
fatal: unable to access 'https://github.com/zye1996/Mobilefacenet-TF2-coral_tpu.git/': The requested URL returned error: 403

Hi did you make modification on a forked repo or you cloned the repo and modify? Probably you need take the first approach

@nathan-m-schneider-22
Copy link
Author

Cloned, branched, edited, pushed upstream branch

@zye1996
Copy link
Owner

zye1996 commented Jan 22, 2021

Cloned, branched, edited, pushed upstream branch

To make a pull request you have to fork the repo first and modify the forked version, otherwise, Github will reject it.

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

2 participants