This repository contains the SPAN implementation for:
- slide-level classification
- patch-level segmentation
- slide-level survival analysis
- the shared
src.spanmodel implementation
Feature files can be prepared from whole-slide images using PatchPreprocess, then passed to SPAN through data_root.
configs/ Hydra configs for vision tasks and model variants
src/span/ Core SPAN modules
tasks/vision/ Classification, segmentation, survival entrypoints
lib/utils/ Runtime helpers used by the vision tasks
pip install -r requirements.txtPrepare slide-level feature files in the layout expected by the selected task config, then point data_root to that directory. data_root defaults to SPAN_DATA_ROOT and then data.
export SPAN_DATA_ROOT=/path/to/featuresYou can also edit data_root in:
configs/classification.yamlconfigs/segmentation.yamlconfigs/survival.yaml
The dataset field in each config selects the corresponding loader in tasks/vision/shared/data.py.
Survival tasks also require the corresponding clinical metadata.
python -m tasks.vision.slide.classification.main data_root=/path/to/features
python -m tasks.vision.patch.segmentation.main data_root=/path/to/features
python -m tasks.vision.slide.survival.main data_root=/path/to/featuresW&B logging is disabled by default. Enable it explicitly when needed:
python -m tasks.vision.slide.classification.main logging.wandb.enabled=trueThis code is released under the MIT License.
