Pretrained model deployment with FastAPI and Docker.
Here I use pretrained EfficientNetB0 model from tensorflow.keras.applications for image classification. Example of images can be found in imgs folder.
app.py is an entry point of the project
- Set up a virtual environment:
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
- Run
uvicorn app:app --port 8080 - Open
index.htmlin browser - Select any image and classify it
Example:
The only thing you need to run this project in Docker is Docker Desktop installed on your computer.
- Run .\deploy.ps1 in PowerShell
- Open
index.htmlin browser - Select any image and classify it
- To create requirements.txt file use
pip list --format=freeze > requirements.txtcommand to avoid weirdly looking paths
