Coder Social home page Coder Social logo

Comments (9)

Any-Winter-4079 avatar Any-Winter-4079 commented on May 23, 2024 1

A hack to solve this:
The weights come from here:
https://drive.google.com/uc?id=1qcr9DbgsX3ryrz2uU8w4Xm3cOrRywXqb

You can download them and put them on your equivalent of this path:
/Users/myself/.deepface/weights/yolov8n-face.pt

Or to be sure, print it in Yolo.py

weight_path = f"{folder_utils.get_deepface_home()}{PATH}"
print(weight_path)

from deepface.

serengil avatar serengil commented on May 23, 2024

Need detailed exception message please

Normally, exception thrown module and line info should be printed. As I understand, you customize something because these are not standard output of deepface.

from deepface.

serengil avatar serengil commented on May 23, 2024

When I test that backend as

DeepFace.analyze(img_path=img_path, detector_backend="yolov8")

Then I am having a successful response.

[{'emotion': {'angry': 0.27702577454904015,
   'disgust': 1.6584374963028672e-06,
   'fear': 5.269103613165452e-05,
   'happy': 58.46902829039434,
   'sad': 0.10684493573024102,
   'surprise': 0.004627124696059116,
   'neutral': 41.14242388515757},
  'dominant_emotion': 'happy',
  'region': {'x': 233, 'y': 79, 'w': 152, 'h': 216},
  'face_confidence': 0.863529622554779,
  'age': 30,
  'gender': {'Woman': 99.9902606010437, 'Man': 0.009742558904690668},
  'dominant_gender': 'Woman',
  'race': {'asian': 0.2046308602172649,
   'indian': 0.3006282674523155,
   'black': 0.02210449442703989,
   'white': 83.31937094446248,
   'middle eastern': 7.54583746468052,
   'latino hispanic': 8.607432014193058},
  'dominant_race': 'white'}]

So, your case may be related to the input image you are feeding (share with me if it is not private), or depending on your customization.

from deepface.

serengil avatar serengil commented on May 23, 2024

That error message should come from regex, and regex is not being used in deepface. You may get it from something different than deepface?

from deepface.

serengil avatar serengil commented on May 23, 2024

Closed because exception message is not coming from deepface

from deepface.

Any-Winter-4079 avatar Any-Winter-4079 commented on May 23, 2024

Here's a bit more information about the error:

Traceback (most recent call last):
  File "project/face_recognition/deepface_library/find_match.py", line 32, in <module>
    dfs = DeepFace.find(img_path=test_image_path,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "project/tensorflow-metal-test/lib/python3.11/site-packages/deepface/DeepFace.py", line 296, in find
    return recognition.find(
           ^^^^^^^^^^^^^^^^^
  File "project/tensorflow-metal-test/lib/python3.11/site-packages/deepface/modules/recognition.py", line 209, in find
    source_objs = detection.extract_faces(
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "project/tensorflow-metal-test/lib/python3.11/site-packages/deepface/modules/detection.py", line 84, in extract_faces
    face_objs = DetectorWrapper.detect_faces(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "project/tensorflow-metal-test/lib/python3.11/site-packages/deepface/detectors/DetectorWrapper.py", line 82, in detect_faces
    face_detector: Detector = build_model(detector_backend)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "project/tensorflow-metal-test/lib/python3.11/site-packages/deepface/detectors/DetectorWrapper.py", line 50, in build_model
    face_detector = face_detector()
                    ^^^^^^^^^^^^^^^
  File "project/tensorflow-metal-test/lib/python3.11/site-packages/deepface/detectors/Yolo.py", line 25, in __init__
    self.model = self.build_model()
                 ^^^^^^^^^^^^^^^^^^
  File "project/tensorflow-metal-test/lib/python3.11/site-packages/deepface/detectors/Yolo.py", line 47, in build_model
    gdown.download(WEIGHT_URL, weight_path, quiet=False)
  File "project/tensorflow-metal-test/lib/python3.11/site-packages/gdown/download.py", line 259, in download
    filename_from_url = m.groups()[0]
                        ^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'groups'

from deepface.

serengil avatar serengil commented on May 23, 2024

Closed with PR - #1038

Thank you @Any-Winter-4079

from deepface.

gbaufake avatar gbaufake commented on May 23, 2024

@serengil can you release a new version of DeepaFace on Pypi?

from deepface.

serengil avatar serengil commented on May 23, 2024

I will do it soon, meanwhile you can use the source code as

$ git clone https://github.com/serengil/deepface.git
$ cd deepface
$ pip install -e .

from deepface.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.