-
🚀 FeatureI'd like to add weights for each object/class considered in training detectron2 to handle data imbalance. Is there a way to do this in the current detectron2 implementation? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
https://detectron2.readthedocs.io/en/latest/modules/data.html#detectron2.data.samplers.RepeatFactorTrainingSampler is used by all the LVIS configs https://github.com/facebookresearch/detectron2/tree/master/configs/LVISv1-InstanceSegmentation for this purpose. You can use other samplers to do other types of weighting. |
Beta Was this translation helpful? Give feedback.
-
I see another answer here, However, I am not sure how to do this in Instance Segmentation. I tried to modify the ROI_MASK_HEAD but that doesn't work similar to the SEM_SEG_HEADS. In ROI_MASK_HEAD, they use binary_cross_entropy_with_logits instead of CrossEntropyLoss in SEM_SEG_HEADS |
Beta Was this translation helpful? Give feedback.
-
Hi, did you find the solution yet? Thank you |
Beta Was this translation helpful? Give feedback.
https://detectron2.readthedocs.io/en/latest/modules/data.html#detectron2.data.samplers.RepeatFactorTrainingSampler is used by all the LVIS configs https://github.com/facebookresearch/detectron2/tree/master/configs/LVISv1-InstanceSegmentation for this purpose. You can use other samplers to do other types of weighting.