Simple Machine Learning Web API Example with Falcon
Simple example that uses Falcon to create a deep learning RESTful prediction service (simple convnet trained on the MNIST dataset). Locust is used for load testing. Gunicorn as WSGI HTTP Server and nginx as HTTP proxy server.
docker build -t falcon-prediction-app .
docker run -p 127.0.0.1:8000:8081 falcon-prediction-app
(echo -n '{"image": "'; base64 src/tests/data/four_test.png; echo '"}') |
curl -i -H "Content-Type: application/json" -d @- http://127.0.0.1:8000/predict
pytest -s src/tests/
locust -f load_testing.py --host=http://127.0.0.1:8000
Note: Access the Locust GUI via http://localhost:8089/
to start load testing.
conda env create --file environment.yml
)See LICENSE for details.