Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[PT FE] Update torchvision tests with quantized and detection models (#26397)

Maxim Vafind4ade56911d4
diff --git a/tests/model_hub_tests/pytorch/test_torchvision_models.py b/tests/model_hub_tests/pytorch/test_torchvision_models.py
index 6204d57741e..10c11d1c147 100644
--- a/tests/model_hub_tests/pytorch/test_torchvision_models.py
+++ b/tests/model_hub_tests/pytorch/test_torchvision_models.py
@@ -7,15 +7,14 @@ import tempfile
import pytest
import torch
import torchvision.transforms.functional as F
+from torchvision.models import list_models, get_model, get_model_weights
from models_hub_common.utils import get_models_list, retry
from torch_utils import TestTorchConvertModel
def get_all_models() -> list:
- m_list = torch.hub.list("pytorch/vision", skip_validation=True)
- m_list.remove("get_model_weights")
- m_list.remove("get_weight")
+ m_list = list_models()
return m_list
@@ -39,8 +38,7 @@ def get_video():
def prepare_frames_for_raft(name, frames1, frames2):
- w = torch.hub.load("pytorch/vision", "get_model_weights",
- name=name, skip_validation=True).DEFAULT
+ w = get_model_weights(name).DEFAULT
img1_batch = torch.stack(frames1)
img2_batch = torch.stack(frames2)
img1_batch = F.resize(img1_batch, size=[520, 960], antialias=False)
@@ -56,8 +54,7 @@ torch.manual_seed(0)
class TestTorchHubConvertModel(TestTorchConvertModel):
@retry(3, exceptions=(OSError,), delay=1)
def load_model(self, model_name, model_link):
- m = torch.hub.load("pytorch/vision", model_name,
- weights='DEFAULT', skip_validation=True)
+ m = get_model(model_name, weights='DEFAULT')
m.eval()
if model_name == "s3d" or any([m in model_name for m in ["swin3d", "r3d_18", "mc3_18", "r2plus1d_18"]]):
self.example = (torch.randn([1, 3, 224, 224, 224]),)
@@ -93,7 +90,11 @@ class TestTorchHubConvertModel(TestTorchConvertModel):
fw_outputs = [fw_outputs.numpy(force=True)]
return fw_outputs
- @pytest.mark.parametrize("model_name", ["efficientnet_b7", "raft_small", "swin_v2_s"])
+ @pytest.mark.parametrize("model_name", ["efficientnet_b7",
+ "raft_small",
+ "swin_v2_s",
+ "quantized_mobilenet_v3_large",
+ ])
@pytest.mark.precommit
def test_convert_model_precommit(self, model_name, ie_device):
self.mode = "trace"
diff --git a/tests/model_hub_tests/pytorch/torchvision_models b/tests/model_hub_tests/pytorch/torchvision_models
index a045925ed54..3bb2d942344 100644
--- a/tests/model_hub_tests/pytorch/torchvision_models
+++ b/tests/model_hub_tests/pytorch/torchvision_models
@@ -21,11 +21,19 @@ efficientnet_b7,none
efficientnet_v2_l,none
efficientnet_v2_m,none
efficientnet_v2_s,none
+fasterrcnn_mobilenet_v3_large_320_fpn,none,skip,Not supported
+fasterrcnn_mobilenet_v3_large_fpn,none,skip,Not supported
+fasterrcnn_resnet50_fpn,none,skip,Not supported
+fasterrcnn_resnet50_fpn_v2,none,skip,Not supported
fcn_resnet101,none,xfail_export,Requested None inlined input
fcn_resnet50,none,xfail_export,Requested None inlined input
+fcos_resnet50_fpn,none,skip,Not supported
googlenet,none
inception_v3,none
+keypointrcnn_resnet50_fpn,none,skip,Not supported
lraspp_mobilenet_v3_large,none,xfail_export,Requested None inlined input
+maskrcnn_resnet50_fpn,none,skip,Not supported
+maskrcnn_resnet50_fpn_v2,none,skip,Not supported
maxvit_t,none
mc3_18,none
mnasnet0_5,none
@@ -37,6 +45,18 @@ mobilenet_v3_large,none
mobilenet_v3_small,none
mvit_v1_b,none
mvit_v2_s,none
+quantized_googlenet,none
+quantized_inception_v3,none
+quantized_mobilenet_v2,none
+quantized_mobilenet_v3_large,none
+quantized_resnet18,none
+quantized_resnet50,none
+quantized_resnext101_32x8d,none
+quantized_resnext101_64x4d,none
+quantized_shufflenet_v2_x0_5,none
+quantized_shufflenet_v2_x1_0,none
+quantized_shufflenet_v2_x1_5,none
+quantized_shufflenet_v2_x2_0,none
r2plus1d_18,none
r3d_18,none
raft_large,none,xfail_export,Mutating module attribute corr_pyramid during export
@@ -64,6 +84,8 @@ resnet50,none
resnext101_32x8d,none
resnext101_64x4d,none
resnext50_32x4d,none
+retinanet_resnet50_fpn,none,skip,Not supported
+retinanet_resnet50_fpn_v2,none,skip,Not supported
s3d,none
shufflenet_v2_x0_5,none
shufflenet_v2_x1_0,none
@@ -71,6 +93,8 @@ shufflenet_v2_x1_5,none
shufflenet_v2_x2_0,none
squeezenet1_0,none
squeezenet1_1,none
+ssd300_vgg16,none,skip,Not supported
+ssdlite320_mobilenet_v3_large,none,skip,Not supported
swin3d_b,none
swin3d_s,none
swin3d_t,none