microsoft / SoftTeacher

Semi-Supervised Learning, Object Detection, ICCV2021
MIT License
900 stars 123 forks source link

when init FasterRCNN, train_cfg and test_cfg are None #214

Open wangyx-chn opened 2 years ago

wangyx-chn commented 2 years ago

train_cfg and test_cfg are keys in semi_wrapper, while the submodel Faster RCNN has its train_cfg and test_cfg, when init FasterRCNN, train_cfg and test_cfg are both None.

semi_wrapper = dict( type="SoftTeacher", model="${model}", train_cfg=dict( use_teacher_proposal=False, pseudo_label_initial_score_thr=0.5, rpn_pseudo_threshold=0.9, cls_pseudo_threshold=0.9, reg_pseudo_threshold=0.02, jitter_times=10, jitter_scale=0.06, min_pseduo_box_size=0, unsup_weight=4.0, ), test_cfg=dict(inference_on="student"), )

and in class SoftTeacher, why build_detector(model) without train_cfg and test_cfg ?

class SoftTeacher(MultiSteamDetector): def init(self, model: dict, train_cfg=None, test_cfg=None): super(SoftTeacher, self).init( dict(teacher=build_detector(model), student=build_detector(model)), train_cfg=train_cfg, test_cfg=test_cfg, )