[Python] Silencing progress bars spawned by DeepFace's extract_faces method

Discussão em 'Python' iniciado por Stack, Abril 17, 2025.

  1. Stack

    Stack Membro Participativo

    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 = {}
    image = a numpy array of shape (X, X, 3)
    for bknd in bknds:
    faces = DeepFace.extract_faces(img_path=image, detector_backend=bknd, align=True)
    detections[bknd] = detections


    Everything works perfectly, the only problem is that the library prints a lot of progress bar while extract_faces is running and I can't get rid of them. I have my progress bar and logging, and all the ones spawned by the library make the output a real mess to read. I know that some methods of deepface have a silent parameter, but this one doesn't for some reason. Does anyone has any idea on how to fix this? It would be very helpful!

    Thank you in advance!

    I tried reading the documentations, changing the backends (apparently the opencv one doesn't print progress bars)

    Continue reading...

Compartilhe esta Página