Repo Models & Inference

openvinotoolkit/openvino

Open-source toolkit for optimizing and deploying deep learning inference across CPU, Intel GPU and NPU, with model conversion from PyTorch, TensorFlow, ONNX and more.

  • 12.5k GitHub stars
  • C++
  • ⚖️ Apache-2.0
  • 🎯 Advanced

Last verified: repo last pushed

pip install -U openvino
openvinotoolkit/openvino preview image

What it is

OpenVINO is an open-source software toolkit for optimizing and deploying deep learning models. It converts models from frameworks such as PyTorch, TensorFlow, ONNX, TensorFlow Lite, PaddlePaddle and JAX/Flax, and runs inference on CPU (x86, ARM), Intel GPUs and Intel NPUs. It offers APIs in C++, Python, C and NodeJS, plus a GenAI API for optimized model pipelines.

Who it's for

  • Developers deploying deep learning inference from edge to cloud
  • Teams working on computer vision, speech recognition, NLP and generative AI with large or small language models
  • Users of PyTorch, TensorFlow, ONNX or Hugging Face models who want to run them on Intel hardware
  • Contributors interested in the OpenVINO architecture and build process

Requirements

Requirements

  • Python and pip for the quick installation command
  • Supported hardware: CPU (x86, ARM), Intel integrated and discrete GPU, or Intel NPU
  • PyTorch with torchvision, or TensorFlow, installed to run the respective conversion examples
  • See the linked system requirements and supported devices pages for detailed information

Setup

  1. Install OpenVINO

    Quick installation via pip; other distributions are listed in the install guide.

    bash
    pip install -U openvino
  2. Verify installation

    Run this Python snippet to confirm OpenVINO is installed correctly.

    python
    import openvino as ov
    print(ov.__version__)
  3. Opt out of telemetry (optional)

    OpenVINO collects software performance and usage data; you can opt out at any time.

    bash
    opt_in_out --opt_out

Examples

Run a PyTorch model

python
python
import openvino as ov
import torch
import torchvision

# load PyTorch model into memory
model = torch.hub.load("pytorch/vision", "shufflenet_v2_x1_0", weights="DEFAULT")

# convert the model into OpenVINO model
example = torch.randn(1, 3, 224, 224)
ov_model = ov.convert_model(model, example_input=(example,))

# compile the model for CPU device
core = ov.Core()
compiled_model = core.compile_model(ov_model, 'CPU')

# infer the model on random data
output = compiled_model({0: example.numpy()})

What it does: Loads a ShuffleNet model from PyTorch Hub, converts it with ov.convert_model, compiles it for CPU and runs inference on random data.

Run a TensorFlow model

python
python
import numpy as np
import openvino as ov
import tensorflow as tf

# load TensorFlow model into memory
model = tf.keras.applications.MobileNetV2(weights='imagenet')

# convert the model into OpenVINO model
ov_model = ov.convert_model(model)

# compile the model for CPU device
core = ov.Core()
compiled_model = core.compile_model(ov_model, 'CPU')

# infer the model on random data
data = np.random.rand(1, 224, 224, 3)
output = compiled_model({0: data})

What it does: Converts a Keras MobileNetV2 model to OpenVINO format, compiles it for CPU and runs inference on random data.

Verify the installed version

python
python
import openvino as ov
print(ov.__version__)

What it does: Confirms the OpenVINO Python package imports correctly and prints its version.

Pros & cons

Pros

  • Pro:Converts models from many frameworks (PyTorch, TensorFlow, ONNX, TensorFlow Lite, PaddlePaddle, JAX/Flax) and deploys them without the original frameworks
  • Pro:Supports CPU (x86, ARM), Intel GPU and Intel NPU targets from edge to cloud
  • Pro:Offers C++, Python, C and NodeJS APIs, plus a GenAI API and integrations such as Optimum Intel, vLLM, LangChain and ONNX Runtime
  • Pro:Ecosystem includes NNCF for quantization and sparsity, and OpenVINO Model Server for serving

Cons

  • Con:Hardware support described centers on CPU, Intel GPU and Intel NPU, so it is oriented toward Intel hardware
  • Con:Collects performance and usage telemetry by default; opting out requires running a command
  • Con:Generative AI workflows use a separate OpenVINO GenAI installation and repository

Images