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 a Binder button button 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 Binder will start it in a new tab of a browser. Binder is a free online service with limited resources (for more information about it, see the Additional Resources section).

Note

For the best performance, more control and resources, 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

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-to-openvino
n101

Convert TensorFlow models to OpenVINO IR.

n101-img1

102-pytorch-onnx-to-openvino

Convert PyTorch models to OpenVINO IR.

n102-img1

103-paddle-onnx-to-openvino
n103

Convert PaddlePaddle models to OpenVINO IR.

n103-img1

104-model-tools
n104

Download, convert and benchmark models from Open Model Zoo.

n104-img1

Explore more notebooks here.

Notebook

Description

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

Optimize and quantize a pre-trained Data2Vec speech model

107-speech-recognition-quantization

Optimize and quantize a pre-trained Wav2Vec2 speech model

108-gpu-device

Working with GPUs in OpenVINO™

109-performance-tricks

Performance tricks in OpenVINO™

110-ct-segmentation-quantize
n110

Quantize a kidney segmentation model and show live inference

111-yolov5-quantization-migration

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

114-quantization-simplified-mode
n114

Quantize Image Classification Models with POT in Simplified Mode

115-async-api
n115

Use Asynchronous Execution to Improve Data Pipelining

116-sparsity-optimization

Improve performance of sparse Transformer models

117-model-server

Improve performance of sparse Transformer models

118-optimize-preprocessing

Improve performance of image preprocessing step

Model Demos

Demos that demonstrate inference on a particular model.

Notebook

Description

Preview

205-vision-background-removal
n205

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

Monocular depth estimation with images and video.

n201-img1

202-vision-superresolution-image
n202i

Upscale raw images with a super resolution model.

n202i-img1n202i-img2

202-vision-superresolution-video
n202v

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

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

213-question-answering
n213

Answer your questions basing on a context.

n213-img1

214-grammar-correction

Grammatical Error Correction 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-yolov5-accuracy-check-and-quantization

Quantize the Ultralytics YOLOv5 model and check accuracy using the OpenVINO POT API

n220-img1

221-machine-translation
n221

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

Use pretrained 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

Generate subtitles for video with OpenAI Whisper and OpenVINO

n227-img1

228-clip-zero-shot-image-classification

Perform Zero-shot Image Classification with CLIP and OpenVINO

n228-img1

229-distilbert-sequence-classification
n229

Sequence Classification with OpenVINO

n229-img1

230-yolov8-optimization

Optimize YOLOv8 using NNCF PTQ API

n230-img1

231-instruct-pix2pix-image-editing

Image editing with InstructPix2Pix

n231-img1

232-clip-language-saliency-map

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

237-segment-anything

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

n237-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

301-tensorflow-training-openvino-pot

Use Post-training Optimization Tool (POT) to quantize the flowers model.

302-pytorch-quantization-aware-training

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

305-tensorflow-quantization-aware-training

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

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

Style Transfer with a webcam or video file

n404-img1

405-paddle-ocr-webcam
n405

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

Person tracking with a webcam or video file

n407-img1