Flask app for face recognition. Created to run local with a Magic Mirror project
Simple webservice for face recognition. Does have dependency for redis
Start with docker-compose
docker-compose up
#Add Obama to the database
curl -XPOST -Fname='Barak Obama' -Ffile=@test/obama.jpg localhost/upload
#Check if Obama i know from the Obama and Biden image
curl -XPOST -Ffile=@test/obamaandbiden.jpg localhost/who2
return:
{
"locations": [
[
167,
408,
322,
253
],
[
116,
683,
270,
528
]
],
"names": [
"Unknown",
"Barak Obama"
],
"upload_file": "cc47c84cdc5c4c5084bf4c8f4eacfef5.jpg"
}
Or simply visit the local http://localhost to upload some image to check
Quick overview, POST
Upload a image to the face_recognition database Parameters :
- name, text used a identifier name. If not specified the filename is use.
- file, a file to upload
Example
curl -XPOST -Fname='Barak Obama' -Ffile=@test/obama.jpg localhost/upload
Upload a image for face_recognition.
Paremeters :
- file, a file to upload Example
curl -XPOST -Fname='Barak Obama' -Ffile=@test/obama.jpg localhost/who
return:
{
"locations": [
[
167,
408,
322,
253
],
[
116,
683,
270,
528
]
],
"names": [
"Unknown",
"Barak Obama"
],
"upload_file": "cc47c84cdc5c4c5084bf4c8f4eacfef5.jpg"
}
Same as above, except the image rotation detection is not applied
Same as above, excpet upload image does get the faces and names drawn.
Thank Adam Geitgey for his very simple library. face_recognition