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

Support DeepFace Library #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

solonovamax
Copy link

Adds support for the DeepFace python library.

According to their benchmarks, Facenet512 with the retinaface backend has 76.92% fewer false negatives than dlib's models.

So, just felt I'd add this.

However, the Dockerfile still needs to be updated to support the use of poetry.

@solonovamax
Copy link
Author

Since DeepFace only exists as a python library and not as a php library, I feel its addition here is appropriate as it would allow people to use models other than dlib's model with this.

Copy link
Owner

@matiasdelellis matiasdelellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!. 😄 😃 🎉
The idea of ​​externalizing the models was mainly to invite people to try out other models. And this particular model promises a lot!.

I would be happy to incorporate this model and test it to see the results, but right now I'm focused on publishing the NC30 compatible version. Wait a bit and try to incorporate these small changes
.. 😉
Thanks a lot!!. 😬

return dlib.rectangle(
json["top"], json["right"], json["bottom"], json["left"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you change the order here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to the docs, this was the correct order. using the previous order produced issues.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this would be the documentation for DeepFace, but for dlib models you need the original order.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was in the documentation for the dlib rectangle class

if I then used the top, bottom, right, and left functons, they return the correct result with these changes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it is from the docs:

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: dlib.rectangle, left: int, top: int, right: int, bottom: int) -> None
  2. __init__(self: dlib.rectangle, rect: dlib::drectangle) -> None
  3. __init__(self: dlib.rectangle, rect: dlib.rectangle) -> None
  4. __init__(self: dlib.rectangle) -> None

http://dlib.net/python/index.html#dlib_pybind11.rectangle

facerecognition_external_model/main.py Outdated Show resolved Hide resolved
@@ -0,0 +1,19 @@
[tool.poetry]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know poetry, but I'll see if it's worth leaving these files... 🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

me neither, I'm not a python dev

I just hear it's what people use

@nicolas-r
Copy link

Hi

easier to say than actually doing it, but if more models are added to the project, maybe the main python file should be split into several files, like a kind of "plugin" system.

Poetry is one of the many Python tools to manage virtual environment (deploy, add packages, etc.) and track dependencies of a project. It's a very useful tool

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

Successfully merging this pull request may close these issues.

3 participants