-
Bonnet is an ultra-fast whole-body bone segmentation pipeline for CT scans. It runs in seconds per scan on a single commodity GPU while maintaining reliable segmentation quality across different datasets.
- Links: Processed training data & model weights
- Data Preparation
- Training
- Inference (Single Case vs. Sample Data)
- Processed training data: Processed Data
- Model weights: Weights
If you want to train on your own dataset, use the provided preprocessing script to convert CT and segmentation files into sparse voxel formats (
.npz).Ensure your data follows this structure:
DS_ORIGINAL/ ├── s0001/ │ ├── ct.nii.gz │ └── segmentations/ │ ├── vertebra_C1.nii.gz │ └── ... └── s0002/The script
src/preprocess_dataset.pyextracts voxels within the [200, 3000] HU range and maps labels according toconf/classes.yaml.Bash
python src/preprocess_dataset.py- Input: Defined by
INPUT_ROOTin the script. - Output: Generates
sparse_voxel.npzfor each case in theOUTPUT_ROOT.
- Configure Paths:
- Open
Bonnet/conf/data/totalseg_hu200_3000.yaml. - Set
dataset_pathandcache_pathto your preprocessed data folder.
- Open
- Run Training:
python main.py
Use
inference_single.pyto segment a raw.nii.gzCT scan directly. This script handles preprocessing, windowed inference, and volume reconstruction automatically.Bash
python inference_single.py --ct /path/to/ct.nii.gz --out ./prediction.nii.gz --device cudaNote: Ensure the
CHECKPOINT_PATHandCONFIG_PATHinside the script point to your actual local files.To run evaluation on the provided sample test set:
- Open
Bonnet/conf/eval/eval_on_test.yamland seteval_only: True. - Point your data config to the sample data path.
- Run:
python main.py
-
Notifications
You must be signed in to change notification settings - Fork 0
[ISBI'26] Bonnet: Ultra-Fast Whole-Body Bone Segmentation from CT Scans
License
HINTLab/Bonnet
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
[ISBI'26] Bonnet: Ultra-Fast Whole-Body Bone Segmentation from CT Scans
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published