Skip to content

diamondraras/face_recognition-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

face_recognition-api restful with python

A simple face_recgnition webservice api with flask

Installation

Clone the repo and install requirements

$ pip install -r requirements.txt

Run the wsgi.py file to start server

$ python wsgi.py

No server will be started on port 9999

Usage

  1. To simply get and recognize faces in one image
$ curl -F 'image=@myImage.png' http://localhost:9999/recognize

If one or more faces were found, we get a json response (name and base64 image)

[
    {
        "name" : "Diams",
        "string_img" : "iVBORw0KGgoAAAANSUhEUgAAAGsAAABrCAIAAAD/3etbAAA5WElEQVR4nHW9244kSZIldo6IqrlHXqq..."
    }

]
  1. To simply save a known face
$ curl -H "Content-Type:application/json" -d "[{\"name\" : \"Diams\", string_img : \"iVBORw0KGgoAAAANSUhEUgAAAGsAAABrCAIAAAD/3etbAAA5WElEQVR4nHW9244kSZIldo6IqrlHXqq...\"}]

if there is no error the answer will be

{
    "done": true
}
  1. To simply get all known faces
$ curl http://localhost:9999/get_all_faces

the response return all saved faces

[
    {
        "name" : "Voanjo",
        "string_img" : "iVBORw0KGgoAAAANSUhEUgAAAGsAAABrCAIAAAD/3etbAAA5WElEQVR4nHW9244kSZIldo6IqrlHXsdxqq..."
    },
    {
        "name" : "Ursulla",
        "string_img" : "iVBORw0KGgoAAAANSUhEUgAAAGwAAABsCAIAAAAABMCaAAA210lEQVR4nH29TY9kyZEtdo6Z3xuZ9dEfJJuc..."
    },
    {
        "name" : "Safdj",
        "string_img" : "iVBORw0KGgoAAAANSUhEUgAAAGwAAABrCAIAAAAdAfAiAABAeUlEQVR4nHX9Xa8tW3IdiI0RMWdmrrX2Pver..."
    }
    
]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%