Files
Pranav Malladi 9771d56620 parameters fixed
2025-09-28 06:35:03 -04:00
..
2025-09-28 04:18:22 -04:00
2025-09-27 18:13:53 -04:00
2025-09-27 18:13:53 -04:00
2025-09-27 18:13:53 -04:00
2025-09-28 06:35:03 -04:00
2025-09-27 18:44:09 -04:00
2025-09-27 18:44:09 -04:00
2025-09-28 04:18:22 -04:00
2025-09-27 12:14:26 -04:00
2025-09-27 12:14:26 -04:00
2025-09-27 18:13:53 -04:00
2025-09-27 12:14:26 -04:00
2025-09-27 12:14:26 -04:00
2025-09-28 06:35:03 -04:00
2025-09-28 04:18:22 -04:00
2025-09-28 04:18:22 -04:00
2025-09-28 00:47:45 -04:00
2025-09-27 12:14:26 -04:00
2025-09-27 12:14:26 -04:00
2025-09-27 18:44:09 -04:00
2025-09-28 04:18:22 -04:00

RoAdCast - Flask + PyTorch CNN starter

This project contains a minimal Flask app and a small PyTorch CNN scaffold so you can train and run a model directly from VS Code.

Quick setup (Windows PowerShell):

  1. Create and activate a virtual environment
python -m venv .venv
.\.venv\Scripts\Activate.ps1
  1. Install dependencies
pip install -r requirements.txt
  1. Dataset layout

Image dataset (folder-per-class):

data/ class1/ img1.jpg class2/ img2.jpg

CSV dataset (single file):

data.csv (expects a label column and numeric feature columns)

Train commands:

Image training (default cnn):

python train.py data --epochs 5 --batch-size 16

CSV/tabular training (MLP):

python train.py data.csv --model-type mlp --epochs 20 --batch-size 64

The model will be saved as model.pth in the repo root (best validation checkpoint).

Run the Flask app (for local testing):

python app.py

Predict using curl (or Postman). Example with curl in PowerShell:

curl -X POST -F "image=@path\to\image.jpg" http://127.0.0.1:5000/predict

VS Code tips

  • Open this folder in VS Code.
  • Use the Python extension and select the .venv interpreter.
  • Use the Run panel to add a launch configuration that runs app.py or train.py.
  • For long training runs, run training in the terminal (not the debugger) and monitor logs.

Notes & next steps

  • The SimpleCNN uses 224x224 input and expects at least two maxpool steps; adjust models.py if you want smaller inputs.
  • Add better transforms and augmentation in data.py for better performance.
  • If GPU is available, PyTorch will use it automatically if installed with CUDA.