##Description Face-Detection using OpenCV library with Django python server.
Go to root directory of the project, and
$ python manage.py runserver
- Posting image via URL:
$ curl -X POST 'http://localhost:8000/face_detection/detect/' -d 'url=https://upload.wikimedia.org/wikipedia/commons/9/90/PM_Modi_2015.jpg' ; echo ""
You will get response something like this,
{"num_faces": 1, "success": true, "faces": [[74, 54, 196, 176]]}
- Posting image via file instead of URL:
$ curl -X POST -F [email protected] 'http://localhost:8000/face_detection/detect/' ; echo ""
Here your response depends on your input image.
{"num_faces": 2, "success": true, "faces": [[88, 75, 179, 166], [216, 79, 301, 164]]}
- In your access_cv_api/ directory of the project, run the file test_api,
$ python test_api.py
Here, we have the code for both getting image via URL and file (from local storage). Just uncomment whatever you want.