Interactive Tutorials (Python)

This collection of Python tutorials are written for running on Jupyter notebooks. The tutorials provide an introduction to the OpenVINO™ toolkit and explain how to use the Python API and tools for optimized deep learning inference. You can run the code one section at a time to see how to integrate your application with OpenVINO libraries.

Notebooks with Binder button and Google Colab button buttons can be run without installing anything. Once you have found the tutorial of your interest, just click the button next to the name of it and the Jupyter notebook will start it in a new tab of a browser.

Note

Binder and Google Colab are free online services with limited resources. For the best performance and more control, you should run the notebooks locally. Follow the Installation Guide in order to get information on how to run and manage the notebooks on your machine.

Contents:

Getting Started

The Jupyter notebooks are categorized into four classes, select one related to your needs or give them all a try. Good Luck!

First steps with OpenVINO

Brief tutorials that demonstrate how to use Python API for inference in OpenVINO.

Notebook

Description

Preview

001-hello-world
n001

Classify an image with OpenVINO.

n001-img1

002-openvino-api
n002
c002

Learn the OpenVINO Python API.

n002-img1

003-hello-segmentation
n003

Semantic segmentation with OpenVINO.

n003-img1

004-hello-detection
n004

Text detection with OpenVINO.

n004-img1

Convert & Optimize

Tutorials that explain how to optimize and quantize models with OpenVINO tools.

Notebook

Description

Preview

101-tensorflow-classification-to-openvino
n101

Convert TensorFlow models to OpenVINO IR.

n101-img1

102-pytorch-to-openvino
c102

Convert PyTorch models to OpenVINO IR.

n102-img1

103-paddle-onnx-to-openvino
n103

Convert PaddlePaddle models to OpenVINO IR.

n103-img1

121-convert-to-openvino
n121
c121

Learn OpenVINO model conversion API

Explore more notebooks here.

Notebook

Description

102-pytorch-onnx-to-openvino

Convert PyTorch models to OpenVINO IR.

104-model-tools
n104

Download, convert and benchmark models from Open Model Zoo.

105-language-quantize-bert

Optimize and quantize a pre-trained BERT model.

106-auto-device
n106

Demonstrates how to use AUTO Device.

107-speech-recognition-quantization
c107

Optimize and quantize a pre-trained Data2Vec speech model.

109-latency-tricks

Performance tricks for latency mode in OpenVINO™.

109-throughput-tricks

Performance tricks for throughput mode in OpenVINO™.

110-ct-segmentation-quantize
n110

Live inference of a kidney segmentation model and benchmark CT-scan data with OpenVINO.

110-ct-segmentation-quantize

Quantize a kidney segmentation model and show live inference.

111-yolov5-quantization-migration
c111

Migrate YOLOv5 POT API based quantization pipeline on Neural Network Compression Framework (NNCF).

112-pytorch-post-training-quantization-nncf

Use Neural Network Compression Framework (NNCF) to quantize PyTorch model in post-training mode (without model fine-tuning).

113-image-classification-quantization
n113

Quantize MobileNet image classification.

115-async-api
n115
c115

Use asynchronous execution to improve data pipelining.

116-sparsity-optimization
c116

Improve performance of sparse Transformer models.

117-model-server

Improve performance of sparse Transformer models.

118-optimize-preprocessing

Improve performance of image preprocessing step.

119-tflite-to-openvino
c119

Convert TensorFlow Lite models to OpenVINO IR.

120-tensorflow-object-detection-to-openvino
n120
c120

Convert TensorFlow Object Detection models to OpenVINO IR

122-speech-recognition-quantization-wav2vec2

Quantize Speech Recognition Models with accuracy control using NNCF PTQ API.

122-yolov8-quantization-with-accuracy-control

Convert and Optimize YOLOv8 with OpenVINO™.

Model Demos

Demos that demonstrate inference on a particular model.

Notebook

Description

Preview

205-vision-background-removal
n205
c205

Remove and replace the background in an image using salient object detection.

n205-img1

209-handwritten-ocr
n209

OCR for handwritten simplified Chinese and Japanese.

n209-img1
的人不一了是他有为在责新中任自之我们

211-speech-to-text
n211

Run inference on speech-to-text recognition model.

n211-img1

215-image-inpainting
n215

Fill missing pixels with image in-painting.

n215-img1

218-vehicle-detection-and-recognition
n218

Use pre-trained models to detect and recognize vehicles and their attributes with OpenVINO.

n218-img1

Explore more notebooks below.

Notebook

Description

Preview

201-vision-monodepth
n201
c201

Monocular depth estimation with images and video.

n201-img1

202-vision-superresolution-image
n202i
c202i

Upscale raw images with a super resolution model.

n202i-img1n202i-img2

202-vision-superresolution-video
n202v
c202v

Turn 360p into 1080p video using a super resolution model.

n202v-img1n202v-img2

203-meter-reader
n203

PaddlePaddle pre-trained models to read industrial meter’s value.

n203-img1

204-segmenter-semantic-segmentation
c204

Semantic segmentation with OpenVINO™ using Segmenter.

n204-img1

206-vision-paddlegan-anime

Turn an image into anime using a GAN.

n206-img1n206-img2

207-vision-paddlegan-superresolution

Upscale small images with superresolution using a PaddleGAN model.

n207-img1n207-img2

208-optical-character-recognition

Annotate text on images using text recognition resnet.

n208-img1

212-pyannote-speaker-diarization

Run inference on speaker diarization pipeline.

n212-img1

210-slowfast-video-recognition
n210

Video Recognition using SlowFast and OpenVINO™

n210-img1

213-question-answering
n213

Answer your questions basing on a context.

n213-img1

214-grammar-correction

Grammatical error correction with OpenVINO.

216-attention-center

The attention center model with OpenVINO™

217-vision-deblur
n217

Deblur images with DeblurGAN-v2.

n217-img1

219-knowledge-graphs-conve
n219

Optimize the knowledge graph embeddings model (ConvE) with OpenVINO.

220-cross-lingual-books-alignment
n220
c220

Cross-lingual Books Alignment With Transformers and OpenVINO™

n220-img1

221-machine-translation
n221
c221

Real-time translation from English to German.

222-vision-image-colorization
n222

Use pre-trained models to colorize black & white images using OpenVINO.

n222-img1

223-text-prediction
c223

Use pre-trained models to perform text prediction on an input sequence.

n223-img1

224-3D-segmentation-point-clouds

Process point cloud data and run 3D Part Segmentation with OpenVINO.

n224-img1

225-stable-diffusion-text-to-image

Text-to-image generation with Stable Diffusion method.

n225-img1

226-yolov7-optimization

Optimize YOLOv7, using NNCF PTQ API.

n226-img1

227-whisper-subtitles-generation
c227

Generate subtitles for video with OpenAI Whisper and OpenVINO.

n227-img1

228-clip-zero-shot-convert

Zero-shot Image Classification with OpenAI CLIP and OpenVINO™

n228-img1

228-clip-zero-shot-quantize

Post-Training Quantization of OpenAI CLIP model with NNCF

n228-img2

229-distilbert-sequence-classification
n229

Sequence classification with OpenVINO.

n229-img1

230-yolov8-optimization
c230

Optimize YOLOv8, using NNCF PTQ API.

n230-img1

231-instruct-pix2pix-image-editing

Image editing with InstructPix2Pix.

n231-img1

232-clip-language-saliency-map
c232

Language-visual saliency with CLIP and OpenVINO™.

n232-img1

233-blip-visual-language-processing

Visual question answering and image captioning using BLIP and OpenVINO™.

n233-img1

234-encodec-audio-compression

Audio compression with EnCodec and OpenVINO™.

n234-img1

235-controlnet-stable-diffusion

A text-to-image generation with ControlNet Conditioning and OpenVINO™.

n235-img1

236-stable-diffusion-v2

Text-to-image generation and Infinite Zoom with Stable Diffusion v2 and OpenVINO™.

n236-img1

236-stable-diffusion-v2

Stable Diffusion v2.1 using Optimum-Intel OpenVINO and multiple Intel Hardware.

n236-img4

236-stable-diffusion-v2

Stable Diffusion v2.1 using Optimum-Intel OpenVINO.

n236-img4

236-stable-diffusion-v2

Stable Diffusion Text-to-Image Demo.

n236-img4

236-stable-diffusion-v2

Text-to-image generation with Stable Diffusion v2 and OpenVINO™.

n236-img1

237-segment-anything

Prompt based object segmentation mask generation, using Segment Anything and OpenVINO™.

n237-img1

238-deep-floyd-if

Text-to-image generation with DeepFloyd IF and OpenVINO™.

n238-img1

239-image-bind

Binding multimodal data, using ImageBind and OpenVINO™.

n239-img1

240-dolly-2-instruction-following

Instruction following using Databricks Dolly 2.0 and OpenVINO™.

n240-img1

241-riffusion-text-to-music

Text-to-Music generation using Riffusion and OpenVINO™.

n241-img1

242-freevc-voice-conversion

High-Quality Text-Free One-Shot Voice Conversion with FreeVC and OpenVINO™

243-tflite-selfie-segmentation
n243
c243

Selfie Segmentation using TFLite and OpenVINO™.

n243-img1

244-named-entity-recognition
c244

Named entity recognition with OpenVINO™.

245-typo-detector

English Typo Detection in sentences with OpenVINO™.

n245-img1

246-depth-estimation-videpth

Monocular Visual-Inertial Depth Estimation with OpenVINO™.

n246-img1

247-code-language-id
n247

Identify the programming language used in an arbitrary code snippet.

248-stable-diffusion-xl

Image generation with Stable Diffusion XL and OpenVINO™.

n248-img1

249-oneformer-segmentation

Universal segmentation with OneFormer and OpenVINO™.

n249-img1

250-music-generation
n250
c250

Controllable Music Generation with MusicGen and OpenVINO™.

n250-img1

251-tiny-sd-image-generation
c251

Image Generation with Tiny-SD and OpenVINO™.

n251-img1

252-fastcomposer-image-generation

Image generation with FastComposer and OpenVINO™.

253-zeroscope-text2video

Text-to video synthesis with ZeroScope and OpenVINO™.

A panda eating bamboo on a rock.
n253-img1

Model Training

Tutorials that include code to train neural networks.

Notebook

Description

Preview

301-tensorflow-training-openvino

Train a flower classification model from TensorFlow, then convert to OpenVINO IR.

n301-img1

302-pytorch-quantization-aware-training

Use Neural Network Compression Framework (NNCF) to quantize PyTorch model.

305-tensorflow-quantization-aware-training
c305

Use Neural Network Compression Framework (NNCF) to quantize TensorFlow model.

Live Demos

Live inference demos that run on a webcam or video files.

Notebook

Description

Preview

401-object-detection-webcam
n401
c401

Object detection with a webcam or video file.

n401-img1

402-pose-estimation-webcam
n402

Human pose estimation with a webcam or video file.

n402-img1

403-action-recognition-webcam
n403

Human action recognition with a webcam or video file.

n403-img1

404-style-transfer-webcam
n404
c404

Style transfer with a webcam or video file.

n404-img1

405-paddle-ocr-webcam
n405
c405

OCR with a webcam or video file.

n405-img1

406-3D-pose-estimation-webcam
n406

3D display of human pose estimation with a webcam or video file.

n406-img1

407-person-tracking-webcam
n407
c407

Person tracking with a webcam or video file.

n407-img1

Contributors

contributors

Made with contributors-img.