Experimenting with setting up a backend computer vision classification service with huggingfaces pytorch-image-models (TIMM).
- 1. Introduction and Overview
- 2. Getting Started
- 3. Directory Structure
- 4. CI Pipeline
- 5. Licence
- 6. Acknowledgments
This is a project set up for the course "Data Challenges SoSe23" at Goethe Uni. It features a backend for a computer vision leveraging the possability of easily extending the 'timm' to easily spin up some SOTA deep learning models. In this project we use these models for transfer learning to classify ancient coins. The application is dockerized to make development easy and the service is exposed via FastAPI endpoints allowing the models to be interacted with and train and infer with http requests.
- backend for flexible transfer learning and inference using timm models
- FastAPI app to expose backend
- Install and Setup dependancies as described in their documentations
Start only Pytorch Project:
- Open VsCode command palette(strg+p)
- run
Dev Containers: Open Folder in Container - select
pytorch_servicefolder
With API:
- Open VsCode command palette(strg+p)
- run
Dev Containers: Open Folder in Container - select
srcfolder - from terminal in the container run:
uvicorn api.src.fastapi_server:app --reload --host 0.0.0.0 --port 80to start server - In browser enter http://localhost:8000/docs for Swagger endpoint documentation
This project is licensed under the MIT licence - see LICENSE file for details.
Inspiration, usefull repos, code snippets, etc.
- Transfer learning with timm models and pytorch: https://www.kaggle.com/code/hinepo/transfer-learning-with-timm-models-and-pytorch#Dataset-class
- TIMM: https://github.com/huggingface/pytorch-image-models/tree/main
- Pytorch Accelerated: https://github.com/Chris-hughes10/pytorch-accelerated/tree/main/pytorch_accelerated
- dstoolkit-devcontainers: https://github.com/microsoft/dstoolkit-devcontainers
- timmdocs: https://timm.fast.ai/
- Getting Started with PyTorch Image Models (timm): A Practitioner’s Guide: https://towardsdatascience.com/getting-started-with-pytorch-image-models-timm-a-practitioners-guide-4e77b4bf9055
- FastAPI: https://fastapi.tiangolo.com/