This tutorial demonstrates how to convert PyTorch models to OpenVINO Intermediate Representation (IR) format.
- 102-pytorch-to-openvino shows how to convert the Pytorch model in formats
torch.nn.Module
andtorch.jit.ScriptModule
into OpenVINO Intermediate Representation. The tutorial uses RegNetY_800MF model from torchvision pre-trained on ImageNet dataset to demonstrate how to convert PyTorch models to OpenVINO Intermediate Representation using Model Converter. It also shows how to do classification inference on an image, using OpenVINO Runtime and compares the results of the PyTorch model with the OpenVINO IR model.
- 102-pytorch-onnx-to-openvino shows how to convert the PyTorch model to OpenVINO IR with the intermediate step of exporting PyTorch model to ONNX format.
The notebook uses OpenVINO Model Converter (OVC) to convert the open-source Lite-RASPP semantic segmentation model with a MobileNet V3 Large backbone from torchvision, trained on COCO dataset images using 20 categories that are present in the Pascal VOC dataset, to OpenVINO IR. It also shows how to do segmentation inference on an image, using OpenVINO Runtime and compares the results of the PyTorch model with the OpenVINO IR model.
If you have not installed all required dependencies, follow the Installation Guide.