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
10.85k stars 1.91k forks source link

[BUG]: deepface "find" method runs very slowly (16 sec per iteration), unable to use gpu #1231

Closed arsenal2006 closed 1 month ago

arsenal2006 commented 1 month ago

Before You Report a Bug, Please Confirm You Have Done The Following...

DeepFace's version

0.0.91

Python version

3.11

Operating System

windows 10

Dependencies

absl-py==2.1.0 astunparse==1.6.3 beautifulsoup4==4.12.3 blinker==1.7.0 cachetools==5.3.2 certifi==2023.11.17 charset-normalizer==3.3.2 click==8.1.7 colorama==0.4.6 contourpy==1.2.0 cycler==0.12.1 deepface==0.0.91 filelock==3.13.1 fire==0.5.0 Flask==3.0.1 flatbuffers==23.5.26 fonttools==4.47.2 fsspec==2023.12.2 gast==0.4.0 gdown==5.0.1 google-auth==2.27.0 google-auth-oauthlib==1.0.0 google-pasta==0.2.0 grpcio==1.60.1 gunicorn==21.2.0 h5py==3.10.0 idna==3.6 itsdangerous==2.1.2 Jinja2==3.1.3 joblib==1.3.2 keras==3.3.3 kiwisolver==1.4.5 libclang==16.0.6 Markdown==3.5.2 markdown-it-py==3.0.0 MarkupSafe==2.1.3 matplotlib==3.8.2 mdurl==0.1.2 ml-dtypes==0.3.2 mpmath==1.3.0 mtcnn==0.1.1 namex==0.0.8 networkx==3.2.1 numpy==1.24.3 oauthlib==3.2.2 opencv-python==4.9.0.80 opt-einsum==3.3.0 optree==0.11.0 packaging==23.2 pandas==2.2.0 pillow==10.2.0 protobuf==4.23.4 pyasn1==0.5.1 pyasn1-modules==0.3.0 Pygments==2.18.0 pyparsing==3.1.1 PySocks==1.7.1 python-dateutil==2.8.2 pytz==2024.1 requests==2.31.0 requests-oauthlib==1.3.1 retina-face==0.0.14 rich==13.7.1 rsa==4.9 scikit-learn==1.4.0 scipy==1.11.4 six==1.16.0 soupsieve==2.5 sympy==1.12 tensorboard==2.16.2 tensorboard-data-server==0.7.2 tensorflow==2.16.1 tensorflow-estimator==2.13.0 tensorflow-intel==2.16.1 tensorflow-io-gcs-filesystem==0.31.0 termcolor==2.4.0 tf_keras==2.16.0 threadpoolctl==3.2.0 torch==2.1.2+cu121 torchaudio==2.1.2+cu121 torcheval==0.0.7 torchvision==0.16.2 tqdm==4.66.1 typing_extensions==4.5.0 tzdata==2023.4 urllib3==2.1.0 Werkzeug==3.0.1 wrapt==1.14.1

Reproducible example

dfs = DeepFace.find(img_path=os.path.join(gallery_path, face_im),
                                                db_path=cur_path,
                                                model_name='ArcFace',
                                                detector_backend='retinaface',
                                                threshold=0.5,
                                                enforce_detection=False)

Relevant Log Output

No response

Expected Result

No response

What happened instead?

No response

Additional Info

No response

serengil commented 1 month ago

Duplicated - https://github.com/serengil/deepface/issues/1176