Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions face_recognition_models/__init__.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Братан, спасибо, от души тебе огромная благодарность!!! С помощью тебя я сегодня поднял свой скилл в питоне, гите и в целом программировании. После того как неделю изучал зависимости, искал ошибки и даже пришел к выводу что как раз "pkg_resources" проблема, но у меня мало опыта в программировании и я не знал как исправить эту проблему. Обратил внимание на твою ветку и исправил код по твоему примеру. Это работает!!!

Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@
__email__ = 'ageitgey@gmail.com'
__version__ = '0.1.0'

from pkg_resources import resource_filename
try:
# Python 3.9+
from importlib.resources import files
except ImportError:
# Python 3.7-3.8 fallback
from importlib_resources import files

def pose_predictor_model_location():
return resource_filename(__name__, "models/shape_predictor_68_face_landmarks.dat")
return str(files(__name__).joinpath("models", "shape_predictor_68_face_landmarks.dat"))

def pose_predictor_five_point_model_location():
return resource_filename(__name__, "models/shape_predictor_5_face_landmarks.dat")
return str(files(__name__).joinpath("models", "shape_predictor_5_face_landmarks.dat"))

def face_recognition_model_location():
return resource_filename(__name__, "models/dlib_face_recognition_resnet_model_v1.dat")
return str(files(__name__).joinpath("models", "dlib_face_recognition_resnet_model_v1.dat"))

def cnn_face_detector_model_location():
return resource_filename(__name__, "models/mmod_human_face_detector.dat")
return str(files(__name__).joinpath("models", "mmod_human_face_detector.dat"))