🚀 This project was created using the e2e-ml-app cookiecutter template. Check it out to start creating your own ML applications.
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt [update requirements.txt as needed]
python dogapp/predict.py --url <image-url>
uvicorn dogapp.app:app --host 0.0.0.0 --port 5000 --reload
→ http://localhost:5000/docs
- Build image
docker build -t dogapp:latest -f Dockerfile .
- Run container
docker run -d -p 5000:5000 -p 6006:6006 --name dogapp dogapp:latest
dogapp/
├── experiments/ - experiment directories
├── logs/ - directory of log files
| ├── errors/ - error log
| └── info/ - info log
├── tests/ - unit tests
├── dogapp/
| ├── app.py - app endpoints
| ├── config.py - configuration
| ├── data.py - data processing
| ├── models.py - model architectures
| ├── predict.py - inference script
| ├── train.py - training script
| ├── utils.py - load embeddings
| ├── dog_names.txt - contains dog names
| └── weights.bext.Xception.hdf5 - learned weights of Xception model
├── .dockerignore - files to ignore on docker
├── .gitignore - files to ignore on git
├── .slugignore - files to ignore on slug
├── CODE_OF_CONDUCT.md - code of conduct
├── CODEOWNERS - code owner assignments
├── config.py - configuration
├── CONTRIBUTING.md - contributing guidelines
├── Dockerfile - dockerfile to containerize app
├── LICENSE - license description
├── logging.json - logger configuration
├── README.md - this README
├── setup.sh - setup file
└── requirements.txt - requirements
• Build image
docker build -t dogapp:latest -f Dockerfile .
• Run container if using CMD ["python", "app.py"]
or ENTRYPOINT [ "/bin/sh", "entrypoint.sh"]
docker run -p 5000:5000 --name dogapp dogapp:latest
• Get inside container if using CMD ["/bin/bash"]
docker run -p 5000:5000 -it dogapp /bin/bash
• Other flags
-d: detached
-ti: interative terminal
• Clean up
docker stop $(docker ps -a -q) # stop all containers
docker rm $(docker ps -a -q) # remove all containers
docker rmi $(docker images -a -q) # remove all images