Install dependencies:
source .venv/bin/activate
pip install -r requirements.txtCreate data/.env:
ROBOFLOW_API_KEY=your_key
Download the dataset:
python data/download.pyExpected dataset path after download:
data/Self-Driving-Car-3/export/images
data/Self-Driving-Car-3/export/labels
Train the baseline from configs/baseline.yaml:
python -m src.train --config configs/baseline.yamlTrain with a custom run name:
python -m src.train --config configs/baseline.yaml --name baselineTraining creates a run directory in runs/:
runs/YYYYMMDD_HHMMSS/
runs/YYYYMMDD_HHMMSS_name/
After training, the run directory should contain baseline artifacts such as:
config.yaml
result.json
weights/best.pt
weights/last.pt
An example saved training run is available in runs.example/yolov8n_baseline with args.yaml, results.csv, and weights/.
src.train already runs validation and test evaluation after training and stores the metrics in result.json.
You can also run evaluation separately for a saved checkpoint:
python -m src.eval \
--config configs/baseline.yaml \
--model runs/<run_name>/weights/best.ptRun evaluation on only part of the test split and save ground truth plus predictions:
python -m src.eval \
--config configs/baseline.yaml \
--model runs/<run_name>/weights/best.pt \
--split test \
--limit 64 \
--save-gt-predThis writes result.json, <split>_subset.txt, gt.json, and pred.json into the run directory.
With config:
python -m src.inference --config configs/baseline.yamlDirect run with local model:
python -m src.inference \
--model models/best_yolo_auto_trasnport.pt \
--source data/Self-Driving-Car-3/export/imagesResults are written to runs/.