You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Sefik! Thanks for sharing the library. I use your library for race detection for about 1000 images. As you suggested in some comments below the YouTube video, I use list to store image names, and in this way, it will not kill much memory.
My goal is to obtain the predicted race information in obj, which is a dictionary produced by the DeepFace.analyze function. However, for some images (for example, testface2 and testface3), there is no face detected, so there shows error message "Face could not be detected. Please confirm that the picture is a face photo or consider to set enforce_detection param to False." The obj function cannot be obtained. I tried to turn enforce_detection to False but to ensure my result is accurate enough, I hope to turn it to be True. I am wondering if there is a way that I still can get obj, but for the images for which face not detected, it just produce a value like "not detected" instead of terminating the function without any obj produced.
Method 2: Build a for loop. Previous versions of deepface had a memory error in this approach but now you can call it in a for loop. It is totally fine.
Hello, thanks for your work. One question: Does using for loop for predicting attributes for batch of images slow down the overall computation, since the model will be loaded and unloaded for every function call?
Thanks for prompt reply @serengil. There is one thing I do not understand then. I migrated to H100 gpu from a worse one, and other DL applications like kohya lora training got 3x faster. But feature extraction using deepface did not. I thought that model loading might be a bottleneck, but as you said it seems it is not. Do you have any insight why deepface library did not get faster when a better gpu used?
Activity
serengil commentedon Mar 16, 2022
facial_imgs = ["testface1.jpg", "testface2.jpg", "testface3.png"]
Method 1: Set enforce detection the False. In this way, you will not have any trouble. However, accuracy will be down.
obj = DeepFace.analyze(facial_imgs, actions = ['race'], enforce_detection = False, detector_backend = backends[3])Method 2: Build a for loop. Previous versions of deepface had a memory error in this approach but now you can call it in a for loop. It is totally fine.
ligujie123 commentedon Mar 16, 2022
Thanks a lot! Really helpful suggestions!
CodeofDutyAI commentedon Oct 15, 2024
Hello, thanks for your work. One question: Does using for loop for predicting attributes for batch of images slow down the overall computation, since the model will be loaded and unloaded for every function call?
serengil commentedon Oct 15, 2024
@CodeOfDuty44 no it is singletonish, it is loaded once and be reused from the 2nd iteration
CodeofDutyAI commentedon Oct 15, 2024
Thanks for prompt reply @serengil. There is one thing I do not understand then. I migrated to H100 gpu from a worse one, and other DL applications like kohya lora training got 3x faster. But feature extraction using deepface did not. I thought that model loading might be a bottleneck, but as you said it seems it is not. Do you have any insight why deepface library did not get faster when a better gpu used?