From 59d1b76102c2d4c44dfabb249f9a01e76de08f4c Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 16 Feb 2023 19:03:13 +0100 Subject: [PATCH 1/2] restore silent fill None -> 0 on transformations --- torchvision/transforms/v2/_geometry.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/torchvision/transforms/v2/_geometry.py b/torchvision/transforms/v2/_geometry.py index f1eed87b9c0..b7ca801f825 100644 --- a/torchvision/transforms/v2/_geometry.py +++ b/torchvision/transforms/v2/_geometry.py @@ -338,6 +338,8 @@ def __init__( self.interpolation = _check_interpolation(interpolation) self.expand = expand + if fill is None: + fill = 0 self.fill = fill self._fill = _setup_fill_arg(fill) @@ -396,6 +398,9 @@ def __init__( self.shear = shear self.interpolation = _check_interpolation(interpolation) + + if fill is None: + fill = 0 self.fill = fill self._fill = _setup_fill_arg(fill) @@ -568,6 +573,9 @@ def __init__( self.distortion_scale = distortion_scale self.interpolation = _check_interpolation(interpolation) + + if fill is None: + fill = 0 self.fill = fill self._fill = _setup_fill_arg(fill) From 7fa38b09ebfc85c111d2c36cb156d6fb1524252d Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 16 Feb 2023 19:07:54 +0100 Subject: [PATCH 2/2] add comment --- torchvision/transforms/v2/_geometry.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/torchvision/transforms/v2/_geometry.py b/torchvision/transforms/v2/_geometry.py index b7ca801f825..98aa51ee2ed 100644 --- a/torchvision/transforms/v2/_geometry.py +++ b/torchvision/transforms/v2/_geometry.py @@ -338,6 +338,8 @@ def __init__( self.interpolation = _check_interpolation(interpolation) self.expand = expand + # This is just here for BC + # TODO: investigate if this actually has a significant effect on model acc if fill is None: fill = 0 self.fill = fill @@ -399,6 +401,8 @@ def __init__( self.interpolation = _check_interpolation(interpolation) + # This is just here for BC + # TODO: investigate if this actually has a significant effect on model acc if fill is None: fill = 0 self.fill = fill @@ -574,6 +578,8 @@ def __init__( self.distortion_scale = distortion_scale self.interpolation = _check_interpolation(interpolation) + # This is just here for BC + # TODO: investigate if this actually has a significant effect on model acc if fill is None: fill = 0 self.fill = fill