serengil / deepface

A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python
https://www.youtube.com/watch?v=WnUVYQP4h44&list=PLsS_1RYmYQQFdWqxQggXHynP1rqaYXv_E&index=1
MIT License
14.34k stars 2.2k forks source link

DEEPFACE_HOME env var not applied to `retinaface` weights filepath #389

Closed ErwinHaasnoot closed 2 years ago

ErwinHaasnoot commented 2 years ago

Hi Sefik,

Thanks for this great tool! I've found it very useful to quickly bootstrap my projects :)

The pull request below

https://github.com/serengil/deepface/pull/323

describes a very useful feature, that allows one to configure the location of the .deepface folder. However, it seems it is not yet consistently applied. Specifically in your retinaface project on Github:

https://github.com/serengil/retinaface/blob/c920f4e2b91e1ec04bdde013b3d29a4041ead59c/retinaface/model/retinaface_model.py#L18

I would make a pull request, but I'm not sure in which direction you'd want this problem solved. One option I see is making the deepface lib, as the orchestrator, download the weights, but then the retinaface lib would no longer be stand-alone. Another one I see is we include the get_deepface_home function in the retinaface lib, such that it also respects the path defined in the DEEPFACE_HOME env var, but it would mean some code replication.

Looking forward to hearing your thoughts!

Also, note that the current version of deepface on pypi (https://pypi.org/project/deepface/ ) is from August 20th and does not include the DEEPFACE_HOME configuration at all, but I see other people have already opened issues about it :)

serengil commented 2 years ago

I'm going to publish deepface in pip in the next couple of days

serengil commented 2 years ago

deepface and retinaface are diferent repos. You can add this feature in retinaface.