Giter Club home page Giter Club logo

openvino_notebooks's Introduction

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.

🚀 Checkout interactive GitHub pages application for navigation between OpenVINO™ Notebooks content: OpenVINO™ Notebooks at GitHub Pages

notebooks-selector-preview

List of all notebooks is available in index file.

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

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

Explore Jupyter notebooks using this page, 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 2024.1 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 release version of OpenVINO, please checkout the 2024.0 branch. If you wish to use the previous Long Term Support (LTS) version of OpenVINO check out the 2023.3 branch.

If you need help, please start a GitHub Discussion.

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

Notebooks with binder logo and colab logo buttons can be run without installing anything. Binder and Google Colab are free online services 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.8 - 3.11
Ubuntu 22.04 LTS, 64-bit 3.8 - 3.11
Red Hat Enterprise Linux 8, 64-bit 3.8 - 3.11
CentOS 7, 64-bit 3.8 - 3.11
macOS 10.15.x versions or higher 3.8 - 3.11
Windows 10, 64-bit Pro, Enterprise or Education editions 3.8 - 3.11
Windows Server 2016 or higher 3.8 - 3.11

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

💻 Run the Notebooks

To Launch a Single Notebook

If you wish to launch only one notebook, like the Monodepth notebook, run the command below (from the repository root directory):

jupyter lab notebooks/vision-monodepth/vision-monodepth.ipynb

To Launch all Notebooks

Launch Jupyter Lab with index README.md file opened for easier navigation between notebooks directories and files. Run the following command from the repository root directory:

jupyter lab notebooks/README.md

Alternatively, 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

  1. 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.

  1. 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.

  1. 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, double-check 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.

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

🧑‍💻 Contributors

Made with contrib.rocks.

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

❓ FAQ


* Other names and brands may be claimed as the property of others.

openvino_notebooks's People

Contributors

adrianboguszewski avatar akashchi avatar aleksandr-mokrov avatar andrei-kochin avatar anishaudayakumar avatar apaniukov avatar as-suvorov avatar dependabot[bot] avatar dimapastushenkov avatar eaidova avatar github-actions[bot] avatar helena-intel avatar igor-davidyuk avatar itrushkin avatar l-bat avatar ljaljushkin avatar nikita-savelyevv avatar openvino-dev-contest avatar paularamo avatar pavel-esir avatar rajatkrishna avatar raymondlo84 avatar roszczyk avatar ryanloney avatar sbalandi avatar sgolebiewski-intel avatar vuiseng9 avatar xaenalt avatar yatarkan avatar zhuo-yoyowz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openvino_notebooks's Issues

POT Slow Performance @ Training Step

I think somehow the training performance is almost 1/2 when we run the training step through the POT notebooks. Not sure but here are my outputs.

scrnli_7_2_2021_3-03-43 PM
scrnli_7_2_2021_3-03-41 PM

Ubuntu 20.04 + Python 3.8.5 install error?

... What is editdistance for exactly? It seems I cannot install due to this error?

  Running setup.py install for editdistance ... error
    ERROR: Command errored out with exit status 1:
     command: /home/raymond/Documents/openvino_notebooks/openvino_env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-c0g2m3p6/editdistance/setup.py'"'"'; __file__='"'"'/tmp/pip-install-c0g2m3p6/editdistance/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-l8n7trt1/install-record.txt --single-version-externally-managed --compile --install-headers /home/raymond/Documents/openvino_notebooks/openvino_env/include/site/python3.8/editdistance
         cwd: /tmp/pip-install-c0g2m3p6/editdistance/
    Complete output (16 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/editdistance
    copying editdistance/__init__.py -> build/lib.linux-x86_64-3.8/editdistance
    copying editdistance/_editdistance.h -> build/lib.linux-x86_64-3.8/editdistance
    copying editdistance/def.h -> build/lib.linux-x86_64-3.8/editdistance
    running build_ext
    building 'editdistance.bycython' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/editdistance
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./editdistance -I/home/raymond/Documents/openvino_notebooks/openvino_env/include -I/usr/include/python3.8 -c editdistance/_editdistance.cpp -o build/temp.linux-x86_64-3.8/editdistance/_editdistance.o
    unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/raymond/Documents/openvino_notebooks/openvino_env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-c0g2m3p6/editdistance/setup.py'"'"'; __file__='"'"'/tmp/pip-install-c0g2m3p6/editdistance/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-l8n7trt1/install-record.txt --single-version-externally-managed --compile --install-headers /home/raymond/Documents/openvino_notebooks/openvino_env/include/site/python3.8/editdistance Check the logs for full command output.

Cannot export pytorch to onnx

In 102-pytorch-onnx-to-openvino and fourth code cell:
RuntimeError: Exporting the operator relu6 to ONNX opset version 11 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub.

Tried with python 3.9.6 and pytorch 1.9.0

GPU faster than MULTI:CPU,GPU in 104-model-tools notebook

After running a few times, and shutting down the kernel to start fresh on the MULTI benchmark, I keep getting better or equal performance with GPU than MULTI:CPU,GPU when running resnet-50-pytorch and mobilenet-v2-pytorch models in the 104 notebook. I tried adjusting the duration of the benchmark, but it does not change the result. However, googlenet-v3 (inceptionv3) MULTI is slightly faster. Anything I should try?

CPU: 11th Gen Intel(R) Core(TM) i7-1185G7E @ 2.80GHz
GPU: Intel(R) Gen12LP HD Graphics (iGPU)

mobilenetv2:
image

resnet-50:
image

inceptionv3:
image

105 Notebook Error

When I run this on Windows, I got this error.

'unzip' is not recognized as an internal or external command,
operable program or batch file.

I would recommend use the Python library and so we don't depend on the user's environments.
(e.g., import zipfile)

@ryanloney - what's your setup on Windows?

Rename to tutorials

While it is not so popular outside can we rename this repo to "tutorials". I think openvio_ prefix is not needed because it is already in the group that is named openvinotoolkit.
The official name can be changed to OpenVINO™ Tutorials.

TensorFlowVersion

When I run the command pip install -r requirements.txt
I get -->
ERROR: Could not find a version that satisfies the requirement tensorflow<2.4,>=2.2 (from -r requirements.txt (line 20)) (from versions: 2.5.0rc0, 2.5.0rc1, 2.5.0rc2)
ERROR: No matching distribution found for tensorflow<2.4,>=2.2 (from -r requirements.txt (line 20))

302 README formatting issue

Looks like the markdown needs to be updated. Creating an issue so we remember to update it. We should also follow the README guidelines in contribution guide.

image

No module named 'vedastr.utils' in running notebook 208

When running cell "Download models and convert public model" in notebook 208, there seems to be some download model problems, and also package import problems. Not sure if it's the connection problems because I'm in China,.

image

Support for Colab

I'm struggling to run the notebooks in both binder and local. It would be really nice if there were Colab examples of those notebooks as well...

from openvino.inference_engine import IECore error.

thanks for that notebooks.
I am in Ubuntu 20.04 and have the error with IECore import.
Do all steps in the github page. Check installation - ok.
(openvino_env) vlad@vlad-system-product-name:~/Vlad_Ai/Intel/openvino_notebooks$ python3 check_install.py

System information:
Python executable: /home/vlad/Vlad_Ai/Intel/openvino_notebooks/openvino_env/bin/python3
OpenVINO environment activated: OK
Python version: 3.7 OK
OpenVINO development tools installed: OK
Numpy version: 1.18.5 OK

when I start jupyter lab notebooks and execute import


ImportError Traceback (most recent call last)
in
----> 1 from openvino.inference_engine import IECore

~/Vlad_Ai/Intel/openvino_notebooks/openvino_env/lib/python3.7/site-packages/openvino/inference_engine/init.py in
32 os.environ["PATH"] = os.path.abspath(openvino_dlls) + ";" + os.environ["PATH"]
33
---> 34 from .ie_api import *
35 all = ['IENetwork', "TensorDesc", "IECore", "Blob", "PreProcessInfo", "get_version"]
36 version = get_version()

ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory

Do I miss something?
Also in jupyterlab:
import cv2
print(cv2.version)
4.5.1
when is it correct? when normally we use OpenCv from OpenVino - it have to be 4.5.1 - openvino something

Unstable Neural Computer Stick 2?

Somehow the NCS2 will automatically reset and after I ran the IE. I'm running this on Mac OSX. :\

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-40-b5adb56a80e7> in <module>
----> 1 result = exec_net.infer(inputs={input_key: input_image})[output_key]
      2 result_index = np.argmax(result)

ie_api.pyx in openvino.inference_engine.ie_api.ExecutableNetwork.infer()

ie_api.pyx in openvino.inference_engine.ie_api.InferRequest.infer()

ie_api.pyx in openvino.inference_engine.ie_api.InferRequest.infer()

RuntimeError: Failed to queue inference: NC_ERROR
[I 2021-05-28 10:57:56.912 ServerApp] Saving file at /001-hello-world/001-hello-world.ipynb
E: [ncAPI] [    740904] [] checkGraphMonitorResponse:1937	Graph monitor request returned error -1
E: [ncAPI] [    740905] [] checkGraphMonitorResponse:1937	Graph monitor request returned error -1
E: [ncAPI] [    740905] [] checkGraphMonitorResponse:1937	Graph monitor request returned error -1
E: [global] [    741404] [WatchdogThread] getLinkByStreamId:290	Condition failed: *out_link == NULL
E: [global] [    741404] [WatchdogThread] XLinkWriteData:126	Condition failed: (getLinkByStreamId(streamId, &link))
E: [watchdog] [    741404] [WatchdogThread] sendPingMessage:128	Failed send ping message: X_LINK_ERROR
E: [global] [    741853] [] getLinkByStreamId:290	Condition failed: *out_link == NULL
E: [global] [    741853] [] XLinkWriteData:126	Condition failed: (getLinkByStreamId(streamId, &link))
E: [global] [    742405] [WatchdogThread] getLinkByStreamId:290	Condition failed: *out_link == NULL
E: [global] [    742405] [WatchdogThread] XLinkWriteData:126	Condition failed: (getLinkByStreamId(streamId, &link))
E: [watchdog] [    742405] [WatchdogThread] sendPingMessage:128	Failed send ping message: X_LINK_ERROR
E: [global] [    743408] [WatchdogThread] getLinkByStreamId:290	Condition failed: *out_link == NULL
E: [global] [    743408] [WatchdogThread] XLinkWriteData:126	Condition failed: (getLinkByStreamId(streamId, &link))
E: [watchdog] [    743408] [WatchdogThread] sendPingMessage:128	Failed send ping message: X_LINK_ERROR
E: [global] [    744410] [WatchdogThread] getLinkByStreamId:290	Condition failed: *out_link == NULL
E: [global] [    744410] [WatchdogThread] XLinkWriteData:126	Condition failed: (getLinkByStreamId(streamId, &link))
E: [watchdog] [    744410] [WatchdogThread] sendPingMessage:128	Failed send ping message: X_LINK_ERROR
E: [global] [    745412] [WatchdogThread] getLinkByStreamId:290	Condition failed: *out_link == NULL
E: [global] [    745412] [WatchdogThread] XLinkWriteData:126	Condition failed: (getLinkByStreamId(streamId, &link))
E: [watchdog] [    745412] [WatchdogThread] sendPingMessage:128	Failed send ping message: X_LINK_ERROR
E: [global] [    746411] [WatchdogThread] getLinkByStreamId:290	Condition failed: *out_link == NULL
E: [global] [    746411] [WatchdogThread] XLinkWriteData:126	Condition failed: (getLinkByStreamId(streamId, &link))
E: [watchdog] [    746411] [WatchdogThread] sendPingMessage:128	Failed send ping message: X_LINK_ERROR
E: [global] [    747413] [WatchdogThread] getLinkByStreamId:290	Condition failed: *out_link == NULL
E: [global] [    747413] [WatchdogThread] XLinkWriteData:126	Condition failed: (getLinkByStreamId(streamId, &link))
E: [watchdog] [    747413] [WatchdogThread] sendPingMessage:128	Failed send ping message: X_LINK_ERROR
E: [global] [    748415] [WatchdogThread] getLinkByStreamId:290	Condition failed: *out_link == NULL
E: [global] [    748415] [WatchdogThread] XLinkWriteData:126	Condition failed: (getLinkByStreamId(streamId, &link))
E: [watchdog] [    748415] [WatchdogThread] sendPingMessage:128	Failed send ping message: X_LINK_ERROR
E: [global] [    749418] [WatchdogThread] getLinkByStreamId:290	Condition failed: *out_link == NULL
E: [global] [    749418] [WatchdogThread] XLinkWriteData:126	Condition failed: (getLinkByStreamId(streamId, &link))
E: [watchdog] [    749418] [WatchdogThread] sendPingMessage:128	Failed send ping message: X_LINK_ERROR
E: [global] [    750422] [WatchdogThread] getLinkByStreamId:290	Condition failed: *out_link == NULL
E: [global] [    750422] [WatchdogThread] XLinkWriteData:126	Condition failed: (getLinkByStreamId(streamId, &link))
E: [watchdog] [    750422] [WatchdogThread] sendPingMessage:128	Failed send ping message: X_LINK_ERROR
E: [global] [    751425] [WatchdogThread] getLinkByStreamId:290	Condition failed: *out_link == NULL
E: [global] [    751425] [WatchdogThread] XLinkWriteData:126	Condition failed: (getLinkByStreamId(streamId, &link))
E: [watchdog] [    751425] [WatchdogThread] sendPingMessage:128	Failed send ping message: X_LINK_ERROR
E: [global] [    752428] [WatchdogThread] getLinkByStreamId:290	Condition failed: *out_link == NULL
E: [global] [    752428] [WatchdogThread] XLinkWriteData:126	Condition failed: (getLinkByStreamId(streamId, &link))
E: [watchdog] [    752428] [WatchdogThread] sendPingMessage:128	Failed send ping message: X_LINK_ERROR
E: [watchdog] [    752428] [WatchdogThread] watchdogRoutine:278	[0x7fc552b98f50] device, not respond, removing from watchdog

Changing JUPYTER_SERVER_ROOT makes data inaccessible to users of other notebooks

Describe the bug
The OpenVINO image changes JUPYTER_SERVER_ROOT to point to the set of example notebooks as its root. However, if users are attempting to migrate work over onto OpenVINO, this effectively locks them out of the data on their volume in an unintuitive way.

Expected behavior
JUPYTER_SERVER_ROOT should point to the regular location

Screenshots
Screenshot of a standard setup:
image

Screenshot of the change in the OpenVINO image, note that the work the user may have had at /opt/app-root/src is now no longer accessible:
image

Installation instructions (Please mark the checkbox)
[X] I followed the installation guide at https://github.com/openvinotoolkit/openvino_notebooks#-installation-guide to install the notebooks.

Additional context

Progress bar can exceed Jupyter's data rate limit

When downloading a large file with download_file (from notebook_utils), depending on system and download speed, Jupyter may show errors about the data rate limit being exceeded. This fails the notebook in the CI, and is also visible in the notebook when running manually.

Setting the progress bar to only display every N blocks helps - I do not see the issue anymore on Linux and Windows when the progress bar is updated every 20 blocks - but on macOS even with every 50 blocks I still saw the issue. We should make the progress bar more robust.

image

When this is fixed, the progress bar should be added back to the 105 notebook.

Git pull causes pod to crash loop on new push to main

Describe the bug
In cases where the user has modified or done anything to the default notebooks, a new commit to main on github can cause pods to crash loop

Expected behavior
User modifications should not impact functionality of the notebook image

Screenshots
image

Installation instructions (Please mark the checkbox)
[X] I followed the installation guide at https://github.com/openvinotoolkit/openvino_notebooks#-installation-guide to install the notebooks.

Additional context
It stems from this addition

GIT_SSL_NO_VERIFY=true git pull --ff-only

The point of the preload environment variable is to pre-load content for demos/labs/etc, however adding the git pull causes a problem when the user attempts to do any modifications.

To reproduce:

  1. Checkout an older version of the repo, eg: git checkout HEAD^
  2. Replace main branch with it, so that main now points to an older commit. Eg: git branch -D main; git switch -c main (this simulates the effect of a new commit being pushed to main upstream)
  3. Make any change to the code, editing any line in any notebook
  4. Restart the container
    The pod will now crash loop, and will continue to do so until the user either manually intervenes outside of the OpenVINO image or deletes their PVC

I'd propose a solution would be either to version the selected notebooks into the image, or use the preload variable as intended. Additionally, if it's absolutely necessary to have this functionality, the notebooks could get cloned/updated in a pristine condition somewhere else in the image, and then copied into the user's volume to avoid this type of conflict

I can draft a PR to address

301 Tensorflow POT Wrong Path = rerunning training

the model_xml path should be model/flower/flower_ir.xml not model/flower_ir.xml based the previous notebook

from pathlib import Path

import tensorflow as tf

model_xml = Path("model/flower_ir.xml")
dataset_url = (
    "https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz"
)

Security Issue with Windows 11 - PowerShell

It looks like Windows 11 added another layer of security and enabling the virtual environment is non-trivial with the PowerShell (which is the new default 'Terminal')...


PS C:\Users\raymo\Documents> python -m venv openvino_env
PS C:\Users\raymo\Documents> openvino_env\Scripts\activate
openvino_env\Scripts\activate : File C:\Users\raymo\Documents\openvino_env\Scripts\Activate.ps1 cannot be loaded
because running scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ openvino_env\Scripts\activate
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Add PaddlePaddle Image Classification notebook

Not sure what model is best, but there are some good options here: https://github.com/PaddlePaddle/PaddleClas

I tried to find a class for Intel logo in logo classifier and in AliProduct dataset. Worth a try since we could use an image of Intel logo or a Core i5 processor and see if the classification works.

Product Recognition: https://github.com/PaddlePaddle/PaddleClas/blob/release/2.2/docs/en/application/product_recognition_en.md

Logo Recognition:
https://github.com/PaddlePaddle/PaddleClas/blob/release/2.2/docs/en/application/logo_recognition_en.md

Progress bar could be useful in omz_downloader

There is no progress bar during model downloading in 208-optical-character-recognition (third code cell). Currently, there is no information when downloading ends.

Progress bar could be useful when someone (like me) has not so fast internet connection. It's even better to print into console every 10% than nothing.

check_install.py reports error on OpenShift

Describe the bug
check_install.py reports error on OpenShift

Expected behavior
No errors reported

Screenshots

[1000970000@jupyterhub-nb-xaenalt ~]$ python ./check_install.py 
System information:
Python executable: /opt/app-root/bin/python
Pip version: 21.2.4
OpenVINO environment activated: NOT OK
Jupyter kernel installed for openvino_env: NOT OK
Python version: 3.8 OK
OpenVINO pip package installed: OK
OpenVINO import succeeds: OK
OpenVINO development tools installed: OK
OpenVINO not installed globally: OK
No broken requirements: OK

It appears that you are not running Python in an `openvino_env` 
environment. It is possible use the notebooks in a different 
environment, but if you run into trouble, please follow the instructions 
in the README to install and activate the `openvino_env` environment.

The Python version in openvino_env does not match the openvino_env Jupyter kernel. This may not be an issue. If you experience issues, please follow the instructions in the README to reinstall the kernel.

The README.md file is located in the openvino_notebooks directory 
and at https://github.com/openvinotoolkit/openvino_notebooks

Installation instructions (Please mark the checkbox)
[ ] I followed the installation guide at https://github.com/openvinotoolkit/openvino_notebooks#-installation-guide to install the notebooks.

** Environment information **
See above

Additional context
This is occurring on my OpenShift cluster, I am going to attempt to rebuild with latest code

A good notebook exercise

I have a good notebook exercise to demonstrate custom layers as well as eliminating C extensions even for CPU device. Shall that be added here as a new notebook, please?

As per here:
https://github.com/nscalo/nd131-people-counter-project-1/blob/main/student-repositories/nd131-openvino-people-counter-newui/custom_layers/arcface/cl_pnorm/user_mo_extensions/middle/PNormReplacement.py

I was able to eliminate custom layers extensions using just Python code in MO (Model Optimizer) using combinations of layers.

My suggestion is shall a demonstration be done to show its use cases in terms of CL, custom layers?

Jupyter Git for Open Data Hub / OpenShift Data Science

We have been asked to include jupyterlab-git in the Dockerfile for the notebooks. This is commonly used in ODH/ODS. I don't know if we need it for all users, but can we add it to the Dockerfile? Is it as simple as adding jupyterlab-git to requirements?

https://github.com/jupyterlab/jupyterlab-git

Since we are using JupyterLab 3.X, it looks like we do not need to run "jupyter lab build"

Let me know what you think. This can wait a few weeks, but want to make sure it is technically feasible.

Add Object Detection notebook(s)

Placeholder for Object Detection notebook with OMZ models.

We may need to rethink this and show how to convert models for object detection, and not just download from OMZ. There are a few public models in OMZ that we could show how to convert with Model Optimizer. One idea is making a 20X-object-detection directory with 20X-object-detection-yolv3.ipynb and 20X-object-detection-xyz_model.ipynb.

...and more

Cannot benchmark app

In 104-model-tools and 105-language-quantize-bert both benchmark_model and benchmark_app shows following issue:
ModuleNotFoundError: No module named 'openvino.tools'

I've installed openvino-dev==2021.4.0

Error '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed' when downloading a MRPC dataset in a 105 notebook if running behind a proxy

Hello,
In 105 notebook, cell with function format_mrpc(DATA_DIR, "") causes an error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed if a proxy is used. If the proxy is disabled, then everything works without errors.

Cell output with error:

Processing MRPC...
Local MRPC data not specified, downloading data from https://dl.fbaipublicfiles.com/senteval/senteval_data/msr_paraphrase_train.txt
---------------------------------------------------------------------------
SSLError                                  Traceback (most recent call last)
/usr/lib/python3.6/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
   1324                 h.request(req.get_method(), req.selector, req.data, headers,
-> 1325                           encode_chunked=req.has_header('Transfer-encoding'))
   1326             except OSError as err: # timeout error

/usr/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
   1280         """Send a complete request to the server."""
-> 1281         self._send_request(method, url, body, headers, encode_chunked)
   1282 

/usr/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
   1326             body = _encode(body, 'body')
-> 1327         self.endheaders(body, encode_chunked=encode_chunked)
   1328 

/usr/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
   1275             raise CannotSendHeader()
-> 1276         self._send_output(message_body, encode_chunked=encode_chunked)
   1277 

/usr/lib/python3.6/http/client.py in _send_output(self, message_body, encode_chunked)
   1041         del self._buffer[:]
-> 1042         self.send(msg)
   1043 

/usr/lib/python3.6/http/client.py in send(self, data)
    979             if self.auto_open:
--> 980                 self.connect()
    981             else:

/usr/lib/python3.6/http/client.py in connect(self)
   1441             self.sock = self._context.wrap_socket(self.sock,
-> 1442                                                   server_hostname=server_hostname)
   1443             if not self._context.check_hostname and self._check_hostname:

/usr/lib/python3.6/ssl.py in wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname, session)
    406                          server_hostname=server_hostname,
--> 407                          _context=self, _session=session)
    408 

/usr/lib/python3.6/ssl.py in __init__(self, sock, keyfile, certfile, server_side, cert_reqs, ssl_version, ca_certs, do_handshake_on_connect, family, type, proto, fileno, suppress_ragged_eofs, npn_protocols, ciphers, server_hostname, _context, _session)
    816                         raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets")
--> 817                     self.do_handshake()
    818 

/usr/lib/python3.6/ssl.py in do_handshake(self, block)
   1076                 self.settimeout(None)
-> 1077             self._sslobj.do_handshake()
   1078         finally:

/usr/lib/python3.6/ssl.py in do_handshake(self)
    688         """Start the SSL/TLS handshake."""
--> 689         self._sslobj.do_handshake()
    690         if self.context.check_hostname:

SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)

During handling of the above exception, another exception occurred:

URLError                                  Traceback (most recent call last)
<ipython-input-7-ef0a62341f4d> in <module>
      2 
      3 os.makedirs(DATA_DIR, exist_ok=True)
----> 4 format_mrpc(DATA_DIR, "")

~/projects/openvino_notebooks/notebooks/105-language-quantize-bert/download_glue_data.py in format_mrpc(data_dir, path_to_data)
     71     assert os.path.isfile(mrpc_train_file), "Train data not found at %s" % mrpc_train_file
     72     assert os.path.isfile(mrpc_test_file), "Test data not found at %s" % mrpc_test_file
---> 73     urllib.request.urlretrieve(TASK2PATH["MRPC"], os.path.join(mrpc_dir, "dev_ids.tsv"))
     74 
     75     dev_ids = []

/usr/lib/python3.6/urllib/request.py in urlretrieve(url, filename, reporthook, data)
    246     url_type, path = splittype(url)
    247 
--> 248     with contextlib.closing(urlopen(url, data)) as fp:
    249         headers = fp.info()
    250 

/usr/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
    221     else:
    222         opener = _opener
--> 223     return opener.open(url, data, timeout)
    224 
    225 def install_opener(opener):

/usr/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout)
    524             req = meth(req)
    525 
--> 526         response = self._open(req, data)
    527 
    528         # post-process response

/usr/lib/python3.6/urllib/request.py in _open(self, req, data)
    542         protocol = req.type
    543         result = self._call_chain(self.handle_open, protocol, protocol +
--> 544                                   '_open', req)
    545         if result:
    546             return result

/usr/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
    502         for handler in handlers:
    503             func = getattr(handler, meth_name)
--> 504             result = func(*args)
    505             if result is not None:
    506                 return result

/usr/lib/python3.6/urllib/request.py in https_open(self, req)
   1366         def https_open(self, req):
   1367             return self.do_open(http.client.HTTPSConnection, req,
-> 1368                 context=self._context, check_hostname=self._check_hostname)
   1369 
   1370         https_request = AbstractHTTPHandler.do_request_

/usr/lib/python3.6/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
   1325                           encode_chunked=req.has_header('Transfer-encoding'))
   1326             except OSError as err: # timeout error
-> 1327                 raise URLError(err)
   1328             r = h.getresponse()
   1329         except:

URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)>

Error @ PaddleGAN pip install after Tensorflow 2.5.0 added

The "pip install" now returned this error/warning. Is that normal?

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow 2.5.0 requires gast==0.4.0, but you have gast 0.3.3 which is incompatible.

Flower Training Notebooks Error

I got this error when I run the training notebooks and somehow this line is returning error. I'm on Windows 11, Python 3.7, and just did the installation fresh.

img_array = keras.preprocessing.image.img_to_array(img)

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-32-e39202bdee35> in <module>
      6 )
      7 print(img)
----> 8 img_array = keras.preprocessing.image.img_to_array(img)
      9 img_array = tf.expand_dims(img_array, 0) # Create a batch
     10 

~\Documents\openvino_env\lib\site-packages\tensorflow\python\keras\preprocessing\image.py in img_to_array(img, data_format, dtype)
    226       dtype = backend.floatx()
    227     kwargs['dtype'] = dtype
--> 228   return image.img_to_array(img, data_format=data_format, **kwargs)
    229 
    230 

~\Documents\openvino_env\lib\site-packages\keras_preprocessing\image\utils.py in img_to_array(img, data_format, dtype)
    307     # or (channel, height, width)
    308     # but original PIL image has format (width, height, channel)
--> 309     x = np.asarray(img, dtype=dtype)
    310     if len(x.shape) == 3:
    311         if data_format == 'channels_first':

~\Documents\openvino_env\lib\site-packages\numpy\core\_asarray.py in asarray(a, dtype, order)
     81 
     82     """
---> 83     return array(a, dtype, copy=False, order=order)
     84 
     85 

TypeError: __array__() takes 1 positional argument but 2 were given

Virtual webcam and deadlock

The input_fps can be zero with virtual webcams like OBS and Logi Capture... We shall not assume CAP_PROP_FPS is always valid, and the easiest workaround is to preset it to 60fps by default if we do not know the source FPS.

Also, we can also face a 1/fps = dividing by zero error if fps is 0.

    # fps of input file
    self.__input_fps = self.__cap.get(cv2.CAP_PROP_FPS)
    if self.__input_fps <= 0:
        self.__input_fps = 60
    # target fps given by user
    self.__output_fps = fps if fps is not None else self.__input_fps

Wrong variable in convert_result_to_image function in 004

The convert_result_to_image function in 004 refers to an image variable that is defined outside the function. It probably needs to be bgr_image.

It would also be good to clarify how multiply_by_ratio() works or refactor it. It is not clear why max() is done for y, but not for x, and "shape" is not a very logical name for the box coordinates. map() (in the main function) could probably be replaced with a list comprehension.

Video player is crashing

The video player is releasing resource before the loop ends and it crashed the kernel...

MicrosoftTeams-image (3)

http://localhost:8888/lab/tree/utils/notebook_utils.py

"""
Stop playing and release resources.
"""

A workaround I put in now is to put a wait, but we shall wait for the main loop to finish before releasing the cap.

def stop(self):
self.__stop = True
time.sleep(1);
self.__cap.release()

Pull Request 208 Revisited - Bugs & Improvements

Would like to track the bugs here again as we have a few openings. Thank you.

#209

Hi, @Debskij

We should use the util functions Helena made on downloading files.

def download_file(
    url: PathLike, filename: PathLike = None, directory: PathLike = None, show_progress: bool = True
):
    """
    Download a file from a url and save it to the local filesystem. The file is saved to the
    current directory by default, or to `directory` if specified. If a filename is not given,
    the filename of the URL will be used.

    :param url: URL that points to the file to download
    :param filename: Name of the local file to save. Should point to the name of the file only,
                     not the full path. If None the filename from the url will be used
    :param directory: Directory to save the file to. Will be created if it doesn't exist
                      If None the file will be saved to the current working directory
    :param show_progress: If True, show an IPython ProgressBar.
Also, we shall print out the command and the model downloader is not showing any progress bar. I thought it was crashed and we shall have some ways to show progress there.

    # Run commands, first download model than convert it to inferable 
    !! $download_command
    print('Models downloded')

@raymondlo84
 
Member
raymondlo84 commented 4 days ago
plt.imshow(convert_result_to_image(image, resized_image, boxes_with_annotations, conf_labels=True))

We may want to size it up so the result is easier to read. The text at the end is very hard to read.

@ryanloney
 
Member
ryanloney commented 4 days ago
plt.imshow(convert_result_to_image(image, resized_image, boxes_with_annotations, conf_labels=True))

We may want to size it up so the result is easier to read. The text at the end is very hard to read.

@Debskij - can you fix this in a new PR? ^^

Add Text Spotting notebook using text-spotting-0005 model from OTE

Could not find a version that satisfies the requirement tensorflow~=2.4.1; extra == "tensorflow2"

Describe the bug
I am always getting this error ERROR: Could not find a version that satisfies the requirement tensorflow~=2.4.1; extra == "tensorflow2" (from openvino-dev[onnx,tensorflow2]) (from versions: 2.5.0rc0, 2.5.0rc1, 2.5.0rc2, 2.5.0rc3, 2.5.0, 2.5.1, 2.5.2, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.8.0rc0, 2.8.0rc1) ERROR: No matching distribution found for tensorflow~=2.4.1; extra == "tensorflow2"
whenever I am trying to install packages from requirements.txt
OS - Ubuntu 20.04

Windows 10 and mo_command got stuck with 301-tensorflow-training-openvino.ipynb

This command got stuck on both of my Windows 10 machines but NVIDIA graphics card(?). I managed to get the log by changing the command to...

!$mo_command > log.txt


Model Optimizer arguments:
Common parameters:
	- Path to the Input Model: 	None
	- Path for generated IR: 	C:\Users\raymo\Documents\openvino_notebooks\notebooks\301-tensorflow-training-openvino\.
	- IR output name: 	flower_ir
	- Log level: 	ERROR
	- Batch: 	Not specified, inherited from the model
	- Input layers: 	Not specified, inherited from the model
	- Output layers: 	Not specified, inherited from the model
	- Input shapes: 	[1,180,180,3]
	- Mean values: 	Not specified
	- Scale values: 	Not specified
	- Scale factor: 	Not specified
	- Precision of IR: 	FP16
	- Enable fusing: 	True
	- Enable grouped convolutions fusing: 	True
	- Move mean values to preprocess section: 	None
	- Reverse input channels: 	False
TensorFlow specific parameters:
	- Input model in text protobuf format: 	False
	- Path to model dump for TensorBoard: 	None
	- List of shared libraries with TensorFlow custom layers implementation: 	None
	- Update the configuration file with input/output node names: 	None
	- Use configuration file used to generate the model with Object Detection API: 	None
	- Use the config file: 	None
	- Inference Engine found in: 	C:\Users\raymo\Documents\openvino_notebooks\openvino_env\lib\site-packages\openvino
Inference Engine version: 	2.1.2021.3.0-2774-d6ebaa2cd8e-refs/pull/4731/head
Model Optimizer version: 	    custom_main_9352e0a9c746fb7cf04f50b775bda6b77ff1aa6b
[ WARNING ] Model Optimizer and Inference Engine versions do no match.
[ WARNING ] Consider building the Inference Engine Python API from sources or reinstall OpenVINO (TM) toolkit using "pip install openvino" (may be incompatible with the current Model Optimizer version)

Capture

504 Gateway Timeout when multiple tabs are reopened

Describe the bug
We identified a minor bug when the notebook image is stopped and restarted while 2+ ipynb notebooks are open. There appears to be an unusual problem restarting the kernels when the notebook resumes

Expected behavior
Kernels are resumed without showing an error to the user

Screenshots
image
image

Installation instructions (Please mark the checkbox)
[X] I followed the installation guide at https://github.com/openvinotoolkit/openvino_notebooks#-installation-guide to install the notebooks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.