Megvii-BaseDetection / DenseTeacher

DenseTeacher: Dense Pseudo-Label for Semi-supervised Object Detection
Apache License 2.0
120 stars 12 forks source link

Question about unsup loss. #12

Closed heiyuxiaokai closed 2 years ago

heiyuxiaokai commented 2 years ago

Here, teacher model and student model respectively adopt different data augment methods. And the strong one uses random crop, which will cause the change in object locations. I'm confused how get_distill_loss works while dense feature maps are not corresponding. https://github.com/Megvii-BaseDetection/DenseTeacher/blob/ca5c29d04674fdb68c389839a2f8d9ec637ad4c9/coco-p10/runner.py#L242 https://github.com/Megvii-BaseDetection/DenseTeacher/blob/ca5c29d04674fdb68c389839a2f8d9ec637ad4c9/coco-p10/runner.py#L244 https://github.com/Megvii-BaseDetection/DenseTeacher/blob/ca5c29d04674fdb68c389839a2f8d9ec637ad4c9/coco-p10/runner.py#L321

ZRandomize commented 2 years ago

seem like your misunderstood the random crop. This augmentation replace a random patch of the image with pure noise, rather than replace the whole image with its patch.

heiyuxiaokai commented 2 years ago

seem like your misunderstood the random crop. This augmentation replace a random patch of the image with pure noise, rather than replace the whole image with its patch.

Therefore, the output images of weak strong augmentation own the same object. I understand, and thanks.

heiyuxiaokai commented 2 years ago

Sorry to trouble you again. RandomFlip in WeakAug also cause the above situation. https://github.com/Megvii-BaseDetection/DenseTeacher/blob/ca5c29d04674fdb68c389839a2f8d9ec637ad4c9/coco-p10/augmentations.py#L64

ZRandomize commented 2 years ago

In this code base, student model use StrongAug + Weak Aug while teacher use Weak Aug. Thus the geometric correspondence was retained. see here

heiyuxiaokai commented 2 years ago

In this code base, student model use StrongAug + Weak Aug while teacher use Weak Aug. Thus the geometric correspondence was retained. see here

I see.