-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Description
🚀 Feature
Currently, we can observe a certain freedom in argument names and their meaning:
- Methods
F.resize
,F.resized_crop
,F.perspective
vision/torchvision/transforms/functional.py
Line 313 in ab73b44
def resize(img: Tensor, size: List[int], interpolation: int = Image.BILINEAR) -> Tensor: |
vision/torchvision/transforms/functional.py
Lines 443 to 445 in ab73b44
def resized_crop( | |
img: Tensor, top: int, left: int, height: int, width: int, size: List[int], interpolation: int = Image.BILINEAR | |
) -> Tensor: |
vision/torchvision/transforms/functional.py
Line 512 in ab73b44
def perspective(img, startpoints, endpoints, interpolation=Image.BICUBIC, fill=None): |
have
interpolation
argumentfill
argument
- Methods
F.rotate
,F.affine
vision/torchvision/transforms/functional.py
Line 761 in ab73b44
def rotate(img, angle, resample=False, expand=False, center=None, fill=None): |
vision/torchvision/transforms/functional.py
Lines 843 to 846 in ab73b44
def affine( | |
img: Tensor, angle: float, translate: List[int], scale: float, shear: List[float], | |
resample: int = 0, fillcolor: Optional[int] = None | |
) -> Tensor: |
have
resample
argument for interpolation (with a wrong default value asbool
instead ofint
)fill
orfillcolor
arguments for filling outside part of image
- Argument
angle
is interpreted differently betweenF.rotate
,F.affine
.
- Affine:
angle (float or int): rotation angle in degrees between -180 and 180, clockwise direction.
- Rotate:
angle (float or int): In degrees degrees counter clockwise order.
Idea is to harmonize the API:
- choose a single name for
interpolation
andresample
- choose a single name for
fill
andfillcolor
- BC breaking change for
angle
?
Maybe, there are other arguments to add to this list.