82 questions
1
vote
1
answer
51
views
How do I deploy a service using deepface without reloading the model?
I want to load the model first. Then, every time I input an image, I can perform the inference without having to reload the model every time.
For example, I will use verification:
res = DeepFace....
0
votes
1
answer
76
views
Silencing progress bars spawned by DeepFace's extract_faces method
I'm using the library DeepFace in my personal project to extract bounding boxes of detected faces from images. As of now my setup is fairly simple, given the list of desired backends bknds:
detections ...
1
vote
1
answer
313
views
Multi-Process in deepface (face recognition)
Is there a way to send faces to the find function in parallel in face recognition?
(I want to create a batch processing or multi-processing mode so that I can process multiple faces on the GPU at the ...
0
votes
1
answer
567
views
How can I run DeepFace in a docker container on a mac?
I am trying to install deepface in docker container to do image comparison and I am close to getting it to run... however, I think I am probably missing dependencies... but cannot figure out which ...
1
vote
1
answer
192
views
DeepFace Analyze - Test scripts for batched image processing
I am having trouble getting image analysis batch processing to work. I would like to send a list of images to DeepFace to get a list of race, gender, and age predictions. I am calling test functions ...
0
votes
1
answer
200
views
Is there a way to use deepface.find() with a db being a S3 or a db table containing embeddings?
I'm working on a college project using DeepFace, and one of the requirements is to run an appliciation hosted in the cloud.
Is there a way to use DeepFace.find() function setting the db_path as an S3 ...
0
votes
1
answer
486
views
How to change default location of Deepface model weights from home folder to project folder?
When you load a model from Deepface for the first time, it downloads the model weights .h5 file in the home_folder/.deepface folder and loads them for use from there.
I want to store and fetch these ...
2
votes
0
answers
62
views
Error processing frame: failed to allocate memory [Op:AddV2] - Deepface object detection
i'm a newbie to object detection, we wrote a script to identify gender and age of a person using the deepface library and then adds trackers using the Sort library.
The code works well on the CPU and ...
0
votes
1
answer
196
views
How to Parallelize a Flask App with Gunicorn and Distribute GPU Usage Among Workers?
I am building a Flask app to handle facial embeddings using DeepFace. My goal is to serve approximately 50 clients, with an estimated 10 requests per minute. Each request involves running deepface....
0
votes
1
answer
130
views
Error building Docker image for AWS Lambda function: Unable to install h5py due to missing HDF5 library
I'm trying to build a Docker image for an AWS Lambda function that requires the h5py library. However, I'm encountering an error related to missing HDF5 dependencies during the build process.
=> ...
1
vote
2
answers
1k
views
Choosing the threshold in DeepFace
Is there any study that shows how the default thresholds were chosen for the models present in DeepFace?
def find_threshold(model_name: str, distance_metric: str) -> float:
base_threshold = {&...
0
votes
1
answer
668
views
How can i pass build model in deepface library?
I am using face recognition library deepface,and using find method for identify images i need to pass prebuild model to that method but it is not working can any one explain how can i do that?
output2 ...
0
votes
2
answers
2k
views
How to feed DeepFace.find() the faces extracted by DeepFace.extract_faces()?
I'm creating a face recognition script that process a list of photos and check if the face has a match in the database.
If Yes, add the cropped face to its matched folder in the database.
If No, add ...
0
votes
0
answers
219
views
DeepFace Module Not Found Error on macOS After Installation
I'm developing a web application using CodeIgniter that includes a facial recognition feature for attendance using the DeepFace library. I'm coding on Windows, but when I run my project on macOS, I ...
0
votes
0
answers
741
views
deepFace: No module named 'tensorflow.keras'
i try downgrading from tensorflow = 2.16.1 to 2.15.0. because when i run it with tensorflow = 2.16.1 i encountered tf-keras not found.
now i have tensorflow =2.15.0 , (Ubuntu). how can i solve this ...
0
votes
0
answers
310
views
DeepFace module export to disk, How?
I have being trying to use DeepFace module in python, to detect live video face with a photo, for which i used this Python code
import cv2
from deepface import DeepFace
# URL of the phone's camera ...
0
votes
1
answer
396
views
How to set decision-tree distance threshold in Deepface library? Regarding "LightFace: A Hybrid Deep Face Recognition Framework" paper
I am reading deep face library paper,"LightFace: A Hybrid Deep Face Recognition Framework".
Q1. Is there code to explain how to determine the distance threshold?
The decision tree(C4.5) ...
0
votes
1
answer
177
views
i am making a face authentication program using opencv and deepface model in python
I wrote this function but is some times give me this error
"Authenticated as Muhammad Zair
[ WARN:[email protected]] global cap_msmf.cpp:1768 CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. ...
0
votes
1
answer
47
views
Package Error while running the python file | Tensorflow
ImportError: DLL load failed while importing _pywrap_tf2: A dynamic link library (DLL) initialization routine failed.
I find the above Error in package. I don't understand why is error happening. ...
0
votes
0
answers
943
views
Face "recognition" using mediapipe
I'm using mediapipe to detect faces in a web camera live stream. I have a function to capture 50 face images from the stream and save it locally. then save all the facial features to a pkl file using ...
0
votes
1
answer
636
views
ImportError: cannot import name 'distance' from 'deepface.commons' (/opt/anaconda3/envs/LIP/lib/python3.9/site-packages/deepface/commons/__init__.py)
Unable to import deepface in Python
I am currently using Pycharm on macbook.
Virtual environment is already activated and still getting the below error.
Can anyone please help me here.
Python 3.9
...
1
vote
1
answer
376
views
How can I resolve the problem with **AttributeError: 'NoneType' object has no attribute 'copy'**
Here's my code
import cv2
import threading
from deepface import DeepFace
cap = cv2.VideoCapture(0,cv2.CAP_DSHOW)
cap.set(cv2.CAP_PROP_FRAME_WIDTH,640)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT,480 )
counter ...
1
vote
0
answers
148
views
Calculating EuclideanDistance in SQL for Deepface facial embeddings?
Is anyone here familiar with deepface library? I was following this article to start my adventures into facial recognition, but I ran into an issue that I can't seem to resolve (due to my lack of ...
0
votes
2
answers
2k
views
Should I use the default model in the deepface package or fine-tune it to fit with my data for face recognition?
I have 1000 classes, each containing 10 images. For face recognition with my dataset, would it be more beneficial to use a pretrained model or to perform fine-tuning?
Should I retrain from scratch, ...
-2
votes
1
answer
880
views
the layer sequential has never been called and thus has no defined input
I am running a simple script within my Anaconda virtual env
from deepface import DeepFace
face_analysis = DeepFace.analyze(img_path = "face3.jpeg")
print(face_analysis)
But I keep getting ...
0
votes
1
answer
3k
views
ValueError: The layer sequential has never been called and thus has no defined input
I have written this streamlit code to detect whether a person is wearing a mask or not and if not then display their estimated age and gender using DeepFace library. I've used tensorflow to use pre-...
2
votes
3
answers
3k
views
ImportError: cannot import name 'LocallyConnected2D' from 'tensorflow.keras.layers'
I installed deepface via pip:
pip install deepface
and running very simple code sample:
from deepface import DeepFace
result = DeepFace.verify(model_name='VGG-Face', detector_backend='yolov8', ...
0
votes
0
answers
272
views
Error when trying to install DeepFace on Python 3.9
I tried to install DeepFace on my Windows device, using Python 3.9, but it gives me this error:
C:\Windows\System32>pip install deepface
Collecting deepface
Using cached deepface-0.0.83-py3-none-...
0
votes
0
answers
133
views
cv2.dnn issue with using SDD in deepface.analyze(): no attribute 'readNetFromCaffe'
I have installed opencv-python version 4.9.0.80 and deepface version 0.0.81. and it seems to cause an issue when I try to run DeepFace.analyze() with SSD detector backend:
DeepFace.analyze('Img.jpg', [...
0
votes
1
answer
654
views
AttributeError: 'NoneType' object has no attribute 'xy' (YOLOV8 | Deepface)
I'm running deepface model for face recognition and chose YOLOV8 for detecting face. Here is the code I'm running:
from deepface import DeepFace
result = DeepFace.verify(model_name='VGG-Face', ...
-5
votes
1
answer
241
views
i have problem with keras_vggface library
this is my code
from keras_vggface.vggface import VGGFace model = VGGFace(model='resnet50')type here
and this is the Traceback
``
ImportError Traceback (most recent call ...
0
votes
1
answer
850
views
Is media pipe is use with deep face for face recognition for better accuracy
I'm using deep face for recognition but the accuracy is not good so I try to implement the media pipe in which I extract the landmarks so I give this to the deep face for better accuracy. Is there any ...
0
votes
4
answers
803
views
`AssertionError` while installing `deepface` via pip
I'm trying to install deepface library via pip but it fails with AssertionError.
My system specs are:
OS : POP-OS 22.04
Python: Python-3.10.12
Pip: pip-22.0.2
update 01
I did the following with pip:
...
0
votes
0
answers
31
views
DeepFace IndexError: single positional indexer is out-of-bounds
I am using the following repository -https://github.com/slashtechno/wyzely-detect. This works okay and face is correctly recognised until more than one face is seen in th frame, the program stops and ...
2
votes
1
answer
432
views
Error with DeepFace library in Chaquopy Android Project
I have been trying to run the following snippet of code for deepface for comparing two images containing a face.
Python code:
face_similarity.py
import base64
from io import BytesIO
from PIL import ...
1
vote
2
answers
2k
views
Speed up the real time face-detection using CV2 and DeepFace
I am trying to build a real-time face detector that should meet these requirements:
Fast
As much accurate as possible even in darker conditions of the enviroment
I can easly add a face recognition ...
0
votes
1
answer
2k
views
Get realtime data from DeepFace Stream function
I have successfully tested the stream function from DeepFace library to get real time face detection and analysis data from my webcam. I call this method:
from deepface import DeepFace
DeepFace....
0
votes
0
answers
31
views
Deepface error. ImportError: cannot import name 'formatargspec' from 'inspect' [duplicate]
from deepface import DeepFace
# Provide the correct path to your image file
img_path = "happy_face_woman.png"
# Analyze the face in the image
face_analysis = DeepFace.analyze(img_path=...
1
vote
1
answer
2k
views
Parallelize DeepFace on multiple GPUs
I am trying to use the DeepFace python library to do face recognition and analysis on long videos: https://github.com/serengil/deepface.
Using the library out of the box, I am able to get desired ...
-1
votes
2
answers
107
views
TypeError: list indices must be integers or slices, not str (Display prediction text with putText from a list)
I am having trouble displaying the "dominant_emotion" text from the 'prediction' on an image using deepface and cv2
import cv2
import matplotlib.pyplot as plt
from deepface import DeepFace
...
1
vote
1
answer
1k
views
how to run deepfacelive on my python using windows
Below is what I get after trying to run deepfacelive on my Anaconda. I am using a windows computer.
(tudazdeep) C:\Users\owner\Desktop\DeepFaceLive-master>python main.py run DeepFaceLive--userdata-...
0
votes
0
answers
232
views
ERROR with deepface install: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects
I try to install deepface and got a lot of red messages. the error msg in the end:
ERROR: Could not build wheels for opencv-contrib-python, which is required to install pyproject.toml-based projects.
...
1
vote
1
answer
373
views
KeyError when initializing ResNet using Dlib in python
I want to use DeepFace DlibResNet but it gives error.
I have already installed dlib 19.24.0 and deepface 0.0.79.
My python version is 3.10.5 and I use Jupiyter Lab.
import dlib
from deepface import ...
1
vote
2
answers
1k
views
save images to folder from DeepFace.find()
I have this code:
from deepface import DeepFace
image1 = "test.jpeg"
DeepFace.find(img_path = image1,
db_path = "faces",
enforce_detection = ...
1
vote
1
answer
650
views
How to disable the progress bar in DeepFace library?
I am using the DeepFace library to analyze emotions in a video. Here is the relevant code:
import cv2
from deepface import DeepFace
cap = cv2.VideoCapture("video.mp4")
prev_emotion = None
...
2
votes
1
answer
1k
views
Camera does not open when attempting to run a face recognition program (opencv-python, deepface)
I am following a youtube tutorial (https://www.youtube.com/watch?v=pQvkoaevVMk), My camera isn't activating once the code is run, i tried googling answer but cant seem to figure it out. I am new to ...
-1
votes
1
answer
582
views
openCV (cv2) module's methods not working, neither auto-completion working in VSCode
I was working on a Face Recognition project using deepface and openCV (cv2) modules, but methods of cv2 are not working/being recognized by VScode, neither the auto-completion is working. I have ...
1
vote
1
answer
652
views
Face identification on Google Cloud Function
I want to test if two pictures belong to the same person using Google Cloud Function. The function would recieve the images in base64 format. During runtime, these images would be converted to JPEG ...
0
votes
3
answers
1k
views
Type of the result using DeepFace.analyze()
when I use DeepFace.analyze the type of the output variable is ''list'' instead of ''dict''.
I don't know where the problem is exactly, you can see my code below
import cv2 ## pip install opencv-...
1
vote
0
answers
120
views
DeepFace: Checking file extensions
I would like to use serengil/deepface library to process a bunch of images. However, some of the extensions are not processed by deepface such as CR2 files. Some of the files in the db_path are also ...