DeepFace is a leading open-source library for facial recognition and facial attribute analysis, and the de facto standard in Python. It wraps multiple state-of-the-art models that have reached — and even surpassed — human-level accuracy in recognizing faces.

By the numbers (as of early 2025): 15,000+ stars on GitHub; ~4 million installations via pip; 800+ citations in academic papers

Whether you're building a cutting-edge AI project or simply exploring facial recognition, DeepFace makes advanced capabilities accessible with just a few lines of code.

  • bn-l 4 days ago |
    Hey good post. I enjoy your blog also.
  • aussieguy1234 4 days ago |
    how accurate is the age detection? i.e. lets say you have someone who looks much younger than their age, would this model be able to detect the persons actual age?
    • ted_dunning 4 days ago |
      Check out the README. They comment on the accuracy.
    • Refusing23 4 days ago |
      i would assume it CAN Be accurate if people 'look their age' but of course you can easily have someone who looks younger or older than their age that skews the overall etimate
    • barrkel 4 days ago |
      It depends on the quality of the image. It's most accurate for a square head-on photo, like a passport photo, and can be wildly off for occluded or angled photos. It's more accurate for people under 30, for older people it often underestimates age.
    • michaelt 4 days ago |
      For most machine learning systems, "performance equivalent to an expert human" is the best you can expect - simply because it's learned from training data labelled by expert humans.

      So if a person looks much younger than their age in the judgement of an expert human, I wouldn't expect the model to do any better than that.

      You should also know a lot of work in this area relies on photos of celebrities scraped from the internet - which is much easier than getting loads of labelled images of normal people in normal situations, which would be a total hassle practically and legally.

      Of course that has some benefits - if you know the celebrity's date of birth and the date of the photo, you don't need to rely on human labelling to know the age of the person in the photo! But it has the major disadvantage that if your application doesn't involve professionally made up people with movie star looks in evening wear on red carpets - you might find real world performance falls short of the benchmark claims.

      • bangaladore 4 days ago |
        > For most machine learning systems, "performance equivalent to an expert human" is the best you can expect - simply because it's learned from training data labelled by expert humans.

        However, this is one of the few cases where presumably the data could be perfect, far exceeding the ability of a expert human.

        Some things have no ground truth. For example, masking objects for training vision object detection models. Does the object end at this pixel or that one?

  • bishes 4 days ago |
    Love this package. has a bunch of functions for most face recognition, detection and feature extraction purposes. love the readme.md docs for familiarizing with the basic features. PLUS it offers different models(backends) for the tasks which lets you try out a bunch of approach for the same task without writing a custom function
  • rahimnathwani 4 days ago |
    I'm curious whether others here are working with supervised dimensionality reduction for face embeddings, particularly using single-task or multi-task learning approaches.

    While clustering tends to perform better after dimensionality reduction, selecting the optimal dimensions depends heavily on your specific use case. This makes it more complex than simply applying PCA or t-SNE.

    • woodson 4 days ago |
      If you have labelled data, you can try linear discriminant analysis (LDA; also known as canonical discriminant analysis), which maximizes the between-class variance while minimizing the within-class variance to best separate different classes by projecting data onto a new space that maximizes class separability (for whichever classes help your specific use case).
  • highcountess 4 days ago |
    Quite curious how no one ever talks about “responsible use of facial recognition” or policies to control the use of facial recognition, as it totally pervades and destroys the ability of a person to remain anonymous, at all.

    It’s always curious to me how the peasants always seem eager to facilitate the interests of the monarchs to oppress them rather than their own interests to remain free from control by the narcissistic psychopathy of the ruling class prone to tyranny. What do you do as a peasant once you’ve closed the trap you created and led yourself into? I guess maybe more accurately would be to say that it is the aspirational minor nobility that facilitates the creation of the structure that serves the creation of oppressive, top down structures. It’s an odd human characteristic.

    • planb 4 days ago |
      Your criticism seems somewhat misplaced. An open-source facial recognition library enables the peasants to wield the same tools that the monarchs already have at their disposal. The cat is out of the bag, and there’s no putting it back.
      • isodev 4 days ago |
        We can ban the stuff until such time when we truly need it.

        Doesn’t help with the climate crisis? No. Does it help with any of the ongoing health threats? No. Does it help hungry people finding food and healthcare or somehow advancing science or any cultural benefits? No.

        Does it consume vast amounts of water and electricity to facilitate “bad example of humanity” use cases? Oh yes.

        Just feel our priorities are not where they should be.

        • planb 4 days ago |
          So we as humanity should stop all actions that are not directly solving the worlds largest problems (at least if there might be slightly negative side effects)? And what’s up with the energy and water consumption argument. I accept this for LLMs maybe, but not for a local python script that runs on consumer hardware. Should we stop playing video games, too?
    • DrillShopper 4 days ago |
      > Quite curious how no one ever talks about “responsible use of facial recognition” or policies to control the use of facial recognition

      That's because that debate has already been lost starting in about 2000 to 2001. 9/11 was really the last nail in that coffin.

      • Clubber 4 days ago |
        Post 9/11 made everything shitty. I feel bad for people who didn't know life before it; now it's the normal.

        I would imagine other milestones for new and improved shittiness is the drug war, 1993 crime bill, prohibition, Woodrow Wilson and WWI, etc.

    • qchris 4 days ago |
      Respectfully, I think it's more likely that you're just not personally plugged into and/or have your awareness tuned to them but those conversations are definitely happening. There's not a single consensus (at least in the U.S.), but discussion definitely occurs and in many cases has led to concrete action.

      [1] https://www.npr.org/2021/05/07/982709480/massachusetts-pione...

      [2] https://www.nytimes.com/2019/05/14/us/facial-recognition-ban...

      [3] https://www.wired.com/story/face-recognition-banned-but-ever...

    • isodev 4 days ago |
      There is the EU AI Act which heavily regulates the use of facial recognition, but I feel that we as “the people in tech who makes these things” should be a lot more conservative in creating frameworks, abstractions and generally advancing/facilitating facial rec use.

      It’s even more shocking as this library also incorporates a great deal of cultural bias. e.g. gender, emotion are attributes which vary a lot more than what the models allow for.

  • theanonymousone 4 days ago |
    I somehow miss the time when face recognition was the only "controversial" area of ML/AI.
  • liamYC 4 days ago |
    How do you measure positive and negative societal impact of this technology?

    I find mobile phone face unlock so useful, giving every citizen the power to use face recognition could be better than a few people, robots that identify someone and give them lifesaving medication are great (but the opposite, robot assassin can also be created). I guess it comes down to good people building good tools. Humans are generally kind and empathetic

    • TheRealQueequeg 4 days ago |
      Yet also short sighted hairless apes with all the genetic programming that comes with, for better AND for worse.
    • unhappy_meaning 3 days ago |
      It'll be a net-positive for things like that, passports might be rendered useless in the future since they're already using facial recognition at Customs. It can help solve crimes given it can recognize faces using CCTV footage amongst other things.

      There is a certain level of distrust since it can be abused and people think it will lead to a dystopian police state.

  • babayega2 4 days ago |
    Very nice package. I used it recently for a project where I needed to detect faces in images as tasks with celery [0]. I wonder if there is an equivalent for OCR.

    [0]: https://github.com/srugano/facematch

  • maximilianthe1 4 days ago |
    This looks very similar to what ChatGPT would write
    • PyWoody 4 days ago |
      It probably is but the commentator is the creator of the project.
  • barrkel 4 days ago |
    The performance is focused on correctness and the APIs work with individual images. The underlying models can be run with batches, but you need to extract the architecture code to run directly. As a result, while I started with DeepFace, I mostly just used the models.
500 Internal Server Error

500 Internal Server Error