Skip to content

Commit 2fe90da

Browse files
yatarkanryanloney
andauthored
Add notebook with TF2 Object Detection model conversion OOB with MO Python API (openvinotoolkit#1154)
* Add readme * Add notebook for TF2 OD conversion to OpenVINO * Update gitignore * Apply suggestions from code review Co-authored-by: Ryan Loney <ryanloney@gmail.com> * Add 120 notebook to main readme * Remove line breaks from pip install command * Add colab badge to notebook readme * Add binder and colab badges to main readme * Update wording in notebook readme * Format notebook * Change kernel spec in notebook * Fix quotes in pip install command * Remove TF version from notebook and readme * Rename notebook and directory * Add TF OD API description * Add model inputs and outputs description * Add next steps section * Rename 120 notebook * Rename 101 notebook --------- Co-authored-by: Ryan Loney <ryanloney@gmail.com>
1 parent 86ad53c commit 2fe90da

File tree

9 files changed

+650
-5
lines changed

9 files changed

+650
-5
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ dmypy.json
101101

102102
# Notebook temporal files
103103
notebooks/*/output/**
104+
notebooks/*/model/**
105+
notebooks/*/data/**
104106

105107
# cache directory
106108
notebooks/cache/*
107109

110+
# Local pip cache directories
111+
pipcache/
112+
pipcache_openvino/

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Tutorials that explain how to optimize and quantize models with OpenVINO tools.
8989

9090
| Notebook | Description |
9191
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |:----------------------------------------------------------------------------------------------------------------------------|
92-
| [101-tensorflow-to-openvino](notebooks/101-tensorflow-to-openvino/)<br>[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=notebooks%2F101-tensorflow-to-openvino%2F101-tensorflow-to-openvino.ipynb) | Convert TensorFlow models to OpenVINO IR |
92+
| [101-tensorflow-classification-to-openvino](notebooks/101-tensorflow-classification-to-openvino/)<br>[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=notebooks%2F101-tensorflow-classification-to-openvino%2F101-tensorflow-classification-to-openvino.ipynb) | Convert TensorFlow models to OpenVINO IR |
9393
| [102-pytorch-onnx-to-openvino](notebooks/102-pytorch-onnx-to-openvino/) | Convert PyTorch models to OpenVINO IR |
9494
| [103-paddle-to-openvino](notebooks/103-paddle-to-openvino/)<br>[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=notebooks%2F103-paddle-to-openvino%2F103-paddle-to-openvino-classification.ipynb) | Convert PaddlePaddle models to OpenVINO IR |
9595
| [104-model-tools](notebooks/104-model-tools/)<br>[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=notebooks%2F104-model-tools%2F104-model-tools.ipynb) | Download, convert and benchmark models from Open Model Zoo |
@@ -107,6 +107,7 @@ Tutorials that explain how to optimize and quantize models with OpenVINO tools.
107107
| [117-model-server](notebooks/117-model-server/)| Introduction to model serving with OpenVINO™ Model Server (OVMS) |
108108
| [118-optimize-preprocessing](notebooks/118-optimize-preprocessing/)| Improve performance of image preprocessing step |
109109
| [119-tflite-to-openvino](notebooks/119-tflite-to-openvino/) | Convert TensorFlow Lite models to OpenVINO IR |
110+
| [120-tensorflow-object-detection-to-openvino](notebooks/120-tensorflow-object-detection-to-openvino/)<br>[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=notebooks%2F120-tensorflow-object-detection-to-openvino%2F120-tensorflow-object-detection-to-openvino.ipynb)<br>[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/120-tensorflow-object-detection-to-openvino/120-tensorflow-object-detection-to-openvino.ipynb) | Convert TensorFlow Object Detection models to OpenVINO IR |
110111

111112
<div id='-model-demos'/>
112113

README_cn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Jupyter notebooks 分为四个大类,选择一个跟你需求相关的开始
8181

8282
| Notebook | Description |
8383
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------- |
84-
| [101-tensorflow-to-openvino](notebooks/101-tensorflow-to-openvino/)<br>[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=notebooks%2F101-tensorflow-to-openvino%2F101-tensorflow-to-openvino.ipynb) | 转换 TensorFlow模型为OpenVINO IR |
84+
| [101-tensorflow-classification-to-openvino](notebooks/101-tensorflow-classification-to-openvino/)<br>[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=notebooks%2F101-tensorflow-classification-to-openvino%2F101-tensorflow-classification-to-openvino.ipynb) | 转换 TensorFlow模型为OpenVINO IR |
8585
| [102-pytorch-onnx-to-openvino](notebooks/102-pytorch-onnx-to-openvino/) | 转换PyTorch模型为OpenVINO IR |
8686
| [103-paddle-to-openvino](notebooks/103-paddle-to-openvino/)<br>[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=notebooks%2F103-paddle-to-openvino%2F103-paddle-to-openvino-classification.ipynb) | 转换PaddlePaddle模型为OpenVINO IR |
8787
| [104-model-tools](notebooks/104-model-tools/)<br>[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=notebooks%2F104-model-tools%2F104-model-tools.ipynb) | 从Open Model Zoo进行模型下载,转换以及进行基线测试 |

notebooks/001-hello-world/001-hello-world.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"\n",
1111
"This basic introduction to OpenVINO™ shows how to do inference with an image classification model.\n",
1212
"\n",
13-
"A pre-trained [MobileNetV3 model](https://docs.openvino.ai/2023.0/omz_models_model_mobilenet_v3_small_1_0_224_tf.html) from [Open Model Zoo](https://github.com/openvinotoolkit/open_model_zoo/) is used in this tutorial. For more information about how OpenVINO IR models are created, refer to the [TensorFlow to OpenVINO](../101-tensorflow-to-openvino/101-tensorflow-to-openvino.ipynb) tutorial."
13+
"A pre-trained [MobileNetV3 model](https://docs.openvino.ai/2023.0/omz_models_model_mobilenet_v3_small_1_0_224_tf.html) from [Open Model Zoo](https://github.com/openvinotoolkit/open_model_zoo/) is used in this tutorial. For more information about how OpenVINO IR models are created, refer to the [TensorFlow to OpenVINO](../101-tensorflow-classification-to-openvino/101-tensorflow-classification-to-openvino.ipynb) tutorial."
1414
]
1515
},
1616
{

notebooks/002-openvino-api/002-openvino-api.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"An OpenVINO IR (Intermediate Representation) model consists of an `.xml` file, containing information about network topology, and a `.bin` file, containing the weights and biases binary data. Models in OpenVINO IR format are obtained by using Model Optimizer tool. The `read_model()` function expects the `.bin` weights file to have the same filename and be located in the same directory as the `.xml` file: `model_weights_file == Path(model_xml).with_suffix(\".bin\")`. If this is the case, specifying the weights file is optional. If the weights file has a different filename, it can be specified using the `weights` parameter in `read_model()`.\n",
116116
"\n",
117117
"The OpenVINO [Model Optimizer](https://docs.openvino.ai/2023.0/openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html#doxid-openvino-docs-m-o-d-g-deep-learning-model-optimizer-dev-guide) tool is used to convert models to OpenVINO IR format. Model Optimizer reads the original model and creates an OpenVINO IR model (.xml and .bin files) so inference can be performed without delays due to format conversion. Optionally, Model Optimizer can adjust the model to be more suitable for inference, for example, by alternating input shapes, embedding preprocessing and cutting training parts off.\n",
118-
"For information on how to convert your existing TensorFlow, PyTorch or ONNX model to OpenVINO IR format with Model Optimizer, refer to the [tensorflow-to-openvino](../101-tensorflow-to-openvino/101-tensorflow-to-openvino.ipynb) and [pytorch-onnx-to-openvino](../102-pytorch-onnx-to-openvino/102-pytorch-onnx-to-openvino.ipynb) notebooks. "
118+
"For information on how to convert your existing TensorFlow, PyTorch or ONNX model to OpenVINO IR format with Model Optimizer, refer to the [tensorflow-to-openvino](../101-tensorflow-classification-to-openvino/101-tensorflow-classification-to-openvino.ipynb) and [pytorch-onnx-to-openvino](../102-pytorch-onnx-to-openvino/102-pytorch-onnx-to-openvino.ipynb) notebooks. "
119119
]
120120
},
121121
{

notebooks/101-tensorflow-to-openvino/README.md notebooks/101-tensorflow-classification-to-openvino/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TensorFlow to OpenVINO™ Model Conversion Tutorial
22

3-
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=notebooks%2F101-tensorflow-to-openvino%2F101-tensorflow-to-openvino.ipynb)
3+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=notebooks%2F101-tensorflow-classification-to-openvino%2F101-tensorflow-classification-to-openvino.ipynb)
44

55
<img src="https://user-images.githubusercontent.com/36741649/127170593-86976dc3-e5e4-40be-b0a6-206379cd7df5.jpg" width=300>
66

0 commit comments

Comments
 (0)