Sign inSign up

johnpaulada/face-recognition-graphql-server

By johnpaulada

•Updated about 8 years ago

GraphQL Server for Facial Recognition.

Image
0

222

johnpaulada/face-recognition-graphql-server repository overview

⁠Face Recognition GraphQL Server

GraphQL Server for Facial Recognition. Work in Progress.

forthebadge forthebadge forthebadge

forthebadge Made With GraphQL

⁠Installing

  1. Install Pipenv.
  2. Install cmake.
  3. Run pipenv install. You're all set!

⁠Using the Server

To start the server, run pipenv run python server.py. When you see something like:

Serving on http://0.0.0.0:8000

then the server is running and open it in http://localhost:8000/graphql.

⁠Adding Faces

To add faces to the server, use this mutation:

mutation AddFace($name: String!, $imageData: String!) {
  addFace(name: $name, imageData: $imageData) {
    ok
  }
}

Add the name and base64 of an image to the $name and $imageData parameters, respectively. ok will be true if the operation succeeds.

⁠Recognizing Faces

To recognize faces, use this mutation:

mutation RecognizeFaces($imageData: String!) {
    recognizeFaces(imageData: $imageData) {
        names
    }
}

and use the base64 of an image as the argument to $imageData.

You'll get a response similar to this:

{
  "data": {
    "recognizeFaces": {
      "names": [
        "Lisa (BlackPink)"
      ]
    }
  }
}

where names is a list of possible matches.

⁠Using Docker

Run this on your terminal:

docker run -p 8000:8000 johnpaulada/face-recognition-graphql-server

then access it at http://localhost:8000/graphql.

⁠Known Issues

  1. Can't handle duplicate names yet.
  2. No display on the / (root) path.
  3. recognizeFaces is a Query.

⁠License

MIT

Tag summary

Content type

Image

Digest

Size

533.8 MB

Last updated

about 8 years ago

docker pull johnpaulada/face-recognition-graphql-server