levayz / ProtoSAM

Code implementation of ProtoSAM - One Shot Medical Image Segmentation with Foundationl Models
https://arxiv.org/abs/2407.07042
GNU General Public License v3.0
18 stars 2 forks source link

How to train and test on our own datasets? #4

Open panboshui opened 1 week ago

levayz commented 1 week ago

If your data consists of .png/.jpg then look at the PolypDataset here: https://github.com/levayz/ProtoSAM/blob/main/dataloaders/PolypDataset.py#L111

if its nifty youll need to put it in a directory with the following format: image_X.nii.gz and label_X.nii.gz where X is the number of the scan. Use ManualAnnoDataset: https://github.com/levayz/ProtoSAM/blob/main/dataloaders/ManualAnnoDatasetv2.py and provide it the base_dir of your dataset. Also you need to update DATASET_INFO here: https://github.com/levayz/ProtoSAM/blob/main/dataloaders/dataset_utils.py.