shobhit9618 / celeb_recognition

Model to recognize celebrities using a face matching algorithm.
MIT License
5 stars 1 forks source link

module 'celeb_detector' has no attribute 'celeb_recognition' #5

Open BishanSingh246 opened 1 month ago

BishanSingh246 commented 1 month ago

This is the code as shown in the documentation: https://pypi.org/project/celeb-detector/

import celeb_detector # on running for the first time, this will download vggface model
# img_path = 'sample_image.jpg' # this supports both local path and web url like https://sample/sample_image_url.jpg
img_path = 'Alia_Bhatt_promoting_Kalank.jpg' # this supports both local path and web url like https://sample/sample_image_url.jpg
celeb_detector.celeb_recognition(img_path) # on running for the first time, 2 files (celeb_mapping.json and celeb_index_60.ann) will downloaded to your home directory

This is the error I am getting:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-17-d0e4e36cb43e>](https://localhost:8080/#) in <cell line: 4>()
      2 # img_path = 'sample_image.jpg' # this supports both local path and web url like https://sample/sample_image_url.jpg
      3 img_path = 'Alia_Bhatt_promoting_Kalank.jpg' # this supports both local path and web url like https://sample/sample_image_url.jpg
----> 4 celeb_detector.celeb_recognition(img_path) # on running for the first time, 2 files (celeb_mapping.json and celeb_index_60.ann) will downloaded to your home directory

AttributeError: module 'celeb_detector' has no attribute 'celeb_recognition'
shobhit9618 commented 1 month ago

Hi, did you pip install celeb-detector?

You can refer to my huggingface repo, it has more updated readme and the latest models as well: https://huggingface.co/resnet151/celeb_detector

You can also try this:

git lfs install
git clone https://huggingface.co/resnet151/celeb_detector
cd celeb_detector
pip install -e .

This should install all of the required dependencies.