Custom datatset prepare
Jerry7j opened this issue · comments
Dear nnDetection community,
I'm preparing my dataset, there are three types of mutually isolated segmentations and I have set its data dir same as decathlon. In order to suit the subsequent process, I use the script in nnDetection/projects/Task001_Decathlon/scripts/prepare.py.
In prepare.py, I modify the props by "Task003_Liver". I want to know what is the meaning of seg2det_stuff, seg2det_things, labels and labels_stuff. I think my props is a wrong setting.
How should I set my props?
decathlon_props = {
"Task701_CTL": {
"seg2det_stuff": [1, ], # CTL
"seg2det_things": [3, ],
"min_size": 3.,
"labels": {"0": "C", "1": "T", "2": "L"},
"labels_stuff": {"1": "CTL"},
},
"Task003_Liver": {
"seg2det_stuff": [1, ], # liver
"seg2det_things": [2, ], # cancer
"min_size": 3.,
"labels": {"0": "cancer"},
"labels_stuff": {"1": "liver"},
}
}
I have generate the dataset.json like this:
{
"task": "Task701_CTL",
"name": "Task701_CTL",
"target_class": null,
"test_labels": true,
"modalities": {
"0": "CT"
},
"dim": 3,
"info": {
"original_labels": {
"0": "background",
"1": "C",
"2": "T",
"3": "L"
},
"original_numTraining": 1914
},
"seg2det_stuff": [],
"seg2det_things": [
1,
2,
3
],
"min_size": 3.0,
"labels": {
"0": "C",
"1": "T",
"2": "L"
},
"labels_stuff": {}
}
Then I use the nnDetection/scripts/convert_seg2det.py. It seems no problem.
After that I use the nnDetection/scripts/preprocess.py. It has a problem. I find my custom dataset will going on the nndet/planning/properties/instance.py funtion analyze_instances_per_case().
I debug the problem is here: props["num_instances"] = count_instances(props, all_classes)
in count_instances() instance_classes = list(map(int, props["instances"].values())) props["instances"].values() is error
but every Decathlon dataset will go on the nndet/planning/properties/instance.py funtion analyze_instances_data_set(). Please give me some advice, thank you so much!
Best regards,
Jerry
Hi Jerry,
the properties: seg2det_stuff, seg2det_things, labels and labels_stuff
were used in the conversion script to run connected components and separate objects from semantic classes. In general these are not needed for a data set which is already in the correct object detection format (see the README for format details).
Which error occurs there? Maybe one of your files is corrupted and thus the instance is missing after the cropping stage (at least that happened sometimes to me)
This issue is stale because it has been open for 30 days with no activity.