This repo contains a sample code to show how to create a Flask API server by deploying our PyTorch model. This is a sample code which goes with tutorial.
Install the dependencies:
pip install -r requirements.txt
Run the Flask server:
python app.py
gunicorn -w 4 -b :5000 app:app --log-level debug
From another tab, send the image file in a request:
curl -X POST -F [email protected] http://localhost:5000/predict
docker image build -t flask-ml .
docker run -p 5000:5000 -d flask-ml
kubectl apply -f deployment.yaml
kubectl port-forward <app-pod> 5000:5000
kubectl delete deployment flask-ml
The mighty MIT license. Please check LICENSE
for more details.