• Stars
    star
    2,372
  • Rank 19,396 (Top 0.4 %)
  • Language
    Jupyter Notebook
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

📚 Jupyter notebook tutorials for OpenVINO™

English | 简体中文

📚 OpenVINO™ Notebooks

Apache License Version 2.0 CI CI

A collection of ready-to-run Jupyter notebooks for learning and experimenting with the OpenVINO™ Toolkit. The notebooks provide an introduction to OpenVINO basics and teach developers how to leverage our API for optimized deep learning inference.

-----------------------------------------------------

🚀 AI Trends - Notebooks

Check out the latest notebooks that show how to optimize and deploy popular models on Intel CPU and GPU.

Notebook Description Preview Complementary Materials
YOLOv8 - Optimization
Optimize YOLOv8 using NNCF PTQ API Blog - How to get YOLOv8 Over 1000 fps with Intel GPUs?
SAM - Segment Anything Model
Prompt based object segmentation mask generation using Segment Anything and OpenVINO™ Blog - SAM: Segment Anything Model — Versatile by itself and Faster by OpenVINO
ControlNet - Stable-Diffusion
A Text-to-Image Generation with ControlNet Conditioning and OpenVINO™ Blog - Control your Stable Diffusion Model with ControlNet and OpenVINO
Stable Diffusion v2
Text-to-Image Generation and Infinite Zoom with Stable Diffusion v2 and OpenVINO™ Blog - How to run Stable Diffusion on Intel GPUs with OpenVINO
Whisper - Subtitles generation
Generate subtitles for video with OpenAI Whisper and OpenVINO
CLIP - zero-shot-image-classification
Perform Zero-shot Image Classification with CLIP and OpenVINO Blog - Generative AI and Explainable AI with OpenVINO
BLIP - Visual-language-processing
Visual Question Answering and Image Captioning using BLIP and OpenVINO™ Blog - Multimodality with OpenVINO — BLIP
Instruct pix2pix - Image-editing
Image editing with InstructPix2Pix Blog - Generative AI and Explainable AI with OpenVINO
DeepFloyd IF - Text-to-Image generation
Text-to-Image Generation with DeepFloyd IF and OpenVINO™
ImageBind
Binding multimodal data using ImageBind and OpenVINO™
Dolly v2
Instruction following using Databricks Dolly 2.0 and OpenVINO™

Table of Contents

-----------------------------------------------------

📝 Installation Guide

OpenVINO Notebooks require Python and Git. To get started, select the guide for your operating system or environment:

Windows Ubuntu macOS Red Hat CentOS Azure ML Docker Amazon SageMaker

-----------------------------------------------------

🚀 Getting Started

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

NOTE: The main branch of this repository was updated to support the new OpenVINO 2023.0 release. To upgrade to the new release version, please run pip install --upgrade -r requirements.txt in your openvino_env virtual environment. If you need to install for the first time, see the Installation Guide section below. If you wish to use the previous Long Term Support (LTS) version of OpenVINO check out the 2022.3 branch.

If you need help, please start a GitHub Discussion.

💻 First steps

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

001-hello-world
Binder
002-openvino-api
Binder
003-hello-segmentation
Binder
004-hello-detection
Binder
Classify an image with OpenVINO Learn the OpenVINO Python API Semantic segmentation with OpenVINO Text detection with OpenVINO

Convert & Optimize

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

Notebook Description
101-tensorflow-to-openvino
Binder
Convert TensorFlow models to OpenVINO IR
102-pytorch-onnx-to-openvino Convert PyTorch models to OpenVINO IR
103-paddle-to-openvino
Binder
Convert PaddlePaddle models to OpenVINO IR
104-model-tools
Binder
Download, convert and benchmark models from Open Model Zoo
105-language-quantize-bert Optimize and quantize a pre-trained BERT model
106-auto-device
Binder
Demonstrate how to use AUTO Device
107-speech-recognition-quantization Quantize speech recognition models using NNCF PTQ API
108-gpu-device Working with GPUs in OpenVINO™
109-performance-tricks Performance tricks in OpenVINO™
110-ct-segmentation-quantize
Binder
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
Binder
Quantize mobilenet image classification
114-quantization-simplified-mode
Binder
Quantize Image Classification Models with POT in Simplified Mode
115-async-api
Binder
Use Asynchronous Execution to Improve Data Pipelining
116-sparsity-optimization
Improve performance of sparse Transformer models
117-model-server Introduction to model serving with OpenVINO™ Model Server (OVMS)
118-optimize-preprocessing Improve performance of image preprocessing step

🎯 Model Demos

Demos that demonstrate inference on a particular model.

Notebook Description Preview
201-vision-monodepth
Binder
Monocular depth estimation with images and video
202-vision-superresolution-image
Binder
Upscale raw images with a super resolution model
202-vision-superresolution-video
Binder
Turn 360p into 1080p video using a super resolution model
203-meter-reader
Binder
PaddlePaddle pre-trained models to read industrial meter's value
204-segmenter-semantic-segmentation
Semantic Segmentation with OpenVINO™ using Segmenter
205-vision-background-removal
Binder
Remove and replace the background in an image using salient object detection
206-vision-paddlegan-anime
Turn an image into anime using a GAN
207-vision-paddlegan-superresolution
Upscale small images with superresolution using a PaddleGAN model
208-optical-character-recognition
Annotate text on images using text recognition resnet
209-handwritten-ocr
Binder
OCR for handwritten simplified Chinese and Japanese handwritten_simplified_chinese_test
的人不一了是他有为在责新中任自之我们
211-speech-to-text
Binder
Run inference on speech-to-text recognition model
212-pyannote-speaker-diarization
Run inference on speaker diarization pipeline
213-question-answering
Binder
Answer your questions basing on a context
214-grammar-correction Grammatical Error Correction with OpenVINO input text: I'm working in campany for last 2 yeas
Generated text: I'm working in a company for the last 2 years.
215-image-inpainting
Binder
Fill missing pixels with image in-painting
216-attention-center
The attention center model with OpenVINO™
217-vision-deblur
Binder
Deblur Images with DeblurGAN-v2
218-vehicle-detection-and-recognition
Binder
Use pre-trained models to detect and recognize vehicles and their attributes with OpenVINO
219-knowledge-graphs-conve
Binder
Optimize the knowledge graph embeddings model (ConvE) with OpenVINO
221-machine-translation
Binder
Real-time translation from English to German
222-vision-image-colorization
Binder
Use pre-trained models to colorize black & white images using OpenVINO
223-text-prediction
Use pretrained models to perform text prediction on an input sequence
224-3D-segmentation-point-clouds
Process point cloud data and run 3D Part Segmentation with OpenVINO
225-stable-diffusion-text-to-image
Text-to-image generation with Stable Diffusion method
226-yolov7-optimization
Optimize YOLOv7 using NNCF PTQ API
227-whisper-subtitles-generation
Generate subtitles for video with OpenAI Whisper and OpenVINO
228-clip-zero-shot-image-classification
Perform Zero-shot Image Classification with CLIP and OpenVINO
229-distilbert-sequence-classification
Binder
Sequence Classification with OpenVINO
230-yolov8-optimization
Optimize YOLOv8 using NNCF PTQ API
231-instruct-pix2pix-image-editing
Image editing with InstructPix2Pix
232-clip-language-saliency-map
Language-Visual Saliency with CLIP and OpenVINO™
233-blip-visual-language-processing
Visual Question Answering and Image Captioning using BLIP and OpenVINO™
234-encodec-audio-compression
Audio compression with EnCodec and OpenVINO™
235-controlnet-stable-diffusion
A Text-to-Image Generation with ControlNet Conditioning and OpenVINO™
236-stable-diffusion-v2
Text-to-Image Generation and Infinite Zoom with Stable Diffusion v2 and OpenVINO™
237-segment-anything
Prompt based segmentation using Segment Anything and OpenVINO™.
238-deep-floyd-if
Text-to-Image Generation with DeepFloyd IF and OpenVINO™
239-image-bind
Binding multimodal data using ImageBind and OpenVINO™
240-dolly-2-instruction-following
Instruction following using Databricks Dolly 2.0 and OpenVINO™

🏃 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
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
Binder
Object detection with a webcam or video file
402-pose-estimation-webcam
Binder
Human pose estimation with a webcam or video file
403-action-recognition-webcam
Binder
Human action recognition with a webcam or video file
404-style-transfer-webcam
Binder
Style Transfer with a webcam or video file
405-paddle-ocr-webcam
Binder
OCR with a webcam or video file
406-3D-pose-estimation-webcam
Binder
3D display of human pose estimation with a webcam or video file
407-person-tracking-webcam
Binder
Person tracking with a webcam or video file

If you run into issues, please check the troubleshooting section, FAQs or start a GitHub discussion.

Notebooks with a binder logo button can be run without installing anything. Binder is a free online service with limited resources. For the best performance, please follow the Installation Guide and run the notebooks locally.

-----------------------------------------------------

⚙️ System Requirements

The notebooks run almost anywhere — your laptop, a cloud VM, or even a Docker container. The table below lists the supported operating systems and Python versions.

Supported Operating System Python Version (64-bit)
Ubuntu 20.04 LTS, 64-bit 3.7, 3.8, 3.9, 3.10
Ubuntu 22.04 LTS, 64-bit 3.7, 3.8, 3.9, 3.10
Red Hat Enterprise Linux 8, 64-bit 3.8, 3.9, 3.10
CentOS 7, 64-bit 3.7, 3.8, 3.9, 3.10
macOS 10.15.x versions or higher 3.7, 3.8, 3.9, 3.10
Windows 10, 64-bit Pro, Enterprise or Education editions 3.7, 3.8, 3.9, 3.10
Windows Server 2016 or higher 3.7, 3.8, 3.9, 3.10

-----------------------------------------------------

💻 Run the Notebooks

To Launch a Single Notebook

If you wish to launch only one notebook, like the Monodepth notebook, run the command below.

jupyter 201-vision-monodepth.ipynb

To Launch all Notebooks

jupyter lab notebooks

In your browser, select a notebook from the file browser in Jupyter Lab using the left sidebar. Each tutorial is located in a subdirectory within the notebooks directory.

-----------------------------------------------------

🧹 Cleaning Up

• Shut Down Jupyter Kernel

To end your Jupyter session, press Ctrl-c. This will prompt you to Shutdown this Jupyter server (y/[n])? enter y and hit Enter.

• Deactivate Virtual Environment

To deactivate your virtualenv, simply run deactivate from the terminal window where you activated openvino_env. This will deactivate your environment.

To reactivate your environment, run source openvino_env/bin/activate on Linux or openvino_env\Scripts\activate on Windows, then type jupyter lab or jupyter notebook to launch the notebooks again.

• Delete Virtual Environment _(Optional)_

To remove your virtual environment, simply delete the openvino_env directory:

• On Linux and macOS:
rm -rf openvino_env
• On Windows:
rmdir /s openvino_env
• Remove openvino_env Kernel from Jupyter
jupyter kernelspec remove openvino_env

-----------------------------------------------------

⚠️ Troubleshooting

If these tips do not solve your problem, please open a discussion topic or create an issue!

  • To check some common installation problems, run python check_install.py. This script is located in the openvino_notebooks directory. Please run it after activating the openvino_env virtual environment.
  • If you get an ImportError, doublecheck that you installed the Jupyter kernel. If necessary, choose the openvino_env kernel from the Kernel->Change Kernel menu) in Jupyter Lab or Jupyter Notebook
  • If OpenVINO is installed globally, do not run installation commands in a terminal where setupvars.bat or setupvars.sh are sourced.
  • For Windows installation, it is recommended to use Command Prompt (cmd.exe), not PowerShell.

-----------------------------------------------------

More Repositories

1

openvino

OpenVINO™ is an open-source toolkit for optimizing and deploying AI inference
C++
7,074
star
2

open_model_zoo

Pre-trained Deep Learning models and demos (high quality and extremely fast)
Python
4,086
star
3

anomalib

An anomaly detection library comprising state-of-the-art algorithms and features such as experiment management, hyper-parameter optimization, and edge inference.
Python
3,761
star
4

training_extensions

Train, Evaluate, Optimize, Deploy Computer Vision Models via OpenVINO™
Python
1,139
star
5

nncf

Neural Network Compression Framework for enhanced OpenVINO™ inference
Python
925
star
6

model_server

A scalable inference server for models optimized with OpenVINO™
C++
660
star
7

datumaro

Dataset Management Framework, a Python library and a CLI tool to build, analyze and manage Computer Vision datasets.
Python
528
star
8

openvino_tensorflow

OpenVINO™ integration with TensorFlow
C++
178
star
9

openvino.genai

Run Generative AI models using native OpenVINO C++ API
C++
120
star
10

openvino_contrib

Repository for OpenVINO's extra modules
C++
105
star
11

awesome-openvino

A curated list of OpenVINO based AI projects
99
star
12

geti-sdk

Software Development Kit (SDK) for the Intel® Geti™ platform for Computer Vision AI model training.
Python
73
star
13

docker_ci

The framework to generate a Dockerfile, build, test, and deploy a docker image with OpenVINO™ toolkit.
Dockerfile
58
star
14

training_toolbox_caffe

Training Toolbox for Caffe
Jupyter Notebook
49
star
15

openvino_build_deploy

Pre-built components and code samples to help you build and deploy production-grade AI applications with the OpenVINO™ Toolkit from Intel
Jupyter Notebook
42
star
16

npu_plugin

OpenVINO NPU Plugin
MLIR
33
star
17

workbench

TypeScript
28
star
18

model_api

C++
25
star
19

openvino_xai

OpenVINO™ Explainable AI (XAI) Toolkit: Visual Explanation for OpenVINO Models
Python
24
star
20

openvino_tokenizers

OpenVINO Tokenizers extension
C++
22
star
21

model_preparation_algorithm

Model Preparation Algorithm: a Transfer Learning Framework
Python
21
star
22

security_addon

OpenVINO™ Security Add-on to control access to inferencing models.
C
16
star
23

operator

OpenVINO operator for OpenShift and Kubernetes
Go
13
star
24

model_analyzer

Model Analyzer is the Network Statistic Information tool
Python
11
star
25

workbench_aux

OpenVINO™ Toolkit - Deep Learning Workbench repository Auxuliary Assets
Python
10
star
26

mlas

Assembly
8
star
27

hyper_parameter_optimization

Python library of automatic hyper-parameter optimization
Python
6
star
28

openvino_docs

OpenVINO™ Toolkit documentation repository
Python
3
star
29

MLPerf

C++
2
star
30

telemetry

Python
1
star
31

npu_plugin_btc

C++
1
star
32

cpu_extensions

1
star
33

npu_plugin_elf

C++
1
star