Minimal code for three VinBigData workflows:
- Classification
- YOLO localization
- Agentic report generation
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
cp .env.example .envFill .env only if you need agentic review generation.
The default path in this repo is:
- download prepared data and saved artifacts
- rerun the comparisons without retraining
- generate reports from cached outputs or from the API key
This is the fastest way to reproduce the final results.
Assumptions:
- the processed dataset is published at sbandred/vinbig-cxr-processed and contains the prepared
data/contents
Download the processed dataset:
python main.py download \
--dataset-repo sbandred/vinbig-cxr-processedReproduce the paper model metrics directly from the saved checkpoints:
python main.py reproduce-paper-metricsThis writes classifier macro AUC-ROC metrics and YOLO mAP@0.5 under:
experiments/paper_metrics/
This reuses the downloaded checkpoints. If cached review JSON files are present in the artifacts repo, the review comparison reruns without calling the model API.
python main.py compare --max-cases 300If cached review outputs are missing and you want to recompute them:
python main.py compare \
--max-cases 300 \
--api-key <your_gateway_api_key>Outputs land under:
experiments/repro_outputs/
Generate one agentic report directly from an image:
python main.py report --image data/test/<image>.pngIf you want to force regeneration through the gateway:
python main.py report \
--image data/test/<image>.png \
--api-key <your_gateway_api_key>Outputs land under:
experiments/agentic_reports/<image_id>/
These scripts regenerate the two PDF templates used in this repo from cached review outputs:
python scripts/generate_reports.py --list-templates
python scripts/generate_reports.py --template example
python scripts/generate_reports.py --template comparisonTemplate outputs:
example: doctor-facing report without ground-truth comparisoncomparison: presentation report comparing pipeline output against ground truth
Generated PDFs land under:
reports/example_reports/
reports/comparision_reports/
Best checkpoints for the paper tables are indexed under:
model_checkpoints/
The PDF templates are reproducible from cached artifacts today.
A fresh user with only an API key can reproduce the full path by:
- downloading the public data and artifacts
- running
python main.py compare --api-key ...if review cache is missing - running
python scripts/generate_reports.py --template exampleor--template comparison
Classification:
python main.py train-classifier --model swin_base_patch4_window7_224 --epochs 10YOLO:
python main.py train-yolo --weights yolov8m.ptpython main.py --helpconfigs/ runtime configuration
main.py primary CLI
scripts/ install and auxiliary utilities
src/ library code
tests/ test suite
data/ prepared dataset
experiments/ checkpoints, reports, cached outputs