# HEMATO build pipeline Run in order from one working directory (Python 3.11+, `pip install datasets pyarrow pillow imagehash numpy requests`): | Step | Script | What it does | |---|---|---| | 1 | `dl.sh` | Downloads the five sources (Hugging Face mirrors, Mendeley Data, NIH/NLM) into `raw/` | | 2 | `build.py` | Harmonizes labels, makes stratified / patient-level splits (seed 42), writes `dataset/` and `manifest.csv` | | 3 | `hqc.py basic` then `hqc.py apply --apply` | Decode check, SHA-256 and pHash duplicates (pixel-verified), split leakage, label conflicts | | 4 | `package.py` | Writes `meta/` (manifest, stats) and ≤300 MB ZIP parts per subset (every part contains every class) | | 5 | `push_hf.py` | Pushes `cls`, `all`, `malaria` to the Hub as Parquet (`HF_TOKEN` in the environment) | | 6 | `evren_import.py` | Optional: imports the ZIP parts into an Evren dataset via its Platform API (`EVREN_KEY` in the environment) |