Unverified Commit e722e9c7 authored by Vasilis Vryniotis's avatar Vasilis Vryniotis Committed by GitHub
Browse files

Reinstate and deprecate `model_urls` and `quant_model_urls` (#5992)



* Reinstate and deprecate `model_urls` and `quant_model_urls`

* Apply suggestions from code review
Co-authored-by: default avatarNicolas Hug <contact@nicolas-hug.com>

* Move todo location

* Add alexnet

* Add densenet

* Add efficientnet

* Add googlenet.

* Add inception.

* Add mobilenetv3

* Add regnet

* Add resnet

* Add shufflenetv2

* Fix linter

* Add squeezenet

* Add vgg

* Add vit

* Add quantized googlenet

* Add quantized inceptionv3

* Add quantized mobilenet_v3

* Add quantized resnet

* Add quantized shufflenetv2

* Fix incorrect imports

* Add faster_rcnn

* Add fcos

* Add keypoint rcnn

* Add mask rcnn

* Add retinanet

* Add ssd

* Add ssdlite

* Add deeplabv3

* Add fcn

* Add lraspp.

* Add video resnet

* Removing weights for shufflenetv2_x1.5 and shufflenetv2_x2.0

* Update the comments
Co-authored-by: default avatarNicolas Hug <contact@nicolas-hug.com>
parent 9166b671
......@@ -298,3 +298,16 @@ def shufflenet_v2_x2_0(
return _shufflenetv2(
[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,
}
)
......@@ -1330,3 +1330,27 @@ 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)
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,
}
)
......@@ -853,3 +853,22 @@ def wide_resnet101_2(
_ovewrite_named_param(kwargs, "width_per_group", 64 * 2)
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,
}
)
......@@ -365,3 +365,16 @@ def deeplabv3_mobilenet_v3_large(
model.load_state_dict(weights.get_state_dict(progress=progress))
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,
}
)
......@@ -212,3 +212,15 @@ def fcn_resnet101(
model.load_state_dict(weights.get_state_dict(progress=progress))
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,
}
)
......@@ -165,3 +165,14 @@ def lraspp_mobilenet_v3_large(
model.load_state_dict(weights.get_state_dict(progress=progress))
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,
}
)
......@@ -374,3 +374,17 @@ def shufflenet_v2_x2_0(
weights = ShuffleNet_V2_X2_0_Weights.verify(weights)
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,
}
)
......@@ -213,3 +213,15 @@ def squeezenet1_1(
"""
weights = SqueezeNet1_1_Weights.verify(weights)
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,
}
)
......@@ -461,3 +461,21 @@ def vgg19_bn(*, weights: Optional[VGG19_BN_Weights] = None, progress: bool = Tru
weights = VGG19_BN_Weights.verify(weights)
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,
}
)
......@@ -463,3 +463,16 @@ def r2plus1d_18(*, weights: Optional[R2Plus1D_18_Weights] = None, progress: bool
progress,
**kwargs,
)
# The dictionary below is internal implementation detail and will be removed in v0.15
from .._utils import _ModelURLs
model_urls = _ModelURLs(
{
"r3d_18": R3D_18_Weights.KINETICS400_V1.url,
"mc3_18": MC3_18_Weights.KINETICS400_V1.url,
"r2plus1d_18": R2Plus1D_18_Weights.KINETICS400_V1.url,
}
)
......@@ -746,3 +746,17 @@ def interpolate_embeddings(
model_state = model_state_copy
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,
}
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment