Simple API to process an image using OpenCV and return the face detections
- requisits: Python3.7
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python db_config.py
python run.py
Returns json data with image id and face coordinate.
- URL
POST /api/upload
- Data Params
- Image file with extension {jpg, jpeg, png}
- Success Response:
- Code: 200
- Content: {data: {id: 1, faces: [{x: 100, y:11, width: 28, height: 28},]}}
- Error Response:
- Code: 422 Unprocessable Entity
- Content: {file_error: "file format not allowed"}
OR
- Code: 500 SERVER ERROR
- Content: {'errors': {'internal_error':''}
- Exemple:
curl -i -X POST -H "Content-Type: multipart/form-data"
-F "file=/path/to/image" http://0.0.0.0/api/upload/
Send a image binnary with the face identified.
- URL
GET /api/get/portrait/image/<int:image_id>
- Data Params
- url image id
- Success Response:
- Code: 200
- Content: ""
- Error Response:
- Code: 500 SERVER ERROR
- Content: {'errors': {'internal_error':''}