OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[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.pyindex 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 tempfileimport pytestimport torchimport torchvision.transforms.functional as F+from torchvision.models import list_models, get_model, get_model_weightsfrom models_hub_common.utils import get_models_list, retryfrom torch_utils import TestTorchConvertModeldef 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).DEFAULTimg1_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.precommitdef 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_modelsindex 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,noneefficientnet_v2_l,noneefficientnet_v2_m,noneefficientnet_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 supportedfcn_resnet101,none,xfail_export,Requested None inlined inputfcn_resnet50,none,xfail_export,Requested None inlined input+fcos_resnet50_fpn,none,skip,Not supportedgooglenet,noneinception_v3,none+keypointrcnn_resnet50_fpn,none,skip,Not supportedlraspp_mobilenet_v3_large,none,xfail_export,Requested None inlined input+maskrcnn_resnet50_fpn,none,skip,Not supported+maskrcnn_resnet50_fpn_v2,none,skip,Not supportedmaxvit_t,nonemc3_18,nonemnasnet0_5,none@@ -37,6 +45,18 @@ mobilenet_v3_large,nonemobilenet_v3_small,nonemvit_v1_b,nonemvit_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,noner2plus1d_18,noner3d_18,noneraft_large,none,xfail_export,Mutating module attribute corr_pyramid during export@@ -64,6 +84,8 @@ resnet50,noneresnext101_32x8d,noneresnext101_64x4d,noneresnext50_32x4d,none+retinanet_resnet50_fpn,none,skip,Not supported+retinanet_resnet50_fpn_v2,none,skip,Not supporteds3d,noneshufflenet_v2_x0_5,noneshufflenet_v2_x1_0,none@@ -71,6 +93,8 @@ shufflenet_v2_x1_5,noneshufflenet_v2_x2_0,nonesqueezenet1_0,nonesqueezenet1_1,none+ssd300_vgg16,none,skip,Not supported+ssdlite320_mobilenet_v3_large,none,skip,Not supportedswin3d_b,noneswin3d_s,noneswin3d_t,none