KaiyangZhou / Dassl.pytorch

A PyTorch toolbox for domain generalization, domain adaptation and semi-supervised learning.
MIT License
1.17k stars 169 forks source link

fix random_translation #42

Closed siaimes closed 2 years ago

siaimes commented 2 years ago

Since I didn't have random_translation in my config file when testing the InterpolationMode fix, its compatibility with InterpolationMode was not tested.

Signed-off-by: siaimes 34199488+siaimes@users.noreply.github.com

KaiyangZhou commented 2 years ago

@siaimes I just found the changes in Random2DTranslation seem wrong because the input img is not a torch.Tensor

Have you tested this function?

Forget about this msg. The input could be either PIL Image or Tensor.

https://pytorch.org/vision/stable/generated/torchvision.transforms.functional.resize.html#torchvision.transforms.functional.resize