Closed tanveer6715 closed 1 year ago
In domain adaptation, CutMix between labeled and unlabeled images is done before training, the same as semi-supervised learning. The only difference is that you should replace the img_u_s_mix
with img_x
(the label is directly from GT label, there is no need to predict on img_u_w_mix
).
Sorry to bother you again but it is confusing as img_u_s_mix is corresponded to the unlabeled dataloader as here:
The model predict on the weakly augmented unlabeled image. Then how img_x will work here for domain adaptation?
You can check this paper first: https://github.com/vikolss/DACS, for the methodology of mixing labeled and unlabeled images.
Briefly, we previously mix img_u_s
and img_u_s_mix
, right? Now you need to mix img_u_s
and img_x
instead. The img_u_s_mix
and img_u_w_mix
are no longer required. As for the pseudo label of mixed img_u_s
and img_x
, its unlabeled region is predicted on img_u_w
by our model, and the labeled region directly borrows GT label from mask_x
.
Thank you for your quick and brief explanation. Now I got some idea for domain adaptation. I will ask further if I need some details but I hope it helps.
Closed for inactivity.
I am using UniMatch for domain adaptation according to your above suggestions as mentioned in #55 . But I am facing problems and errors.
https://github.com/LiheYoung/UniMatch/blob/583e32492b0ac150e0946b65864d2dcc642220b8/dataset/semi.py#L49
https://github.com/LiheYoung/UniMatch/blob/583e32492b0ac150e0946b65864d2dcc642220b8/unimatch.py#L142