Git Product home page Git Product logo

facedb's Introduction

facedb's People

Contributors

buerjeanmaxime avatar nishat48 avatar robonxt avatar shhossain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

facedb's Issues

Dependency Handling and Initialization

I noticed in db.py, there are conditional imports that are controlled by global variables and locks which may lead to race conditions. This may happen as threads enter locked sections and do not have the information on whether the necessary module is already imported by another unless it is reflected by the globals. If the checking of these globals is for some reason bypassed, two threads may end up importing the same module twice, leading to unnecessary operations. This could be avoided by importing these modules at the start of the program and global variables should not be modified unless the modification is handled through a thread-safe mechanism such as thread-local storage.

Error: python setup.py egg_info did not run successfully (Ubuntu)

Got this error when trying to install from pip with venv, but works fine if I run locally

Collecting facedb
  Using cached FaceDB-0.0.11.tar.gz (22 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  ร— python setup.py egg_info did not run successfully.
  โ”‚ exit code: 1
  โ•ฐโ”€> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-jxm2tbc8/facedb_264dbc4cde644c5fa4b895d2e1cc1f9c/setup.py", line 13, in <module>
          with open("requirements.txt") as f:
      FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

ร— Encountered error while generating package metadata.
โ•ฐโ”€> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

OS: Ubuntu 22.04.3 LTS x86_64
Python Version: 3.10.12

Multiple images per person

Hello,
As far as I understand the package does not allow adding multiple images of the same person, the update function just replaces the embeeding.
Do you consider adding this feature? Or can you give me some suggestions/pitfalls to avoid/direction how should I implement it?

cannot import name 'distance' from 'deepface.commons'

When running the simple FaceDB example in the README.md and setting the module to deepface, I get the following error/s:

.../deepface/.venv/lib/python3.10/site-packages/facedb/db.py:263: UserWarning: Deepface module is not calibrated for vector database. Use `face_recognition` instead.
  warnings.warn(
Traceback (most recent call last):
  File ".../deepface/.venv/lib/python3.10/site-packages/facedb/db.py", line 49, in load_module
    from deepface.commons import distance as deepface_distance
ImportError: cannot import name 'distance' from 'deepface.commons' (.../deepface/.venv/lib/python3.10/site-packages/deepface/commons/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "~/deepface/test_facedb.py", line 24, in <module>
    db = FaceDB(
  File ".../deepface/.venv/lib/python3.10/site-packages/facedb/db.py", line 307, in __init__
    load_module(module)
  File ".../deepface/.venv/lib/python3.10/site-packages/facedb/db.py", line 51, in load_module
    raise ImportError(
ImportError: Please install `deepface` to use `deepface` module.

My text code:

from facedb import FaceDB

# Create a FaceDB instance
db = FaceDB(
    path="facedata", module="deepface"
)

# Add a new face to the database
face_id = db.add("robonxt", img="dataset/robonxt/robonxt01.png")

# Recognize a face
result = db.recognize(img="test.jpg")

# Check if the recognized face is similar to the one in the database
if result and result["id"] == face_id:
    print(f"Recognized as {result['name']}")
else:
    print(f"Unknown face")

According to serengil/deepface#1008, the distance metric calculation module was moved to the verification module, thus distance is no longer in deepface.commons.

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.