serengil / deepface

A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python
https://www.youtube.com/watch?v=WnUVYQP4h44&list=PLsS_1RYmYQQFdWqxQggXHynP1rqaYXv_E&index=1
MIT License
12k stars 2.03k forks source link

Supress face detector output? #551

Closed pjbh closed 2 years ago

pjbh commented 2 years ago

Thank you so much for this amazing piece of work. I downloaded the latest version to get the newly added models. Now the face detectors give an output, a lot of it in the case of mtcnn, which they did not do before. Is there a way to tell them not to? Thanks, Peter

serengil commented 2 years ago

what do you mean exactly? can you share your program and output sample?

pjbh commented 2 years ago

DeepFace.verify(filelist[0], filelist[1], model_name = "Facenet")

1/1 [==============================] - 1s 887ms/step 1/1 [==============================] - 0s 39ms/step

It used not to give this output

serengil commented 2 years ago

You can use this arg: https://github.com/serengil/deepface/blob/master/deepface/DeepFace.py#L95

pjbh commented 2 years ago

Like this? Doesn't seem to have any effect

for file in filelist[1:len(filelist)]: result = DeepFace.verify(filelist[0], file, model_name = "ArcFace", prog_bar = False) print(file + ' ' + str(result["verified"]) + ' ' + str(result["distance"]))

1/1 [==============================] - 0s 63ms/step 1/1 [==============================] - 0s 56ms/step C:/Users/pjbh2/anaconda3/envs/deepface1\AnnaFriel0001.jpg True 0.376147657150524

serengil commented 2 years ago

interesting because it should work.

serengil commented 2 years ago

what is the content of file list?

pjbh commented 2 years ago

Just a few face jpg files, to test things out, so I can see what happens with different models and detectors. It's no biggie for me, just clutters up the output and used not to happen. I still have the old environment if I don't want the new models (Facenet512 appears to give identical results to Facenet, anyhow). To try this version, I set up a fresh env in Anaconda, using Python 3.9.13

serengil commented 2 years ago

if you pass just an image to verify function, then progress bar is silent. i think your trouble is coming from a dependency such as tqdm version. i am closing this issue because i cannot re-produce it.

serengil commented 2 years ago

i had this issue in tensorflow 2.10.0 and i could not resolve it

when i downgrade tensorflow to 2.7.4, then this is sorted.

codenoid commented 7 months ago

this is weird?, I'm on tensorflow==2.15.0.post1 this log are still exist

codenoid commented 7 months ago

I found the solution

import keras
keras.utils.disable_interactive_logging()

anywhere on the python project (yours or the mtcnn lib) https://github.com/ipazc/mtcnn/issues/121#issuecomment-1942708344