[HN Gopher] DeepFace: A lightweight deep face recognition librar...
       ___________________________________________________________________
        
       DeepFace: A lightweight deep face recognition library for Python
        
       Author : serengil
       Score  : 231 points
       Date   : 2025-01-03 12:03 UTC (3 days ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | bn-l wrote:
       | Hey good post. I enjoy your blog also.
        
       | aussieguy1234 wrote:
       | 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 wrote:
         | Check out the README. They comment on the accuracy.
        
         | Refusing23 wrote:
         | 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 wrote:
         | 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 wrote:
         | 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 wrote:
           | > 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 wrote:
       | 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 wrote:
       | 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 wrote:
         | 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 wrote:
       | 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 wrote:
         | 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 wrote:
           | 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 wrote:
             | 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 wrote:
         | > 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 wrote:
           | 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 wrote:
         | 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 wrote:
         | 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 wrote:
       | I somehow miss the time when face recognition was the only
       | "controversial" area of ML/AI.
        
       | liamYC wrote:
       | 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 wrote:
         | Yet also short sighted hairless apes with all the genetic
         | programming that comes with, for better AND for worse.
        
       | babayega2 wrote:
       | 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
        
       | barrkel wrote:
       | 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.
        
       ___________________________________________________________________
       (page generated 2025-01-06 23:02 UTC)