Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 99 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,99 @@
# openvino_notebooks

## List of Notebooks
All Python notebooks are available in the `notebooks` directory. Detailed descriptions below:

### hello-world:
* `001-hello-world`
* `002-hello-classification`
* `003-hello-object-detection`
* `004-hello-segmentation`
* `005-hello-APIs`

### tool-usage:
* `100-tensorflow-to-openvino`
* `101-pytorch-onnx-to-openvino`
* `102-quantization`

### demos:
* `200-vision-super-resolution`
* `201-vision-monocular-depth-estimation`
* `202-vision-object-detection-zoo`
* `203-vision-worker-safety`
* `204-vision-hand-pose-estimation`
* `205-language-bert-question-answering`
* `206-audio-speech-to-text`
* `207-vision-language-OCR-pipeline`
* `208-audio-sound-classification`
* `209-vision-surgery-segmentation`
# 📚 OpenVINO Notebooks

> **NOTE**: The notebooks are currently in **beta**. We plan to publish a stable release this summer. You can submit [issues](https://github.com/openvinotoolkit/openvino_notebooks/issues) on GitHub and join our [developer Discord\*](https://discord.com/invite/pWGcWpyx7x) to get updates. We look forward to hearing from you!

A collection of ready-to-run Python\* notebooks for learning and experimenting with OpenVINO developer tools. The notebooks are meant to provide an introduction to OpenVINO basics and teach developers how to leverage our APIs for optimized deep learning inference in their applications.

## Getting Started

The notebooks are designed to run almost anywhere — on your laptop, a cloud VM, or a Docker container. Here's what you need to get started:

- CPU (64-bit)
- Windows\*, Linux\* or macOS\*
- Python\*

Before you proceed to the Installation Guide, please check the detailed System Requirements below.

## System Requirements

> **NOTE: Python 3.8 with Linux is not supported yet.** If you wish to run the notebooks on Ubuntu 20.04, please see our [guide](wiki_url) for installing Python 3.7 on Ubuntu 20.04.

The table below lists the supported operating systems and Python versions required to run the OpenVINO notebooks.

| Supported Operating System | [Python\* Version (64-bit)](https://www.python.org/) |
| :--------------------------------------------------------- | :--------------------------------------------------- |
| Ubuntu\* 18.04 LTS, 64-bit | 3.6, 3.7 |
| Ubuntu\* 20.04 LTS, 64-bit | 3.6, 3.7 |
| Red Hat* Enterprise Linux* 8.2, 64-bit | 3.6, 3.7 |
| CentOS\* 7.4, 64-bit | 3.6, 3.7 |
| macOS\* 10.15.x versions | 3.6, 3.7, 3.8 |
| Windows 10\*, 64-bit Pro, Enterprise or Education editions | 3.6, 3.7, 3.8 |
| Windows Server\* 2016 or higher | 3.6, 3.7, 3.8 |

## Installation Guide

### Step 1: Clone the Repository

```bash
git clone https://github.com/openvinotoolkit/openvino_notebooks.git
cd openvino_notebooks
```

### Step 2: Create a Virtual Environment

```bash
# For Linux and macOS you may need to use python3 instead of python
python -m venv openvino_env
```

### Step 3: Activate the Environment

#### For Linux and macOS:

```bash
source openvino_env/bin/activate
```

#### For Windows:

```bash
openvino_env\Scripts\activate
```

### Step 4: Install the Packages

```bash
# Install pip version 20.1.1 to ensure compatibility with all dependencies
python -m pip install --upgrade pip==20.1.1
pip install jupyterlab openvino-dev
```

### Step 5: Install the virtualenv Kernel in Jupyter

```bash
python -m ipykernel install --user --name openvino_env
```

### Step 6: Launch the Notebooks!

```bash
# To launch a single notebook
jupyter notebook <notebook_filename>

# To launch all notebooks in Jupyter Lab
jupyter lab
```

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

## Troubleshooting

- On Ubuntu, if you see the error **"libpython3.7m.so.1.0: cannot open shared object file: No such object or directory"** please install the required package with `sudo apt install libpython3.7-dev`

- If you get an `ImportError`, doublecheck that you installed the kernel in Step 4. If necessary, choose the openvino*env kernel from the \_Kernel->Change Kernel* menu)

- On Linux and macOS you may need to type `python3` instead of `python` when creating your virtual environment

- You may also need to install [pip](https://pip.pypa.io/en/stable/installing/) and/or python-venv (depending on your Linux distribution)

- On Windows, if you have installed multiple versions of Python, use `py -3.7` when creating your virtual environment to specify a supported version (in this case 3.7)
18 changes: 18 additions & 0 deletions tools/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
Copyright (C) 2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import cv2

def put_highlighted_text(frame, message, position, font_face, font_scale, color, thickness):
cv2.putText(frame, message, position, font_face, font_scale, (255, 255, 255), thickness + 1) # white border
cv2.putText(frame, message, position, font_face, font_scale, color, thickness)