Service for image classification with PyTorch, Flask, Redis and Gunicorn.
Classifier uses the Resnet18, trained on ImageNet (1000 classes).
- Install Docker.
- Install Docker Compose.
- Build and run services
docker-compose up --build
.
The service provides an asynchronous API.
-
Send POST request for classification
curl "http://0.0.0.0:8000/classify" -F "file=@my_image.jpg"
If the file is successfully read by the system, you will receive a response in which there is auuid
key. -
Send GET request for checking result
curl "http://0.0.0.0:8000/classify?uuid=<your_uuid>"
Useuuid
obtained on previous step, e.g.curl "http://0.0.0.0:8000/classify?uuid=b48b2506-962c-4592-a480-ed7756b88dde"
. You will receive the result of the prediction, or the status of the request processing.