Skip to content

Latest commit

Β 

History

History
92 lines (62 loc) Β· 1.82 KB

File metadata and controls

92 lines (62 loc) Β· 1.82 KB

🐾 Fox Classifier

A simple ML project for classifying fox (and cat just) using PyTorch, FastAPI, and Streamlit.
The application runs via Docker Compose and consists of two services:

  • API (FastAPI + Uvicorn) β€” performs predictions using the trained model.
  • UI (Streamlit) β€” provides a user-friendly web interface to upload images and get results.

πŸ“‚ Project Structure


project-root/
│── foxes_for_TA             # A folder with Fox images for network testing, try them all, I searched very diligently for them  :)
│── code/
β”‚   β”œβ”€β”€ models/              # model training
β”‚   β”œβ”€β”€ deployment/
β”‚   β”‚   β”œβ”€β”€ api/             # FastAPI service and best model storage
β”‚   β”‚   └── app/             # Streamlit service
│── docker-compose.yml       # runs both services
│── README.md


πŸš€ Getting Started

1. Build and run containers

docker compose up --build

After that the following services will be available:


πŸ“– Usage

Via UI

  1. Open http://localhost:8501.
  2. Upload an image (cat / fox).
  3. Get a prediction from the model.

Via API

You can send a request directly:

curl -X POST "http://localhost:8000/predict/" \
  -F "file=@fox.jpg"

Response:

{
  "class": "fox
}

βš™οΈ Tech Stack

  • Python 3.10
  • PyTorch + Torchvision
  • FastAPI
  • Streamlit
  • Docker & Docker Compose

Update NN

In root of repo run following command

python code/models/thinker_main.py 

πŸ› οΈ TODO

  • Add model training inside a container
  • Store prediction history
  • Extend dataset and classes