Skip to content

Latest commit

 

History

History
469 lines (386 loc) · 59.6 KB

tutorials.rst

File metadata and controls

469 lines (386 loc) · 59.6 KB
.. index:: pair: page; Tutorials

Tutorials

:target:`tuts__tutorials_1md_openvino_docs_tutorials`

.. toctree::
   :maxdepth: 2
   :caption: Notebooks
   :hidden:
   :glob:

   notebooks-installation
   notebooks/*

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:


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

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

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
.. dropdown:: Explore more notebooks here.

   +------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
   | Notebook                                                                                                                     | Description                                                                                                                      |
   +==============================================================================================================================+==================================================================================================================================+
   | `105-language-quantize-bert <notebooks/105-language-quantize-bert-with-output.html>`__                                       | Optimize and quantize a pre-trained BERT model                                                                                   |
   +------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
   | `106-auto-device <notebooks/106-auto-device-with-output.html>`__                                                             | Demonstrates how to use AUTO Device                                                                                              |
   +------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
   | `107-speech-recognition-quantization <notebooks/107-speech-recognition-quantization-with-output.html>`__                     | Optimize and quantize a pre-trained Wav2Vec2 speech model                                                                        |
   +------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
   | `110-ct-segmentation-quantize <notebooks/110-ct-segmentation-quantize-with-output.html>`__                                   | Quantize a kidney segmentation model and show live inference                                                                     |
   +------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
   | `111-detection-quantization <notebooks/111-detection-quantization-with-output.html>`__ |br| |n111|                           | Quantize an object detection model                                                                                               |
   +------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
   | `112-pytorch-post-training-quantization-nncf <notebooks/112-pytorch-post-training-quantization-nncf-with-output.html>`__     | Use Neural Network Compression Framework (NNCF) to quantize PyTorch model in post-training mode (without model fine-tuning)      |
   +------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
   | `113-image-classification-quantization <notebooks/113-image-classification-quantization-with-output.html>`__                 | Quantize mobilenet image classification                                                                                          |
   +------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
   | `114-quantization-simplified-mode <notebooks/114-quantization-simplified-mode-with-output.html>`__                           | Quantize Image Classification Models with POT in Simplified Mode                                                                 |
   +------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+
   | `115-async-api <notebooks/115-async-api-with-output.html>`__                                                                 | Use Asynchronous Execution to Improve Data Pipelining                                                                            |
   +------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+

Demos that demonstrate inference on a particular model.

Notebook Description Preview
210-ct-scan-live-inference
n210
Show live inference on segmentation of CT-scan data. n210-img1
211-speech-to-text
n211
Run inference on speech-to-text recognition model. n211-img1
208-optical-character-recognition Annotate text on images using text recognition resnet. n208-img1
209-handwritten-ocr
n209
OCR for handwritten simplified Chinese and Japanese. n209-img1
的人不一了是他有为在责新中任自之我们
218-vehicle-detection-and-recognition Use pre-trained models to detect and recognize vehicles and their attributes with OpenVINO. n218-img1
.. dropdown:: Explore more notebooks below.

   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | Notebook                                                                                                                      | Description                                                                                                                                | Preview                                   |
   +===============================================================================================================================+============================================================================================================================================+===========================================+
   | `201-vision-monodepth <notebooks/201-vision-monodepth-with-output.html>`__ |br| |n201|                                        | Monocular depth estimation with images and video.                                                                                          | |n201-img1|                               |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `202-vision-superresolution-image <notebooks/202-vision-superresolution-image-with-output.html>`__ |br| |n202i|               | Upscale raw images with a super resolution model.                                                                                          | |n202i-img1| → |n202i-img2|               |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `202-vision-superresolution-video <notebooks/202-vision-superresolution-video-with-output.html>`__ |br| |n202v|               | Turn 360p into 1080p video using a super resolution model.                                                                                 | |n202v-img1| → |n202v-img2|               |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `203-meter-reader <notebooks/203-meter-reader-with-output.html>`__ |br| |n203|                                                | PaddlePaddle pre-trained models to read industrial meter's value                                                                           | |n203-img1|                               |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `204-named-entity-recognition <notebooks/204-named-entity-recognition-with-output.html>`__ |br| |n204|                        | Perform named entity recognition on simple text.                                                                                           | |n204-img1|                               |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `205-vision-background-removal <notebooks/205-vision-background-removal-with-output.html>`__ |br| |n205|                      | Remove and replace the background in an image using salient object detection.                                                              | |n205-img1|                               |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `206-vision-paddlegan-anime <notebooks/206-vision-paddlegan-anime-with-output.html>`__ |br| |n206|                            | Turn an image into anime using a GAN.                                                                                                      | |n206-img1| → |n206-img2|                 |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `207-vision-paddlegan-superresolution <notebooks/207-vision-paddlegan-superresolution-with-output.html>`__ |br| |n207|        | Upscale small images with superresolution using a PaddleGAN model.                                                                         | |n207-img1| → |n207-img2|                 |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `212-onnx-style-transfer <notebooks/212-onnx-style-transfer-with-output.html>`__ |br| |n212|                                  | Transform images to five different styles with neural style transfer.                                                                      | |n212-img1| → |n212-img2|                 |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `214-vision-paddle-classification <notebooks/214-vision-paddle-classification-with-output.html>`__ |br| |n214|                | PaddlePaddle Image Classification with OpenVINO.                                                                                           |                                           |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `215-image-inpainting <notebooks/215-image-inpainting-with-output.html>`__                                                    | Fill missing pixels with image in-painting.                                                                                                | |n215-img1|                               |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `216-license-plate-recognition <notebooks/216-license-plate-recognition-with-output.html>`__                                  | Recognize Chinese license plates in traffic.                                                                                               | |n216-img1|                               |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `217-vision-deblur <notebooks/217-vision-deblur-with-output.html>`__ |br| |n217|                                              | Deblur Images with DeblurGAN-v2.                                                                                                           | |n217-img1|                               |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `219-knowledge-graphs-conve <notebooks/219-knowledge-graphs-conve-with-output.html>`__                                        | Optimize the knowledge graph embeddings model (ConvE) with OpenVINO                                                                        |                                           |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `220-yolov5-accuracy-check-and-quantization <notebooks/220-yolov5-accuracy-check-and-quantization-with-output.html>`__        | Quantize the Ultralytics YOLOv5 model and check accuracy using the OpenVINO POT API                                                        | |n220-img1|                               |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `221-machine-translation <notebooks/221-machine-translation-with-output.html>`__                                              | Real-time translation from English to German                                                                                               |                                           |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `222-vision-image-colorization <notebooks/222-vision-image-colorization-with-output.html>`__                                  | Use pre-trained models to colorize black & white images using OpenVINO                                                                     | |n222-img1|                               |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+
   | `223-gpt2-text-prediction <notebooks/223-gpt2-text-prediction-with-output.html>`__                                            | Use GPT-2 to perform text prediction on an input sequence                                                                                  | |n223-img1|                               |
   +-------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+


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 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
405-paddle-ocr-webcam
n405
OCR with a webcam or video file n405-img1

The following tutorials are guaranteed to provide a great experience with inference in OpenVINO:

Notebook   Preview
Vision-monodepth
n201
Monocular depth estimation with images and video. n201-img1
CT-scan-live-inference
n210
Show live inference on segmentation of CT-scan data. n210-img1
Object-detection-webcam
n401
Object detection with a webcam or video file. n401-img1
Pose-estimation-webcam
n402
Human pose estimation with a webcam or video file. n402-img1
Action-recognition-webcam
n403
Human action recognition with a webcam or video file. n403-img1

Note

If there are any issues while running the notebooks, refer to the Troubleshooting and FAQ sections in the Installation Guide or start a GitHub discussion.

contributors

Made with contributors-img.