https://github.com/idealo/falcon-prediction-app
Simple Machine Learning Web API Example with Falcon
https://github.com/idealo/falcon-prediction-app
api falcon machine-learning-api python3 rest-api
Last synced: 7 months ago
JSON representation
Simple Machine Learning Web API Example with Falcon
- Host: GitHub
- URL: https://github.com/idealo/falcon-prediction-app
- Owner: idealo
- License: apache-2.0
- Archived: true
- Created: 2018-07-12T09:39:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-07T14:06:52.000Z (9 months ago)
- Last Synced: 2025-03-05T15:02:05.895Z (7 months ago)
- Topics: api, falcon, machine-learning-api, python3, rest-api
- Language: Jupyter Notebook
- Homepage:
- Size: 24.8 MB
- Stars: 50
- Watchers: 6
- Forks: 22
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Machine Learning Web API Example with Falcon
Simple example that uses [Falcon](https://falconframework.org/) to create a deep learning RESTful prediction service (simple convnet trained on the MNIST dataset). [Locust](https://locust.io/) is used for load testing.
[Gunicorn](http://gunicorn.org/) as WSGI HTTP Server and [nginx](https://www.nginx.com/) as HTTP proxy server.This repository is no longer maintained and has been archived on January, 7th, 2025.
## Getting Started
### Run prediction service
```
docker build -t falcon-prediction-app .
docker run -p 127.0.0.1:8000:8081 falcon-prediction-app
```### Test prediction service
```
(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
```### Run unittests
```
pytest -s src/tests/
```### Run load testing
```
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.## Dependencies
- Python conda environment (install with `conda env create --file environment.yml`)
- Gunicorn
- Falcon
- Keras
- Tensorflow
- Pillow
- Locust## Copyright
See [LICENSE](LICENSE) for details.