From ccb7aafc489a041a2fd5cc8382a0030aa4fb5994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=9Eefik=20Serangil?= Date: Sat, 11 Apr 2020 16:38:31 +0300 Subject: [PATCH] api --- README.md | 10 ++++++++++ deepface/app.py => api/api.py | 0 {api_request => api}/deepface.postman_collection.json | 0 3 files changed, 10 insertions(+) rename deepface/app.py => api/api.py (100%) rename {api_request => api}/deepface.postman_collection.json (100%) diff --git a/README.md b/README.md index 769bfb5..c40b626 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,16 @@ pip install -e . Initial tests are run for Python 3.5.5 on Windows 10 but this is an OS-independent framework. Even though pip handles to install dependent libraries, the framework basically needs the dependencies defined in the [requirements](https://github.com/serengil/deepface/blob/master/requirements.txt). You might need the specified library requirements if you install the source code from scratch. +# API + +Deepface offers an API as well. You can clone [`/api/api.py`](https://github.com/serengil/deepface/tree/master/api/api.py) and pass it to python command as an argument. This will get a rest service up. + +``` +python api.py +``` + +The both face recognition and facial attribute analysis are covered in the API. You are expected to call these functions as post methods. Service endpoints will be `http://127.0.0.1:5000/verify` for face recognition and `http://127.0.0.1:5000/analyze` for facial attribute analysis. You should pass input images as base64 encoded string in this case. [Here](https://github.com/serengil/deepface/tree/master/api), you can find a postman project. + # Playlist Deepface is mentioned in this [youtube playlist](https://www.youtube.com/watch?v=KRCvkNCOphE&list=PLsS_1RYmYQQFdWqxQggXHynP1rqaYXv_E). diff --git a/deepface/app.py b/api/api.py similarity index 100% rename from deepface/app.py rename to api/api.py diff --git a/api_request/deepface.postman_collection.json b/api/deepface.postman_collection.json similarity index 100% rename from api_request/deepface.postman_collection.json rename to api/deepface.postman_collection.json