Skip to content

Image recognition (Face/object)

The best programming language used with Face Recognition and Image Object Recognition in my opinion is python3. There is literally a python library to use when comes to matching face images to other face images.

First, we will need to install one library then we will use git to clone a repository to play with the predefined image.

Using pip3 after installing your trusty python3 programming language. We can run the following commands.

pip3 install --user face_recognition

git clone https://github.com/bradtraversy/face_recognition_examples

As simple as cake, the above two lines of items would be needed to get started in working on using this Face Recognition application. When you run the face_recognition software it will take in two arguments. The zero location will be the application, the first location is the known images and lastly the second location will be the unknown facial images.


hobbit@Hobbit : ~/github/facerecog $ /Users/hobbit/Library/Python/3.7/bin/face_recognition /Users/hobbit/facerecog/img/known/ /Users/hobbit/facerecog/img/unknown/

WARNING: No faces found in ./img/known/Bananas.jpg. Ignoring file.
/Users/flo/Library/Python/3.7/lib/python/site-packages/PIL/Image.py:932: UserWarning: Palette images with Transparency expressed in bytes should be converted to RGBA images
"Palette images with Transparency expressed in bytes should be "
./img/unknown/obama2_0.jpg,Barack Obama
./img/unknown/gettyimages-459761948.jpg,no_persons_found
./img/unknown/d-trump.jpg,Donald Trump
./img/unknown/obama.jpeg,Barack Obama
./img/unknown/barack-obama-12782369-1-402.jpg,Barack Obama
./img/unknown/gates_lookalike.jpg,Bill Gates
./img/unknown/keanu-reeves-9454211-1-402.jpg,unknown_person
./img/unknown/sarahmullerEB358D55-EC16-36C7-7932-0C2F4E502D06.jpg,Steve Jobs
./img/unknown/xxx_d06_jordan_01_876569.jpg,Michael Jordan
./img/unknown/lead_720_405.jpg,Donald Trump
./img/unknown/stevejobs.png,Steve Jobs
./img/unknown/bill-gates-4.jpg,Bill Gates
./img/unknown/1523669923561.jpg,Donald Trump
./img/unknown/keanu-reeves-2000.jpg,unknown_person
./img/unknown/220px-Mark_Wahlberg_2017.jpg,unknown_person
./img/unknown/mark.jpg,unknown_person
./img/unknown/jordan-basketball.jpeg,Michael Jordan
./img/unknown/mark2.jpg,unknown_person
./img/unknown/bill-gates-750-563.jpg,Bill Gates
./img/unknown/steve-jobs---mini-biography.jpg,Steve Jobs


i tried inserting a image of a banana.jpg into this facial recognition application to see whether it would detect another banana01.jpg in the unknown directory. Interesting enough, this facial recognition is only able to detect faces. As you can see, this application detected an unknown image in the known directory which was not recognizable as a face. It then skipped over.

I felt as if facial recognition application will only work with facial images unlike where if one were to use an application to recognize a known physical object, one would then require other arsenals in the python lib. perhaps, Facial recognition is far different than object recognition as I digressed.

Leave a Reply

Your email address will not be published.