GraphQL Server for Facial Recognition.
222
GraphQL Server for Facial Recognition. Work in Progress.
pipenv install. You're all set!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.
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.
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.
Run this on your terminal:
docker run -p 8000:8000 johnpaulada/face-recognition-graphql-server
then access it at http://localhost:8000/graphql.
/ (root) path.recognizeFaces is a Query.MIT
Content type
Image
Digest
Size
533.8 MB
Last updated
about 8 years ago
docker pull johnpaulada/face-recognition-graphql-server