MIC-DKFZ / medicaldetectiontoolkit

The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.
Apache License 2.0
1.31k stars 297 forks source link

How should `class_id` in `generate_toys.py` be created with my own data? #57

Closed Florence-Janie closed 5 years ago

Florence-Janie commented 5 years ago

Sorry to ask you this question. I try to run Toy-Experiments with my own data, will the class_id be created randomly as generate_toys.py do? If not, how it should be created?

kiranintellify commented 5 years ago

where is the answer of previous question

pfjaeger commented 5 years ago

Not sure if I understand this question. The class_id is never created randomly, but represents a fundamental property of your data set. In the toy experiments it is assigned according to the different classes of generated shapes (see https://arxiv.org/abs/1811.08661). But the more general case for custom data sets would be that you have some sort of meta info dictionary or dataframe from where the class_id info is loaded (see lidc data loader line 151). In your dataloader, the class_id should be assigned as an integer [0, ..., n_classes - 1]. This variable will be automatically shifted by +1 during data augmentation to make space for the background class at value 0.