serengil / deepface

A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python
https://bit.ly/deepface-py
MIT License
14.63k stars 2.22k forks source link

AttributeError: module 'deepface.commons.functions' has no attribute 'preprocess_face' #653

Closed mohd109 closed 1 year ago

mohd109 commented 1 year ago

Hi, I'm using the stream function and get this error.

Detector backend is opencv VGG-Face is built Emotion model loaded Age model loaded Gender model loaded Facial attribute analysis models loaded in 8.277608156204224 seconds Finding embedding for Mohammad1.jpg: 0%| | 0/1 [00:00<?, ?it/s] Traceback (most recent call last): File "C:\Users\Mohammad Shankayi\Desktop\deepface1.py", line 16, in DeepFace.stream(db_path = "./database") File "C:\Users\Mohammad Shankayi\AppData\Roaming\Python\Python39\site-packages\deepface\DeepFace.py", line 590, in stream realtime.analysis(db_path, model_name, detector_backend, distance_metric, enable_face_analysis File "C:\Users\Mohammad Shankayi\AppData\Roaming\Python\Python39\site-packages\deepface\commons\realtime.py", line 97, in analysis img = functions.preprocess_face(img = employee, target_size = (input_shape_y, input_shape_x), enforce_detection = False, detector_backend = detector_backend) AttributeError: module 'deepface.commons.functions' has no attribute 'preprocess_face'

serengil commented 1 year ago

hey. i know the issue. actually code is updated and this bug is sorted in the source code. but i have not published it yet. i will publish a new release soon. meanwhile, you can use the source code. in the read me, using the source code instead of pip is explained.