This repository contains a minimal solution for Assignment 1 in the PMLDL course.
The goal is to prepare data, train a simple CNN on MNIST, expose it via a FastAPI backend, and build a small Streamlit frontend to draw digits and get predictions.
.
├── docker-compose.yml
├── README.md
└── src
├── api
│ ├── api.py
│ ├── Dockerfile
│ └── requirements.txt
├── app
│ ├── app.py
│ ├── Dockerfile
│ └── requirements.txt
└── prepare
├── dataset
│ └── data_processing.py
├── Dockerfile
├── model
│ └── model.py
└── requirements.txt
-
Build and start all services:
docker compose up --build
-
Workflow:
-
prepare: downloads MNIST, saves
train.pt/test.pt, trains CNN, and saves weights tosimple_nn.pth. -
api: loads the trained model and serves endpoints:
GET /health→ returns{"status": "ok"}POST /predict→ takes a 28×28 digit array and returns prediction + probabilities.
-
app: launches Streamlit UI to draw digits and call the API.
-
-
Open the frontend in your browser: http://localhost:8501