Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
bac678c8
Unverified
Commit
bac678c8
authored
Feb 07, 2023
by
Philip Meier
Committed by
GitHub
Feb 07, 2023
Browse files
remove functionality scheduled for 0.15 after deprecation (#7176)
parent
a05d8179
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
0 additions
and
279 deletions
+0
-279
torchvision/models/quantization/mobilenetv2.py
torchvision/models/quantization/mobilenetv2.py
+0
-12
torchvision/models/quantization/mobilenetv3.py
torchvision/models/quantization/mobilenetv3.py
+0
-12
torchvision/models/quantization/resnet.py
torchvision/models/quantization/resnet.py
+0
-14
torchvision/models/quantization/shufflenetv2.py
torchvision/models/quantization/shufflenetv2.py
+0
-13
torchvision/models/regnet.py
torchvision/models/regnet.py
+0
-24
torchvision/models/resnet.py
torchvision/models/resnet.py
+0
-19
torchvision/models/segmentation/deeplabv3.py
torchvision/models/segmentation/deeplabv3.py
+0
-13
torchvision/models/segmentation/fcn.py
torchvision/models/segmentation/fcn.py
+0
-12
torchvision/models/segmentation/lraspp.py
torchvision/models/segmentation/lraspp.py
+0
-11
torchvision/models/shufflenetv2.py
torchvision/models/shufflenetv2.py
+0
-14
torchvision/models/squeezenet.py
torchvision/models/squeezenet.py
+0
-12
torchvision/models/vgg.py
torchvision/models/vgg.py
+0
-18
torchvision/models/vision_transformer.py
torchvision/models/vision_transformer.py
+0
-14
torchvision/transforms/functional.py
torchvision/transforms/functional.py
+0
-41
torchvision/transforms/transforms.py
torchvision/transforms/transforms.py
+0
-50
No files found.
torchvision/models/quantization/mobilenetv2.py
View file @
bac678c8
...
@@ -152,15 +152,3 @@ def mobilenet_v2(
...
@@ -152,15 +152,3 @@ def mobilenet_v2(
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
return
model
return
model
# The dictionary below is internal implementation detail and will be removed in v0.15
from
.._utils
import
_ModelURLs
from
..mobilenetv2
import
model_urls
# noqa: F401
quant_model_urls
=
_ModelURLs
(
{
"mobilenet_v2_qnnpack"
:
MobileNet_V2_QuantizedWeights
.
IMAGENET1K_QNNPACK_V1
.
url
,
}
)
torchvision/models/quantization/mobilenetv3.py
View file @
bac678c8
...
@@ -235,15 +235,3 @@ def mobilenet_v3_large(
...
@@ -235,15 +235,3 @@ def mobilenet_v3_large(
inverted_residual_setting
,
last_channel
=
_mobilenet_v3_conf
(
"mobilenet_v3_large"
,
**
kwargs
)
inverted_residual_setting
,
last_channel
=
_mobilenet_v3_conf
(
"mobilenet_v3_large"
,
**
kwargs
)
return
_mobilenet_v3_model
(
inverted_residual_setting
,
last_channel
,
weights
,
progress
,
quantize
,
**
kwargs
)
return
_mobilenet_v3_model
(
inverted_residual_setting
,
last_channel
,
weights
,
progress
,
quantize
,
**
kwargs
)
# The dictionary below is internal implementation detail and will be removed in v0.15
from
.._utils
import
_ModelURLs
from
..mobilenetv3
import
model_urls
# noqa: F401
quant_model_urls
=
_ModelURLs
(
{
"mobilenet_v3_large_qnnpack"
:
MobileNet_V3_Large_QuantizedWeights
.
IMAGENET1K_QNNPACK_V1
.
url
,
}
)
torchvision/models/quantization/resnet.py
View file @
bac678c8
...
@@ -482,17 +482,3 @@ def resnext101_64x4d(
...
@@ -482,17 +482,3 @@ def resnext101_64x4d(
_ovewrite_named_param
(
kwargs
,
"groups"
,
64
)
_ovewrite_named_param
(
kwargs
,
"groups"
,
64
)
_ovewrite_named_param
(
kwargs
,
"width_per_group"
,
4
)
_ovewrite_named_param
(
kwargs
,
"width_per_group"
,
4
)
return
_resnet
(
QuantizableBottleneck
,
[
3
,
4
,
23
,
3
],
weights
,
progress
,
quantize
,
**
kwargs
)
return
_resnet
(
QuantizableBottleneck
,
[
3
,
4
,
23
,
3
],
weights
,
progress
,
quantize
,
**
kwargs
)
# The dictionary below is internal implementation detail and will be removed in v0.15
from
.._utils
import
_ModelURLs
from
..resnet
import
model_urls
# noqa: F401
quant_model_urls
=
_ModelURLs
(
{
"resnet18_fbgemm"
:
ResNet18_QuantizedWeights
.
IMAGENET1K_FBGEMM_V1
.
url
,
"resnet50_fbgemm"
:
ResNet50_QuantizedWeights
.
IMAGENET1K_FBGEMM_V1
.
url
,
"resnext101_32x8d_fbgemm"
:
ResNeXt101_32X8D_QuantizedWeights
.
IMAGENET1K_FBGEMM_V1
.
url
,
}
)
torchvision/models/quantization/shufflenetv2.py
View file @
bac678c8
...
@@ -425,16 +425,3 @@ def shufflenet_v2_x2_0(
...
@@ -425,16 +425,3 @@ def shufflenet_v2_x2_0(
return
_shufflenetv2
(
return
_shufflenetv2
(
[
4
,
8
,
4
],
[
24
,
244
,
488
,
976
,
2048
],
weights
=
weights
,
progress
=
progress
,
quantize
=
quantize
,
**
kwargs
[
4
,
8
,
4
],
[
24
,
244
,
488
,
976
,
2048
],
weights
=
weights
,
progress
=
progress
,
quantize
=
quantize
,
**
kwargs
)
)
# The dictionary below is internal implementation detail and will be removed in v0.15
from
.._utils
import
_ModelURLs
from
..shufflenetv2
import
model_urls
# noqa: F401
quant_model_urls
=
_ModelURLs
(
{
"shufflenetv2_x0.5_fbgemm"
:
ShuffleNet_V2_X0_5_QuantizedWeights
.
IMAGENET1K_FBGEMM_V1
.
url
,
"shufflenetv2_x1.0_fbgemm"
:
ShuffleNet_V2_X1_0_QuantizedWeights
.
IMAGENET1K_FBGEMM_V1
.
url
,
}
)
torchvision/models/regnet.py
View file @
bac678c8
...
@@ -1569,27 +1569,3 @@ def regnet_x_32gf(*, weights: Optional[RegNet_X_32GF_Weights] = None, progress:
...
@@ -1569,27 +1569,3 @@ def regnet_x_32gf(*, weights: Optional[RegNet_X_32GF_Weights] = None, progress:
params
=
BlockParams
.
from_init_params
(
depth
=
23
,
w_0
=
320
,
w_a
=
69.86
,
w_m
=
2.0
,
group_width
=
168
,
**
kwargs
)
params
=
BlockParams
.
from_init_params
(
depth
=
23
,
w_0
=
320
,
w_a
=
69.86
,
w_m
=
2.0
,
group_width
=
168
,
**
kwargs
)
return
_regnet
(
params
,
weights
,
progress
,
**
kwargs
)
return
_regnet
(
params
,
weights
,
progress
,
**
kwargs
)
# The dictionary below is internal implementation detail and will be removed in v0.15
from
._utils
import
_ModelURLs
model_urls
=
_ModelURLs
(
{
"regnet_y_400mf"
:
RegNet_Y_400MF_Weights
.
IMAGENET1K_V1
.
url
,
"regnet_y_800mf"
:
RegNet_Y_800MF_Weights
.
IMAGENET1K_V1
.
url
,
"regnet_y_1_6gf"
:
RegNet_Y_1_6GF_Weights
.
IMAGENET1K_V1
.
url
,
"regnet_y_3_2gf"
:
RegNet_Y_3_2GF_Weights
.
IMAGENET1K_V1
.
url
,
"regnet_y_8gf"
:
RegNet_Y_8GF_Weights
.
IMAGENET1K_V1
.
url
,
"regnet_y_16gf"
:
RegNet_Y_16GF_Weights
.
IMAGENET1K_V1
.
url
,
"regnet_y_32gf"
:
RegNet_Y_32GF_Weights
.
IMAGENET1K_V1
.
url
,
"regnet_x_400mf"
:
RegNet_X_400MF_Weights
.
IMAGENET1K_V1
.
url
,
"regnet_x_800mf"
:
RegNet_X_800MF_Weights
.
IMAGENET1K_V1
.
url
,
"regnet_x_1_6gf"
:
RegNet_X_1_6GF_Weights
.
IMAGENET1K_V1
.
url
,
"regnet_x_3_2gf"
:
RegNet_X_3_2GF_Weights
.
IMAGENET1K_V1
.
url
,
"regnet_x_8gf"
:
RegNet_X_8GF_Weights
.
IMAGENET1K_V1
.
url
,
"regnet_x_16gf"
:
RegNet_X_16GF_Weights
.
IMAGENET1K_V1
.
url
,
"regnet_x_32gf"
:
RegNet_X_32GF_Weights
.
IMAGENET1K_V1
.
url
,
}
)
torchvision/models/resnet.py
View file @
bac678c8
...
@@ -983,22 +983,3 @@ def wide_resnet101_2(
...
@@ -983,22 +983,3 @@ def wide_resnet101_2(
_ovewrite_named_param
(
kwargs
,
"width_per_group"
,
64
*
2
)
_ovewrite_named_param
(
kwargs
,
"width_per_group"
,
64
*
2
)
return
_resnet
(
Bottleneck
,
[
3
,
4
,
23
,
3
],
weights
,
progress
,
**
kwargs
)
return
_resnet
(
Bottleneck
,
[
3
,
4
,
23
,
3
],
weights
,
progress
,
**
kwargs
)
# The dictionary below is internal implementation detail and will be removed in v0.15
from
._utils
import
_ModelURLs
model_urls
=
_ModelURLs
(
{
"resnet18"
:
ResNet18_Weights
.
IMAGENET1K_V1
.
url
,
"resnet34"
:
ResNet34_Weights
.
IMAGENET1K_V1
.
url
,
"resnet50"
:
ResNet50_Weights
.
IMAGENET1K_V1
.
url
,
"resnet101"
:
ResNet101_Weights
.
IMAGENET1K_V1
.
url
,
"resnet152"
:
ResNet152_Weights
.
IMAGENET1K_V1
.
url
,
"resnext50_32x4d"
:
ResNeXt50_32X4D_Weights
.
IMAGENET1K_V1
.
url
,
"resnext101_32x8d"
:
ResNeXt101_32X8D_Weights
.
IMAGENET1K_V1
.
url
,
"wide_resnet50_2"
:
Wide_ResNet50_2_Weights
.
IMAGENET1K_V1
.
url
,
"wide_resnet101_2"
:
Wide_ResNet101_2_Weights
.
IMAGENET1K_V1
.
url
,
}
)
torchvision/models/segmentation/deeplabv3.py
View file @
bac678c8
...
@@ -388,16 +388,3 @@ def deeplabv3_mobilenet_v3_large(
...
@@ -388,16 +388,3 @@ def deeplabv3_mobilenet_v3_large(
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
return
model
return
model
# The dictionary below is internal implementation detail and will be removed in v0.15
from
.._utils
import
_ModelURLs
model_urls
=
_ModelURLs
(
{
"deeplabv3_resnet50_coco"
:
DeepLabV3_ResNet50_Weights
.
COCO_WITH_VOC_LABELS_V1
.
url
,
"deeplabv3_resnet101_coco"
:
DeepLabV3_ResNet101_Weights
.
COCO_WITH_VOC_LABELS_V1
.
url
,
"deeplabv3_mobilenet_v3_large_coco"
:
DeepLabV3_MobileNet_V3_Large_Weights
.
COCO_WITH_VOC_LABELS_V1
.
url
,
}
)
torchvision/models/segmentation/fcn.py
View file @
bac678c8
...
@@ -230,15 +230,3 @@ def fcn_resnet101(
...
@@ -230,15 +230,3 @@ def fcn_resnet101(
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
return
model
return
model
# The dictionary below is internal implementation detail and will be removed in v0.15
from
.._utils
import
_ModelURLs
model_urls
=
_ModelURLs
(
{
"fcn_resnet50_coco"
:
FCN_ResNet50_Weights
.
COCO_WITH_VOC_LABELS_V1
.
url
,
"fcn_resnet101_coco"
:
FCN_ResNet101_Weights
.
COCO_WITH_VOC_LABELS_V1
.
url
,
}
)
torchvision/models/segmentation/lraspp.py
View file @
bac678c8
...
@@ -176,14 +176,3 @@ def lraspp_mobilenet_v3_large(
...
@@ -176,14 +176,3 @@ def lraspp_mobilenet_v3_large(
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
model
.
load_state_dict
(
weights
.
get_state_dict
(
progress
=
progress
))
return
model
return
model
# The dictionary below is internal implementation detail and will be removed in v0.15
from
.._utils
import
_ModelURLs
model_urls
=
_ModelURLs
(
{
"lraspp_mobilenet_v3_large_coco"
:
LRASPP_MobileNet_V3_Large_Weights
.
COCO_WITH_VOC_LABELS_V1
.
url
,
}
)
torchvision/models/shufflenetv2.py
View file @
bac678c8
...
@@ -406,17 +406,3 @@ def shufflenet_v2_x2_0(
...
@@ -406,17 +406,3 @@ def shufflenet_v2_x2_0(
weights
=
ShuffleNet_V2_X2_0_Weights
.
verify
(
weights
)
weights
=
ShuffleNet_V2_X2_0_Weights
.
verify
(
weights
)
return
_shufflenetv2
(
weights
,
progress
,
[
4
,
8
,
4
],
[
24
,
244
,
488
,
976
,
2048
],
**
kwargs
)
return
_shufflenetv2
(
weights
,
progress
,
[
4
,
8
,
4
],
[
24
,
244
,
488
,
976
,
2048
],
**
kwargs
)
# The dictionary below is internal implementation detail and will be removed in v0.15
from
._utils
import
_ModelURLs
model_urls
=
_ModelURLs
(
{
"shufflenetv2_x0.5"
:
ShuffleNet_V2_X0_5_Weights
.
IMAGENET1K_V1
.
url
,
"shufflenetv2_x1.0"
:
ShuffleNet_V2_X1_0_Weights
.
IMAGENET1K_V1
.
url
,
"shufflenetv2_x1.5"
:
None
,
"shufflenetv2_x2.0"
:
None
,
}
)
torchvision/models/squeezenet.py
View file @
bac678c8
...
@@ -221,15 +221,3 @@ def squeezenet1_1(
...
@@ -221,15 +221,3 @@ def squeezenet1_1(
"""
"""
weights
=
SqueezeNet1_1_Weights
.
verify
(
weights
)
weights
=
SqueezeNet1_1_Weights
.
verify
(
weights
)
return
_squeezenet
(
"1_1"
,
weights
,
progress
,
**
kwargs
)
return
_squeezenet
(
"1_1"
,
weights
,
progress
,
**
kwargs
)
# The dictionary below is internal implementation detail and will be removed in v0.15
from
._utils
import
_ModelURLs
model_urls
=
_ModelURLs
(
{
"squeezenet1_0"
:
SqueezeNet1_0_Weights
.
IMAGENET1K_V1
.
url
,
"squeezenet1_1"
:
SqueezeNet1_1_Weights
.
IMAGENET1K_V1
.
url
,
}
)
torchvision/models/vgg.py
View file @
bac678c8
...
@@ -509,21 +509,3 @@ def vgg19_bn(*, weights: Optional[VGG19_BN_Weights] = None, progress: bool = Tru
...
@@ -509,21 +509,3 @@ def vgg19_bn(*, weights: Optional[VGG19_BN_Weights] = None, progress: bool = Tru
weights
=
VGG19_BN_Weights
.
verify
(
weights
)
weights
=
VGG19_BN_Weights
.
verify
(
weights
)
return
_vgg
(
"E"
,
True
,
weights
,
progress
,
**
kwargs
)
return
_vgg
(
"E"
,
True
,
weights
,
progress
,
**
kwargs
)
# The dictionary below is internal implementation detail and will be removed in v0.15
from
._utils
import
_ModelURLs
model_urls
=
_ModelURLs
(
{
"vgg11"
:
VGG11_Weights
.
IMAGENET1K_V1
.
url
,
"vgg13"
:
VGG13_Weights
.
IMAGENET1K_V1
.
url
,
"vgg16"
:
VGG16_Weights
.
IMAGENET1K_V1
.
url
,
"vgg19"
:
VGG19_Weights
.
IMAGENET1K_V1
.
url
,
"vgg11_bn"
:
VGG11_BN_Weights
.
IMAGENET1K_V1
.
url
,
"vgg13_bn"
:
VGG13_BN_Weights
.
IMAGENET1K_V1
.
url
,
"vgg16_bn"
:
VGG16_BN_Weights
.
IMAGENET1K_V1
.
url
,
"vgg19_bn"
:
VGG19_BN_Weights
.
IMAGENET1K_V1
.
url
,
}
)
torchvision/models/vision_transformer.py
View file @
bac678c8
...
@@ -862,17 +862,3 @@ def interpolate_embeddings(
...
@@ -862,17 +862,3 @@ def interpolate_embeddings(
model_state
=
model_state_copy
model_state
=
model_state_copy
return
model_state
return
model_state
# The dictionary below is internal implementation detail and will be removed in v0.15
from
._utils
import
_ModelURLs
model_urls
=
_ModelURLs
(
{
"vit_b_16"
:
ViT_B_16_Weights
.
IMAGENET1K_V1
.
url
,
"vit_b_32"
:
ViT_B_32_Weights
.
IMAGENET1K_V1
.
url
,
"vit_l_16"
:
ViT_L_16_Weights
.
IMAGENET1K_V1
.
url
,
"vit_l_32"
:
ViT_L_32_Weights
.
IMAGENET1K_V1
.
url
,
}
)
torchvision/transforms/functional.py
View file @
bac678c8
...
@@ -421,8 +421,6 @@ def resize(
...
@@ -421,8 +421,6 @@ def resize(
Default is ``InterpolationMode.BILINEAR``. If input is Tensor, only ``InterpolationMode.NEAREST``,
Default is ``InterpolationMode.BILINEAR``. If input is Tensor, only ``InterpolationMode.NEAREST``,
``InterpolationMode.NEAREST_EXACT``, ``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` are
``InterpolationMode.NEAREST_EXACT``, ``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` are
supported.
supported.
For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
max_size (int, optional): The maximum allowed for the longer edge of
max_size (int, optional): The maximum allowed for the longer edge of
the resized image: if the longer edge of the image is greater
the resized image: if the longer edge of the image is greater
than ``max_size`` after being resized according to ``size``, then
than ``max_size`` after being resized according to ``size``, then
...
@@ -441,13 +439,6 @@ def resize(
...
@@ -441,13 +439,6 @@ def resize(
"""
"""
if
not
torch
.
jit
.
is_scripting
()
and
not
torch
.
jit
.
is_tracing
():
if
not
torch
.
jit
.
is_scripting
()
and
not
torch
.
jit
.
is_tracing
():
_log_api_usage_once
(
resize
)
_log_api_usage_once
(
resize
)
# Backward compatibility with integer value
if
isinstance
(
interpolation
,
int
):
warnings
.
warn
(
"Argument 'interpolation' of type int is deprecated since 0.13 and will be removed in 0.15. "
"Please use InterpolationMode enum."
)
interpolation
=
_interpolation_modes_from_int
(
interpolation
)
if
not
isinstance
(
interpolation
,
InterpolationMode
):
if
not
isinstance
(
interpolation
,
InterpolationMode
):
raise
TypeError
(
"Argument interpolation should be a InterpolationMode"
)
raise
TypeError
(
"Argument interpolation should be a InterpolationMode"
)
...
@@ -623,8 +614,6 @@ def resized_crop(
...
@@ -623,8 +614,6 @@ def resized_crop(
Default is ``InterpolationMode.BILINEAR``. If input is Tensor, only ``InterpolationMode.NEAREST``,
Default is ``InterpolationMode.BILINEAR``. If input is Tensor, only ``InterpolationMode.NEAREST``,
``InterpolationMode.NEAREST_EXACT``, ``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` are
``InterpolationMode.NEAREST_EXACT``, ``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` are
supported.
supported.
For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
antialias (bool, optional): antialias flag. If ``img`` is PIL Image, the flag is ignored and anti-alias
antialias (bool, optional): antialias flag. If ``img`` is PIL Image, the flag is ignored and anti-alias
is always used. If ``img`` is Tensor, the flag is False by default and can be set to True for
is always used. If ``img`` is Tensor, the flag is False by default and can be set to True for
``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` modes.
``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` modes.
...
@@ -707,8 +696,6 @@ def perspective(
...
@@ -707,8 +696,6 @@ def perspective(
interpolation (InterpolationMode): Desired interpolation enum defined by
interpolation (InterpolationMode): Desired interpolation enum defined by
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.BILINEAR``.
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.BILINEAR``.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
fill (sequence or number, optional): Pixel fill value for the area outside the transformed
fill (sequence or number, optional): Pixel fill value for the area outside the transformed
image. If given a number, the value is used for all bands respectively.
image. If given a number, the value is used for all bands respectively.
...
@@ -724,14 +711,6 @@ def perspective(
...
@@ -724,14 +711,6 @@ def perspective(
coeffs
=
_get_perspective_coeffs
(
startpoints
,
endpoints
)
coeffs
=
_get_perspective_coeffs
(
startpoints
,
endpoints
)
# Backward compatibility with integer value
if
isinstance
(
interpolation
,
int
):
warnings
.
warn
(
"Argument 'interpolation' of type int is deprecated since 0.13 and will be removed in 0.15. "
"Please use InterpolationMode enum."
)
interpolation
=
_interpolation_modes_from_int
(
interpolation
)
if
not
isinstance
(
interpolation
,
InterpolationMode
):
if
not
isinstance
(
interpolation
,
InterpolationMode
):
raise
TypeError
(
"Argument interpolation should be a InterpolationMode"
)
raise
TypeError
(
"Argument interpolation should be a InterpolationMode"
)
...
@@ -1067,8 +1046,6 @@ def rotate(
...
@@ -1067,8 +1046,6 @@ def rotate(
interpolation (InterpolationMode): Desired interpolation enum defined by
interpolation (InterpolationMode): Desired interpolation enum defined by
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.NEAREST``.
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.NEAREST``.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
expand (bool, optional): Optional expansion flag.
expand (bool, optional): Optional expansion flag.
If true, expands the output image to make it large enough to hold the entire rotated image.
If true, expands the output image to make it large enough to hold the entire rotated image.
If false or omitted, make the output image the same size as the input image.
If false or omitted, make the output image the same size as the input image.
...
@@ -1090,14 +1067,6 @@ def rotate(
...
@@ -1090,14 +1067,6 @@ def rotate(
if
not
torch
.
jit
.
is_scripting
()
and
not
torch
.
jit
.
is_tracing
():
if
not
torch
.
jit
.
is_scripting
()
and
not
torch
.
jit
.
is_tracing
():
_log_api_usage_once
(
rotate
)
_log_api_usage_once
(
rotate
)
# Backward compatibility with integer value
if
isinstance
(
interpolation
,
int
):
warnings
.
warn
(
"Argument 'interpolation' of type int is deprecated since 0.13 and will be removed in 0.15. "
"Please use InterpolationMode enum."
)
interpolation
=
_interpolation_modes_from_int
(
interpolation
)
if
not
isinstance
(
angle
,
(
int
,
float
)):
if
not
isinstance
(
angle
,
(
int
,
float
)):
raise
TypeError
(
"Argument angle should be int or float"
)
raise
TypeError
(
"Argument angle should be int or float"
)
...
@@ -1148,8 +1117,6 @@ def affine(
...
@@ -1148,8 +1117,6 @@ def affine(
interpolation (InterpolationMode): Desired interpolation enum defined by
interpolation (InterpolationMode): Desired interpolation enum defined by
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.NEAREST``.
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.NEAREST``.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
fill (sequence or number, optional): Pixel fill value for the area outside the transformed
fill (sequence or number, optional): Pixel fill value for the area outside the transformed
image. If given a number, the value is used for all bands respectively.
image. If given a number, the value is used for all bands respectively.
...
@@ -1165,14 +1132,6 @@ def affine(
...
@@ -1165,14 +1132,6 @@ def affine(
if
not
torch
.
jit
.
is_scripting
()
and
not
torch
.
jit
.
is_tracing
():
if
not
torch
.
jit
.
is_scripting
()
and
not
torch
.
jit
.
is_tracing
():
_log_api_usage_once
(
affine
)
_log_api_usage_once
(
affine
)
# Backward compatibility with integer value
if
isinstance
(
interpolation
,
int
):
warnings
.
warn
(
"Argument 'interpolation' of type int is deprecated since 0.13 and will be removed in 0.15. "
"Please use InterpolationMode enum."
)
interpolation
=
_interpolation_modes_from_int
(
interpolation
)
if
not
isinstance
(
angle
,
(
int
,
float
)):
if
not
isinstance
(
angle
,
(
int
,
float
)):
raise
TypeError
(
"Argument angle should be int or float"
)
raise
TypeError
(
"Argument angle should be int or float"
)
...
...
torchvision/transforms/transforms.py
View file @
bac678c8
...
@@ -298,8 +298,6 @@ class Resize(torch.nn.Module):
...
@@ -298,8 +298,6 @@ class Resize(torch.nn.Module):
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.BILINEAR``.
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.BILINEAR``.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.NEAREST_EXACT``,
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.NEAREST_EXACT``,
``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` are supported.
``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` are supported.
For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
max_size (int, optional): The maximum allowed for the longer edge of
max_size (int, optional): The maximum allowed for the longer edge of
the resized image: if the longer edge of the image is greater
the resized image: if the longer edge of the image is greater
than ``max_size`` after being resized according to ``size``, then
than ``max_size`` after being resized according to ``size``, then
...
@@ -324,14 +322,6 @@ class Resize(torch.nn.Module):
...
@@ -324,14 +322,6 @@ class Resize(torch.nn.Module):
self
.
size
=
size
self
.
size
=
size
self
.
max_size
=
max_size
self
.
max_size
=
max_size
# Backward compatibility with integer value
if
isinstance
(
interpolation
,
int
):
warnings
.
warn
(
"Argument 'interpolation' of type int is deprecated since 0.13 and will be removed in 0.15. "
"Please use InterpolationMode enum."
)
interpolation
=
_interpolation_modes_from_int
(
interpolation
)
self
.
interpolation
=
interpolation
self
.
interpolation
=
interpolation
self
.
antialias
=
antialias
self
.
antialias
=
antialias
...
@@ -752,8 +742,6 @@ class RandomPerspective(torch.nn.Module):
...
@@ -752,8 +742,6 @@ class RandomPerspective(torch.nn.Module):
interpolation (InterpolationMode): Desired interpolation enum defined by
interpolation (InterpolationMode): Desired interpolation enum defined by
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.BILINEAR``.
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.BILINEAR``.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
fill (sequence or number): Pixel fill value for the area outside the transformed
fill (sequence or number): Pixel fill value for the area outside the transformed
image. Default is ``0``. If given a number, the value is used for all bands respectively.
image. Default is ``0``. If given a number, the value is used for all bands respectively.
"""
"""
...
@@ -763,14 +751,6 @@ class RandomPerspective(torch.nn.Module):
...
@@ -763,14 +751,6 @@ class RandomPerspective(torch.nn.Module):
_log_api_usage_once
(
self
)
_log_api_usage_once
(
self
)
self
.
p
=
p
self
.
p
=
p
# Backward compatibility with integer value
if
isinstance
(
interpolation
,
int
):
warnings
.
warn
(
"Argument 'interpolation' of type int is deprecated since 0.13 and will be removed in 0.15. "
"Please use InterpolationMode enum."
)
interpolation
=
_interpolation_modes_from_int
(
interpolation
)
self
.
interpolation
=
interpolation
self
.
interpolation
=
interpolation
self
.
distortion_scale
=
distortion_scale
self
.
distortion_scale
=
distortion_scale
...
@@ -867,8 +847,6 @@ class RandomResizedCrop(torch.nn.Module):
...
@@ -867,8 +847,6 @@ class RandomResizedCrop(torch.nn.Module):
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.BILINEAR``.
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.BILINEAR``.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.NEAREST_EXACT``,
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.NEAREST_EXACT``,
``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` are supported.
``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` are supported.
For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
antialias (bool, optional): antialias flag. If ``img`` is PIL Image, the flag is ignored and anti-alias
antialias (bool, optional): antialias flag. If ``img`` is PIL Image, the flag is ignored and anti-alias
is always used. If ``img`` is Tensor, the flag is False by default and can be set to True for
is always used. If ``img`` is Tensor, the flag is False by default and can be set to True for
``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` modes.
``InterpolationMode.BILINEAR`` and ``InterpolationMode.BICUBIC`` modes.
...
@@ -894,14 +872,6 @@ class RandomResizedCrop(torch.nn.Module):
...
@@ -894,14 +872,6 @@ class RandomResizedCrop(torch.nn.Module):
if
(
scale
[
0
]
>
scale
[
1
])
or
(
ratio
[
0
]
>
ratio
[
1
]):
if
(
scale
[
0
]
>
scale
[
1
])
or
(
ratio
[
0
]
>
ratio
[
1
]):
warnings
.
warn
(
"Scale and ratio should be of kind (min, max)"
)
warnings
.
warn
(
"Scale and ratio should be of kind (min, max)"
)
# Backward compatibility with integer value
if
isinstance
(
interpolation
,
int
):
warnings
.
warn
(
"Argument 'interpolation' of type int is deprecated since 0.13 and will be removed in 0.15. "
"Please use InterpolationMode enum."
)
interpolation
=
_interpolation_modes_from_int
(
interpolation
)
self
.
interpolation
=
interpolation
self
.
interpolation
=
interpolation
self
.
antialias
=
antialias
self
.
antialias
=
antialias
self
.
scale
=
scale
self
.
scale
=
scale
...
@@ -1288,8 +1258,6 @@ class RandomRotation(torch.nn.Module):
...
@@ -1288,8 +1258,6 @@ class RandomRotation(torch.nn.Module):
interpolation (InterpolationMode): Desired interpolation enum defined by
interpolation (InterpolationMode): Desired interpolation enum defined by
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.NEAREST``.
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.NEAREST``.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
expand (bool, optional): Optional expansion flag.
expand (bool, optional): Optional expansion flag.
If true, expands the output to make it large enough to hold the entire rotated image.
If true, expands the output to make it large enough to hold the entire rotated image.
If false or omitted, make the output image the same size as the input image.
If false or omitted, make the output image the same size as the input image.
...
@@ -1307,14 +1275,6 @@ class RandomRotation(torch.nn.Module):
...
@@ -1307,14 +1275,6 @@ class RandomRotation(torch.nn.Module):
super
().
__init__
()
super
().
__init__
()
_log_api_usage_once
(
self
)
_log_api_usage_once
(
self
)
# Backward compatibility with integer value
if
isinstance
(
interpolation
,
int
):
warnings
.
warn
(
"Argument 'interpolation' of type int is deprecated since 0.13 and will be removed in 0.15. "
"Please use InterpolationMode enum."
)
interpolation
=
_interpolation_modes_from_int
(
interpolation
)
self
.
degrees
=
_setup_angle
(
degrees
,
name
=
"degrees"
,
req_sizes
=
(
2
,))
self
.
degrees
=
_setup_angle
(
degrees
,
name
=
"degrees"
,
req_sizes
=
(
2
,))
if
center
is
not
None
:
if
center
is
not
None
:
...
@@ -1398,8 +1358,6 @@ class RandomAffine(torch.nn.Module):
...
@@ -1398,8 +1358,6 @@ class RandomAffine(torch.nn.Module):
interpolation (InterpolationMode): Desired interpolation enum defined by
interpolation (InterpolationMode): Desired interpolation enum defined by
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.NEAREST``.
:class:`torchvision.transforms.InterpolationMode`. Default is ``InterpolationMode.NEAREST``.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
If input is Tensor, only ``InterpolationMode.NEAREST``, ``InterpolationMode.BILINEAR`` are supported.
For backward compatibility integer values (e.g. ``PIL.Image[.Resampling].NEAREST``) are still accepted,
but deprecated since 0.13 and will be removed in 0.15. Please use InterpolationMode enum.
fill (sequence or number): Pixel fill value for the area outside the transformed
fill (sequence or number): Pixel fill value for the area outside the transformed
image. Default is ``0``. If given a number, the value is used for all bands respectively.
image. Default is ``0``. If given a number, the value is used for all bands respectively.
center (sequence, optional): Optional center of rotation, (x, y). Origin is the upper left corner.
center (sequence, optional): Optional center of rotation, (x, y). Origin is the upper left corner.
...
@@ -1422,14 +1380,6 @@ class RandomAffine(torch.nn.Module):
...
@@ -1422,14 +1380,6 @@ class RandomAffine(torch.nn.Module):
super
().
__init__
()
super
().
__init__
()
_log_api_usage_once
(
self
)
_log_api_usage_once
(
self
)
# Backward compatibility with integer value
if
isinstance
(
interpolation
,
int
):
warnings
.
warn
(
"Argument 'interpolation' of type int is deprecated since 0.13 and will be removed in 0.15. "
"Please use InterpolationMode enum."
)
interpolation
=
_interpolation_modes_from_int
(
interpolation
)
self
.
degrees
=
_setup_angle
(
degrees
,
name
=
"degrees"
,
req_sizes
=
(
2
,))
self
.
degrees
=
_setup_angle
(
degrees
,
name
=
"degrees"
,
req_sizes
=
(
2
,))
if
translate
is
not
None
:
if
translate
is
not
None
:
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment