Views
No views yet
Dataset401_PVS3T80, 3d_fullres).pvs-seg-nnunet on PyPI, which
downloads these checkpoints automatically:1pip install pvs-seg-nnunet
2pvsseg predict -i /path/to/inputs -o /path/to/outputs| Architecture | nnU-Net v2, 3d_fullres, PlainConvUNet (~30.8M params) |
| Trainer | nnUNetTrainerCustomAug (custom intensity augmentation) |
| Input | single channel, T2w (CASE_0000.nii.gz) |
| Labels | 0 = background, 1 = PVS |
| Target spacing | 0.8 × 0.8 × 0.8 mm (isotropic) |
| Patch size | 96 × 160 × 160 |
| Normalization | Z-score |
| Ensemble | 5 folds (fold_0 … fold_4), checkpoint_best.pth each |
| Metric | Mean | Median |
|---|---|---|
| Dice | 0.884 | 0.884 |
| IoU | 0.795 | 0.793 |
| Precision | 0.913 | 0.927 |
| Recall | 0.861 | 0.871 |
| Surface Dice (1 mm) | 0.942 | 0.948 |
| HD95 (mm) | 1.52 | 1.13 |
nnUNetTrainerCustomAug/
├── plans.json
├── dataset.json
├── dataset_fingerprint.json
└── fold_{0..4}/
└── checkpoint_best.pth # used by the package (periodic checkpoints also present)The repo also stores periodic training checkpoints (checkpoint_10…checkpoint_1000). For inference you only needcheckpoint_best.pthper fold plusplans.json/dataset.json; the PyPI package downloads exactly those.
1import torch
2from huggingface_hub import snapshot_download
3from nnunetv2.inference.predict_from_raw_data import nnUNetPredictor
4
5# requires the nnUNetTrainerCustomAug class to be importable
6# (the pvs-seg-nnunet package registers it for you)
7root = snapshot_download(
8 "AishwariyaDutta/pvs-seg-nnunet-checkpoints",
9 allow_patterns=[
10 "nnUNetTrainerCustomAug/plans.json",
11 "nnUNetTrainerCustomAug/dataset.json",
12 "nnUNetTrainerCustomAug/dataset_fingerprint.json",
13 "nnUNetTrainerCustomAug/fold_*/checkpoint_best.pth",
14 ],
15)
16model_dir = f"{root}/nnUNetTrainerCustomAug"
17
18predictor = nnUNetPredictor(device=torch.device("cuda"))
19predictor.initialize_from_trained_model_folder(
20 model_dir, use_folds=(0, 1, 2, 3, 4), checkpoint_name="checkpoint_best.pth"
21)
22predictor.predict_from_files("inputs/", "outputs/")