From 1144a66a9b5617c21896355986346fb7d71d2b5d Mon Sep 17 00:00:00 2001 From: Sebastian Golebiewski Date: Mon, 10 Jun 2024 07:34:50 +0200 Subject: [PATCH] [DOCS] Updating interactive tutorials (#24886) --- .../notebooks-installation.rst | 185 ++- docs/nbdoc/consts.py | 2 +- .../3D-pose-estimation-with-output.rst | 100 +- ...-segmentation-point-clouds-with-output.rst | 4 +- ...on-recognition-webcam-with-output_22_0.png | 4 +- docs/notebooks/all_notebooks_paths.txt | 6 + ...-lightweight-text-to-image-with-output.rst | 74 +- docs/notebooks/animate-anyone-with-output.rst | 27 +- docs/notebooks/async-api-with-output.rst | 6 +- .../async-api-with-output_23_0.png | 4 +- docs/notebooks/auto-device-with-output.rst | 50 +- .../auto-device-with-output_27_0.png | 4 +- .../auto-device-with-output_28_0.png | 4 +- ...p-zero-shot-classification-with-output.rst | 104 +- .../convert-to-openvino-with-output.rst | 24 +- .../convnext-classification-with-output.rst | 2 +- ...ss-lingual-books-alignment-with-output.rst | 8 +- ...segmentation-quantize-nncf-with-output.rst | 56 +- ...ntation-quantize-nncf-with-output_37_1.png | 4 +- ...ddcolor-image-colorization-with-output.rst | 778 ++++++++++ ...or-image-colorization-with-output_16_0.jpg | 3 + ...or-image-colorization-with-output_16_0.png | 3 + ...or-image-colorization-with-output_25_0.jpg | 3 + ...or-image-colorization-with-output_25_0.png | 3 + ...lor-image-colorization-with-output_8_0.jpg | 3 + ...lor-image-colorization-with-output_8_0.png | 3 + ...lor-image-colorization-with-output_9_0.jpg | 3 + ...lor-image-colorization-with-output_9_0.png | 3 + ...diffusion-image-generation-with-output.rst | 8 +- docs/notebooks/depth-anything-with-output.rst | 36 +- .../depth-anything-with-output_44_0.png | 4 +- .../detectron2-to-openvino-with-output.rst | 2 +- ...etectron2-to-openvino-with-output_22_0.jpg | 4 +- ...etectron2-to-openvino-with-output_22_0.png | 4 +- ...etectron2-to-openvino-with-output_32_0.jpg | 4 +- ...etectron2-to-openvino-with-output_32_0.png | 4 +- .../distil-whisper-asr-with-output.rst | 206 ++- ...rt-sequence-classification-with-output.rst | 68 +- ...ly-2-instruction-following-with-output.rst | 6 +- ...micrafter-animating-images-with-output.rst | 69 +- docs/notebooks/efficient-sam-with-output.rst | 88 +- .../efficient-sam-with-output_16_1.png | 4 +- .../efficient-sam-with-output_24_1.png | 4 +- .../efficient-sam-with-output_35_1.png | 4 +- .../encodec-audio-compression-with-output.rst | 20 +- ...dec-audio-compression-with-output_38_1.png | 4 +- .../fast-segment-anything-with-output.rst | 29 +- .../freevc-voice-conversion-with-output.rst | 192 ++- .../grounded-segment-anything-with-output.rst | 29 +- docs/notebooks/hello-npu-with-output.rst | 106 +- .../hello-segmentation-with-output.rst | 4 +- .../hugging-face-hub-with-output.rst | 65 +- docs/notebooks/image-bind-with-output.rst | 140 +- ...lassification-quantization-with-output.rst | 42 +- docs/notebooks/instant-id-with-output.rst | 17 +- .../knowledge-graphs-conve-with-output.rst | 22 +- ...modal-large-language-model-with-output.rst | 28 +- ...-large-language-model-with-output_29_0.jpg | 4 +- ...-large-language-model-with-output_29_0.png | 4 +- ...l-large-language-model-with-output_8_0.jpg | 4 +- ...l-large-language-model-with-output_8_0.png | 4 +- .../language-quantize-bert-with-output.rst | 88 +- ...cy-models-image-generation-with-output.rst | 11 +- ...stency-models-optimum-demo-with-output.rst | 14 +- ...y-models-optimum-demo-with-output_15_1.jpg | 4 +- ...y-models-optimum-demo-with-output_15_1.png | 4 +- ...cy-models-optimum-demo-with-output_8_1.jpg | 4 +- ...cy-models-optimum-demo-with-output_8_1.png | 4 +- .../lcm-lora-controlnet-with-output.rst | 8 +- ...acy-mo-convert-to-openvino-with-output.rst | 68 +- ...va-next-multimodal-chatbot-with-output.rst | 250 ++-- .../llm-agent-langchain-with-output.rst | 11 +- docs/notebooks/llm-chatbot-with-output.rst | 35 +- .../llm-question-answering-with-output.rst | 6 +- .../llm-rag-langchain-with-output.rst | 74 +- ...a-content-type-recognition-with-output.rst | 5 +- docs/notebooks/meter-reader-with-output.rst | 2 +- .../mobileclip-video-search-with-output.rst | 161 ++- ...bilevlm-language-assistant-with-output.rst | 37 +- docs/notebooks/model-tools-with-output.rst | 32 +- .../music-generation-with-output.rst | 39 +- ...o-llava-multimodal-chatbot-with-output.rst | 1263 +++++++++++++++++ ...ava-multimodal-chatbot-with-output_7_1.jpg | 3 + ...ava-multimodal-chatbot-with-output_7_1.png | 3 + .../notebooks_with_colab_buttons.txt | 2 + .../object-detection-with-output.rst | 5 +- .../object-detection-with-output_19_0.png | 4 +- docs/notebooks/openvino-api-with-output.rst | 20 +- .../openvino-tokenizers-with-output.rst | 60 +- docs/notebooks/openvoice-with-output.rst | 73 +- ...ical-character-recognition-with-output.rst | 10 +- .../optimize-preprocessing-with-output.rst | 14 +- .../paddle-ocr-webcam-with-output.rst | 4 +- .../paddle-ocr-webcam-with-output_30_0.png | 4 +- ...to-openvino-classification-with-output.rst | 20 +- .../notebooks/person-tracking-with-output.rst | 151 +- .../person-tracking-with-output_25_0.png | 4 +- docs/notebooks/photo-maker-with-output.rst | 52 +- .../photo-maker-with-output_33_0.png | 4 +- .../pose-estimation-with-output_22_0.png | 4 +- ...annote-speaker-diarization-with-output.rst | 16 +- .../pytorch-onnx-to-openvino-with-output.rst | 15 +- ...training-quantization-nncf-with-output.rst | 107 +- ...uantization-aware-training-with-output.rst | 89 +- ...on-sparsity-aware-training-with-output.rst | 839 +++++++++++ .../pytorch-to-openvino-with-output.rst | 14 +- docs/notebooks/qrcode-monster-with-output.rst | 9 +- .../rmbg-background-removal-with-output.rst | 93 +- ...ce-text-to-video-retrieval-with-output.rst | 570 ++++++++ docs/notebooks/sdxl-turbo-with-output.rst | 11 +- ...-shot-image-classification-with-output.rst | 22 +- ...-image-classification-with-output_24_1.png | 4 +- ...tch-to-image-pix2pix-turbo-with-output.rst | 207 +-- ...o-image-pix2pix-turbo-with-output_18_0.jpg | 4 +- ...o-image-pix2pix-turbo-with-output_18_0.png | 4 +- .../sparsity-optimization-with-output.rst | 58 +- .../speculative-sampling-with-output.rst | 7 +- ...tion-quantization-wav2vec2-with-output.rst | 185 ++- ...e-cascade-image-generation-with-output.rst | 39 +- ...cade-image-generation-with-output_29_2.jpg | 4 +- ...cade-image-generation-with-output_29_2.png | 4 +- ...table-diffusion-ip-adapter-with-output.rst | 46 +- ...-diffusion-ip-adapter-with-output_22_1.png | 4 +- ...-diffusion-ip-adapter-with-output_25_0.png | 4 +- ...-diffusion-ip-adapter-with-output_28_0.png | 4 +- ...le-diffusion-text-to-image-with-output.rst | 193 ++- ...fusion-torchdynamo-backend-with-output.rst | 14 +- ...n-torchdynamo-backend-with-output_14_1.jpg | 4 +- ...n-torchdynamo-backend-with-output_14_1.png | 4 +- ...diffusion-v2-infinite-zoom-with-output.rst | 2 - .../stable-video-diffusion-with-output.rst | 559 +++++++- .../stable-zephyr-3b-chatbot-with-output.rst | 3 +- docs/notebooks/style-transfer-with-output.rst | 2 +- .../style-transfer-with-output_25_0.png | 4 +- .../table-question-answering-with-output.rst | 68 +- ...fication-nncf-quantization-with-output.rst | 18 +- ...classification-to-openvino-with-output.rst | 6 +- docs/notebooks/tensorflow-hub-with-output.rst | 4 +- ...e-segmentation-to-openvino-with-output.rst | 2 +- ...mentation-to-openvino-with-output_39_0.png | 4 +- ...ject-detection-to-openvino-with-output.rst | 148 +- ...detection-to-openvino-with-output_38_0.png | 4 +- ...uantization-aware-training-with-output.rst | 91 +- .../notebooks/text-prediction-with-output.rst | 37 +- ...tflite-selfie-segmentation-with-output.rst | 2 +- ...e-selfie-segmentation-with-output_25_0.png | 4 +- ...e-selfie-segmentation-with-output_33_0.png | 4 +- .../tflite-to-openvino-with-output.rst | 26 +- .../tiny-sd-image-generation-with-output.rst | 2 +- .../triposr-3d-reconstruction-with-output.rst | 163 +-- docs/notebooks/typo-detector-with-output.rst | 24 +- .../vision-background-removal-with-output.rst | 8 +- .../vision-image-colorization-with-output.rst | 48 +- .../vision-monodepth-with-output.rst | 8 +- .../vision-paddlegan-anime-with-output.rst | 16 +- ...-paddlegan-superresolution-with-output.rst | 14 +- .../notebooks/whisper-convert-with-output.rst | 106 +- .../whisper-nncf-quantize-with-output.rst | 8 +- ...uerstchen-image-generation-with-output.rst | 120 +- .../yolov10-optimization-with-output.rst | 1159 +++++++++++++++ .../yolov10-optimization-with-output_13_1.jpg | 3 + .../yolov10-optimization-with-output_13_1.png | 3 + .../yolov10-optimization-with-output_19_0.jpg | 3 + .../yolov10-optimization-with-output_19_0.png | 3 + .../yolov10-optimization-with-output_34_0.jpg | 3 + .../yolov10-optimization-with-output_34_0.png | 3 + .../yolov10-optimization-with-output_38_0.jpg | 3 + .../yolov10-optimization-with-output_38_0.png | 3 + .../yolov10-optimization-with-output_50_0.png | 3 + .../yolov7-optimization-with-output.rst | 222 +-- .../yolov7-optimization-with-output_10_0.jpg | 4 +- .../yolov7-optimization-with-output_10_0.png | 4 +- .../yolov7-optimization-with-output_27_0.jpg | 4 +- .../yolov7-optimization-with-output_27_0.png | 4 +- .../yolov7-optimization-with-output_44_0.jpg | 4 +- .../yolov7-optimization-with-output_44_0.png | 4 +- ...lov8-instance-segmentation-with-output.rst | 2 +- .../yolov8-keypoint-detection-with-output.rst | 2 +- docs/notebooks/yolov8-obb-with-output.rst | 3 +- .../yolov8-object-detection-with-output.rst | 265 ++-- .../yolov9-optimization-with-output.rst | 201 +-- .../yolov9-optimization-with-output_36_0.png | 4 +- 182 files changed, 8221 insertions(+), 3023 deletions(-) create mode 100644 docs/notebooks/ddcolor-image-colorization-with-output.rst create mode 100644 docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_16_0.jpg create mode 100644 docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_16_0.png create mode 100644 docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_25_0.jpg create mode 100644 docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_25_0.png create mode 100644 docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_8_0.jpg create mode 100644 docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_8_0.png create mode 100644 docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_9_0.jpg create mode 100644 docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_9_0.png create mode 100644 docs/notebooks/nano-llava-multimodal-chatbot-with-output.rst create mode 100644 docs/notebooks/nano-llava-multimodal-chatbot-with-output_files/nano-llava-multimodal-chatbot-with-output_7_1.jpg create mode 100644 docs/notebooks/nano-llava-multimodal-chatbot-with-output_files/nano-llava-multimodal-chatbot-with-output_7_1.png create mode 100644 docs/notebooks/pytorch-quantization-sparsity-aware-training-with-output.rst create mode 100644 docs/notebooks/s3d-mil-nce-text-to-video-retrieval-with-output.rst create mode 100644 docs/notebooks/yolov10-optimization-with-output.rst create mode 100644 docs/notebooks/yolov10-optimization-with-output_files/yolov10-optimization-with-output_13_1.jpg create mode 100644 docs/notebooks/yolov10-optimization-with-output_files/yolov10-optimization-with-output_13_1.png create mode 100644 docs/notebooks/yolov10-optimization-with-output_files/yolov10-optimization-with-output_19_0.jpg create mode 100644 docs/notebooks/yolov10-optimization-with-output_files/yolov10-optimization-with-output_19_0.png create mode 100644 docs/notebooks/yolov10-optimization-with-output_files/yolov10-optimization-with-output_34_0.jpg create mode 100644 docs/notebooks/yolov10-optimization-with-output_files/yolov10-optimization-with-output_34_0.png create mode 100644 docs/notebooks/yolov10-optimization-with-output_files/yolov10-optimization-with-output_38_0.jpg create mode 100644 docs/notebooks/yolov10-optimization-with-output_files/yolov10-optimization-with-output_38_0.png create mode 100644 docs/notebooks/yolov10-optimization-with-output_files/yolov10-optimization-with-output_50_0.png diff --git a/docs/articles_en/learn-openvino/interactive-tutorials-python/notebooks-installation.rst b/docs/articles_en/learn-openvino/interactive-tutorials-python/notebooks-installation.rst index bda27362fbf..8a5fe913959 100644 --- a/docs/articles_en/learn-openvino/interactive-tutorials-python/notebooks-installation.rst +++ b/docs/articles_en/learn-openvino/interactive-tutorials-python/notebooks-installation.rst @@ -32,15 +32,17 @@ The table below lists the supported operating systems and Python versions. | | (64-bit | | | ) `__ | +=====================================+================================+ -| Ubuntu 18.04 LTS | 3.8, 3.9, 3.10. 3.11 | +| Ubuntu 20.04 LTS, 64-bit | 3.8, 3.9, 3.10. 3.11 | +-------------------------------------+--------------------------------+ -| Ubuntu 20.04 LTS | 3.8, 3.9, 3.10, 3.11 | +| Ubuntu 22.04 LTS, 64-bit | 3.8, 3.9, 3.10, 3.11 | +-------------------------------------+--------------------------------+ | Red Hat Enterprise Linux 8 | 3.8, 3.9, 3.10, 3.11 | +-------------------------------------+--------------------------------+ -| macOS 12.6.x versions | 3.8, 3.9, 3.10, 3.11 | +| CentOS 7, 64 bit | 3.8, 3.9, 3.10, 3.11 | +-------------------------------------+--------------------------------+ -| Windows 10 Pro, Enterprise | 3.8, 3.9, 3.10, 3.11 | +| macOS 10.15.x versions or higher | 3.8, 3.9, 3.10, 3.11 | ++-------------------------------------+--------------------------------+ +| Windows 10, 64-bit Pro, Enterprise | 3.8, 3.9, 3.10, 3.11 | | or Education editions | | +-------------------------------------+--------------------------------+ | Windows Server 2016 or higher | 3.8, 3.9, 3.10, 3.11 | @@ -64,6 +66,7 @@ Installing prerequisites Run the installer by double clicking it. Follow the installation steps to set up the software. While installing, make sure you check the box to *add Python to system PATH*. + Also, it is recommended to use the installer option to disable the PATH length limit. .. note:: @@ -81,6 +84,12 @@ Installing prerequisites Run the installer by double clicking it. Follow the installation steps to set up the software. + 4. (Optional) Install FFMPEG + + Download FFMPEG binary from `here `__ + + Set FFMPEG's path (e.g., ``C:\ffmpeg\bin``) to the PATH environmental variable on Windows. + .. tab-item:: Linux :sync: linux @@ -96,7 +105,7 @@ Installing prerequisites sudo apt-get update sudo apt-get upgrade - sudo apt-get install python3-venv build-essential python3-dev git-all + sudo apt-get install python3-venv build-essential python3-dev git-all libgl1-mesa-dev ffmpeg For an Intel Integrated Graphics Card, you can install the `Intel Graphics Compute Runtime `__ to enable inference on this device. The command for Ubuntu 20.04 is: @@ -133,7 +142,8 @@ Installing prerequisites .. code-block:: sh /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - After you install it, follow the instructions from the Homebrew installation to set it up. + + After you install it, follow the instructions from the Homebrew installation to set it up. 3. **Install Python and dependencies** @@ -142,6 +152,8 @@ Installing prerequisites brew install python@3.9 brew install protobuf + # optional but recommended + brew install ffmpeg Run each step below in a terminal. @@ -250,6 +262,56 @@ Installing prerequisites CMD /tmp/scripts/run + .. tab-item:: Amazon SageMaker + :sync: amazon-sagemaker + + .. note:: + + An `AWS `__ + account and access to + `Amazon SageMaker Studio `__ + are required. + + 1. **Log into your Amazon SageMaker Studio Environment and** ``Add user``. + + |amazon-studio-1| + + 2. **Choose desired user profile name** + + |amazon-studio-2| + + 3. **Choose Jupyter Lab version 3.0** + + |amazon-studio-3| + + 4. **Choose the remaining default setting and click "Submit" to add a user.** + 5. **Launch the Amazon SageMaker Studio environment.** + + Click "Open Studio" to start the environment: + + |amazon-studio-4| + + .. note:: + + You are using an ``ml.t3.medium`` instance, which is for free for + 250 hours per month for the first 2 months on Studio notebook. + + 6. **Wait for a couple of minutes for your environment to load.** + + You should be able to see the following screen: + + |amazon-studio-5| + + 7. **Select a SageMaker image.** + + Choose ``Data Science 3.0`` in "Select a SageMaker image" drop-down under + "Notebooks and compute resources". + + Then, click **+** on "Image Terminal" to start a terminal session: + + |amazon-studio-6| + + Installing notebooks ++++++++++++++++++++ @@ -294,6 +356,19 @@ Installing notebooks pip install -r requirements.txt + + .. important:: + + In case of problems with accessing HuggingFace in PRC, set-up the networking + environment before you launch the notebooks: + + .. code-block:: + + pip install -U huggingface_hub + set HF_ENDPOINT = https://hf-mirror.com + + For more information, visit `HF-Mirror HuggingFace `__. + .. tab-item:: Linux :sync: linux @@ -333,6 +408,18 @@ Installing notebooks pip install -r requirements.txt + .. important:: + + In case of problems with accessing HuggingFace in PRC, set-up the networking + environment before you launch the notebooks: + + .. code-block:: + + pip install -U huggingface_hub + set HF_ENDPOINT = https://hf-mirror.com + + For more information, visit `HF-Mirror HuggingFace `__. + .. tab-item:: macOS :sync: macos @@ -475,6 +562,69 @@ Installing notebooks While running the container on Windows and macOS, only CPU devices can be used. To access the iGPU, install the notebooks locally, following the instructions above. + .. tab-item:: Amazon SageMaker + :sync: amazon-sagemaker + + + **Use the terminal and follow the steps below.** + + |amazon-studio-7| + + + 1. **Install few system dependencies.** + + .. code-block:: + + apt update + apt install build-essential -y + apt install libpython3.9-dev -y + apt install libgl1-mesa-glx -y + + 2. **Setup OpenVINO conda environment.** + + .. code-block:: + + conda create --name openvino_env python=3.9 + conda activate openvino_env + conda install ipykernel + set PATH="/anaconda/envs/openvino_env/bin;%PATH%" + + 3. **Setup OpenVINO Notebooks.** + + .. code-block:: + + git clone https://github.com/openvinotoolkit/openvino_notebooks.git + cd openvino_notebooks + # Install OpenVINO and OpenVINO notebook Requirements + python -m pip install --upgrade pip + pip install -r requirements.txt + + 4. **Run the Notebooks** + + * To run the notebooks, click the top level "openvino_notebooks" folder + and navigate to your example: + + |amazon-studio-8| + + * Choose "Image" - ``Data Science 3.0``, + "Kernel" - ``Python [conda env:openvino_env],`` + "Instance type"- your desired compute instance. + + |amazon-studio-9| + + |amazon-studio-10| + + |amazon-studio-11| + + .. note:: + + Make sure you use the ``Python [conda env:openvino_env]`` + environment (not ``Python 3``). + + * Next, run the cells of the notebook. You may try other notebooks to + explore OpenVINO features and examples. + + Run the Notebooks ################# @@ -614,6 +764,27 @@ Additional Resources .. |ml-studio-2| image:: https://user-images.githubusercontent.com/15709723/117582205-b6f4d580-b0b5-11eb-9b83-eb2004ad9b19.png +.. |amazon-studio-1| image:: https://user-images.githubusercontent.com/4837253/199801883-7bb64ad2-bb7f-4477-ace1-25111d4fd43c.png + +.. |amazon-studio-2| image:: https://user-images.githubusercontent.com/4837253/199802173-8d65c851-604b-4b92-bafa-cae86b17d1ec.png + +.. |amazon-studio-3| image:: https://user-images.githubusercontent.com/4837253/199802353-14c17233-3dae-4649-bbfe-59b8a598450c.png + +.. |amazon-studio-4| image:: https://user-images.githubusercontent.com/4837253/199802726-97c85732-ff25-4cdd-ad6e-d491b4ed122b.png + +.. |amazon-studio-5| image:: https://user-images.githubusercontent.com/15709723/199784252-c8581c73-342a-4c70-9207-5543d7b87346.png + +.. |amazon-studio-6| image:: https://user-images.githubusercontent.com/4837253/199805717-5d102d27-e92e-4426-8d14-0484fd5ba24c.png + +.. |amazon-studio-7| image:: https://user-images.githubusercontent.com/4837253/199807022-3cc5dd9e-f9f0-445d-be5e-d429dc1b752c.png + +.. |amazon-studio-8| image:: https://user-images.githubusercontent.com/4837253/199810405-0f6748e1-d5f5-469e-8305-a96724dfffba.png + +.. |amazon-studio-9| image:: https://user-images.githubusercontent.com/4837253/199812540-c52ea429-9d53-4bdb-aec1-a0b8616c6fcc.png + +.. |amazon-studio-10| image:: https://user-images.githubusercontent.com/4837253/199812587-20c3e360-3a31-4032-b17a-8b242d6ccc26.png + +.. |amazon-studio-11| image:: https://user-images.githubusercontent.com/4837253/199812713-32074aa7-8190-43c8-815c-231542c7b286.png + .. |docker-terminal-1| image:: https://user-images.githubusercontent.com/15709723/127793994-355e4d29-d131-432d-a12a-b08ca6131223.png - diff --git a/docs/nbdoc/consts.py b/docs/nbdoc/consts.py index 6545e590fd0..ded7c9637e0 100644 --- a/docs/nbdoc/consts.py +++ b/docs/nbdoc/consts.py @@ -6,7 +6,7 @@ repo_directory = "notebooks" repo_owner = "openvinotoolkit" repo_name = "openvino_notebooks" repo_branch = "tree/main" -artifacts_link = "http://repository.toolbox.iotg.sclab.intel.com/projects/ov-notebook/0.1.0-latest/20240515220822/dist/rst_files/" +artifacts_link = "http://repository.toolbox.iotg.sclab.intel.com/projects/ov-notebook/0.1.0-latest/20240605220807/dist/rst_files/" blacklisted_extensions = ['.xml', '.bin'] notebooks_repo = "https://github.com/openvinotoolkit/openvino_notebooks/blob/latest/" notebooks_binder = "https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?filepath=" diff --git a/docs/notebooks/3D-pose-estimation-with-output.rst b/docs/notebooks/3D-pose-estimation-with-output.rst index fda23f07b57..8d52a5d3589 100644 --- a/docs/notebooks/3D-pose-estimation-with-output.rst +++ b/docs/notebooks/3D-pose-estimation-with-output.rst @@ -69,82 +69,82 @@ Lab instead.** Collecting openvino-dev>=2024.0.0 Using cached openvino_dev-2024.1.0-15008-py3-none-any.whl.metadata (16 kB) Collecting opencv-python - Using cached opencv_python-4.9.0.80-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (20 kB) + Using cached opencv_python-4.10.0.82-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (20 kB) Collecting torch - Using cached https://download.pytorch.org/whl/cpu/torch-2.3.0%2Bcpu-cp38-cp38-linux_x86_64.whl (190.4 MB) + Using cached https://download.pytorch.org/whl/cpu/torch-2.3.1%2Bcpu-cp38-cp38-linux_x86_64.whl (190.4 MB) Collecting onnx - Using cached onnx-1.16.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (16 kB) - Requirement already satisfied: ipywidgets>=7.2.1 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from pythreejs) (8.1.2) + Using cached onnx-1.16.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (16 kB) + Requirement already satisfied: ipywidgets>=7.2.1 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from pythreejs) (8.1.3) Collecting ipydatawidgets>=1.1.1 (from pythreejs) Using cached ipydatawidgets-4.3.5-py2.py3-none-any.whl.metadata (1.4 kB) Collecting numpy (from pythreejs) Using cached numpy-1.24.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (5.6 kB) - Requirement already satisfied: traitlets in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from pythreejs) (5.14.3) - Requirement already satisfied: defusedxml>=0.7.1 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from openvino-dev>=2024.0.0) (0.7.1) + Requirement already satisfied: traitlets in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from pythreejs) (5.14.3) + Requirement already satisfied: defusedxml>=0.7.1 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from openvino-dev>=2024.0.0) (0.7.1) Collecting networkx<=3.1.0 (from openvino-dev>=2024.0.0) Using cached networkx-3.1-py3-none-any.whl.metadata (5.3 kB) Collecting openvino-telemetry>=2023.2.1 (from openvino-dev>=2024.0.0) Using cached openvino_telemetry-2024.1.0-py3-none-any.whl.metadata (2.3 kB) - Requirement already satisfied: packaging in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from openvino-dev>=2024.0.0) (24.0) - Requirement already satisfied: pyyaml>=5.4.1 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from openvino-dev>=2024.0.0) (6.0.1) - Requirement already satisfied: requests>=2.25.1 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from openvino-dev>=2024.0.0) (2.31.0) + Requirement already satisfied: packaging in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from openvino-dev>=2024.0.0) (24.0) + Requirement already satisfied: pyyaml>=5.4.1 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from openvino-dev>=2024.0.0) (6.0.1) + Requirement already satisfied: requests>=2.25.1 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from openvino-dev>=2024.0.0) (2.32.0) Collecting openvino==2024.1.0 (from openvino-dev>=2024.0.0) Using cached openvino-2024.1.0-15008-cp38-cp38-manylinux2014_x86_64.whl.metadata (8.8 kB) Collecting filelock (from torch) Using cached filelock-3.14.0-py3-none-any.whl.metadata (2.8 kB) - Requirement already satisfied: typing-extensions>=4.8.0 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from torch) (4.11.0) + Requirement already satisfied: typing-extensions>=4.8.0 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from torch) (4.12.1) Collecting sympy (from torch) - Using cached https://download.pytorch.org/whl/sympy-1.12-py3-none-any.whl (5.7 MB) - Requirement already satisfied: jinja2 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from torch) (3.1.4) + Using cached sympy-1.12.1-py3-none-any.whl.metadata (12 kB) + Requirement already satisfied: jinja2 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from torch) (3.1.4) Collecting fsspec (from torch) - Downloading fsspec-2024.5.0-py3-none-any.whl.metadata (11 kB) + Using cached fsspec-2024.6.0-py3-none-any.whl.metadata (11 kB) Collecting protobuf>=3.20.2 (from onnx) - Using cached protobuf-5.26.1-cp37-abi3-manylinux2014_x86_64.whl.metadata (592 bytes) + Using cached protobuf-5.27.0-cp38-abi3-manylinux2014_x86_64.whl.metadata (592 bytes) Collecting traittypes>=0.2.0 (from ipydatawidgets>=1.1.1->pythreejs) Using cached traittypes-0.2.1-py2.py3-none-any.whl.metadata (1.0 kB) - Requirement already satisfied: comm>=0.1.3 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipywidgets>=7.2.1->pythreejs) (0.2.2) - Requirement already satisfied: ipython>=6.1.0 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipywidgets>=7.2.1->pythreejs) (8.12.3) - Requirement already satisfied: widgetsnbextension~=4.0.10 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipywidgets>=7.2.1->pythreejs) (4.0.10) - Requirement already satisfied: jupyterlab-widgets~=3.0.10 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipywidgets>=7.2.1->pythreejs) (3.0.10) - Requirement already satisfied: charset-normalizer<4,>=2 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from requests>=2.25.1->openvino-dev>=2024.0.0) (3.3.2) - Requirement already satisfied: idna<4,>=2.5 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from requests>=2.25.1->openvino-dev>=2024.0.0) (3.7) - Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from requests>=2.25.1->openvino-dev>=2024.0.0) (2.2.1) - Requirement already satisfied: certifi>=2017.4.17 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from requests>=2.25.1->openvino-dev>=2024.0.0) (2024.2.2) - Requirement already satisfied: MarkupSafe>=2.0 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from jinja2->torch) (2.1.5) - Collecting mpmath>=0.19 (from sympy->torch) + Requirement already satisfied: comm>=0.1.3 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipywidgets>=7.2.1->pythreejs) (0.2.2) + Requirement already satisfied: ipython>=6.1.0 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipywidgets>=7.2.1->pythreejs) (8.12.3) + Requirement already satisfied: widgetsnbextension~=4.0.11 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipywidgets>=7.2.1->pythreejs) (4.0.11) + Requirement already satisfied: jupyterlab-widgets~=3.0.11 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipywidgets>=7.2.1->pythreejs) (3.0.11) + Requirement already satisfied: charset-normalizer<4,>=2 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from requests>=2.25.1->openvino-dev>=2024.0.0) (3.3.2) + Requirement already satisfied: idna<4,>=2.5 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from requests>=2.25.1->openvino-dev>=2024.0.0) (3.7) + Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from requests>=2.25.1->openvino-dev>=2024.0.0) (2.2.1) + Requirement already satisfied: certifi>=2017.4.17 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from requests>=2.25.1->openvino-dev>=2024.0.0) (2024.6.2) + Requirement already satisfied: MarkupSafe>=2.0 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from jinja2->torch) (2.1.5) + Collecting mpmath<1.4.0,>=1.1.0 (from sympy->torch) Using cached https://download.pytorch.org/whl/mpmath-1.3.0-py3-none-any.whl (536 kB) - Requirement already satisfied: backcall in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.2.0) - Requirement already satisfied: decorator in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (5.1.1) - Requirement already satisfied: jedi>=0.16 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.19.1) - Requirement already satisfied: matplotlib-inline in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.1.7) - Requirement already satisfied: pickleshare in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.7.5) - Requirement already satisfied: prompt-toolkit!=3.0.37,<3.1.0,>=3.0.30 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (3.0.43) - Requirement already satisfied: pygments>=2.4.0 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (2.18.0) - Requirement already satisfied: stack-data in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.6.3) - Requirement already satisfied: pexpect>4.3 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (4.9.0) - Requirement already satisfied: parso<0.9.0,>=0.8.3 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from jedi>=0.16->ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.8.4) - Requirement already satisfied: ptyprocess>=0.5 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from pexpect>4.3->ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.7.0) - Requirement already satisfied: wcwidth in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from prompt-toolkit!=3.0.37,<3.1.0,>=3.0.30->ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.2.13) - Requirement already satisfied: executing>=1.2.0 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from stack-data->ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (2.0.1) - Requirement already satisfied: asttokens>=2.1.0 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from stack-data->ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (2.4.1) - Requirement already satisfied: pure-eval in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from stack-data->ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.2.2) - Requirement already satisfied: six>=1.12.0 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from asttokens>=2.1.0->stack-data->ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (1.16.0) + Requirement already satisfied: backcall in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.2.0) + Requirement already satisfied: decorator in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (5.1.1) + Requirement already satisfied: jedi>=0.16 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.19.1) + Requirement already satisfied: matplotlib-inline in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.1.7) + Requirement already satisfied: pickleshare in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.7.5) + Requirement already satisfied: prompt-toolkit!=3.0.37,<3.1.0,>=3.0.30 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (3.0.46) + Requirement already satisfied: pygments>=2.4.0 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (2.18.0) + Requirement already satisfied: stack-data in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.6.3) + Requirement already satisfied: pexpect>4.3 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (4.9.0) + Requirement already satisfied: parso<0.9.0,>=0.8.3 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from jedi>=0.16->ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.8.4) + Requirement already satisfied: ptyprocess>=0.5 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from pexpect>4.3->ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.7.0) + Requirement already satisfied: wcwidth in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from prompt-toolkit!=3.0.37,<3.1.0,>=3.0.30->ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.2.13) + Requirement already satisfied: executing>=1.2.0 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from stack-data->ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (2.0.1) + Requirement already satisfied: asttokens>=2.1.0 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from stack-data->ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (2.4.1) + Requirement already satisfied: pure-eval in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from stack-data->ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (0.2.2) + Requirement already satisfied: six>=1.12.0 in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (from asttokens>=2.1.0->stack-data->ipython>=6.1.0->ipywidgets>=7.2.1->pythreejs) (1.16.0) Using cached pythreejs-2.4.2-py3-none-any.whl (3.4 MB) Using cached openvino_dev-2024.1.0-15008-py3-none-any.whl (4.7 MB) Using cached openvino-2024.1.0-15008-cp38-cp38-manylinux2014_x86_64.whl (38.7 MB) - Using cached opencv_python-4.9.0.80-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (62.2 MB) - Using cached onnx-1.16.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.9 MB) + Using cached opencv_python-4.10.0.82-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (62.5 MB) + Using cached onnx-1.16.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.9 MB) Using cached ipydatawidgets-4.3.5-py2.py3-none-any.whl (271 kB) Using cached networkx-3.1-py3-none-any.whl (2.1 MB) Using cached numpy-1.24.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB) Using cached openvino_telemetry-2024.1.0-py3-none-any.whl (23 kB) - Using cached protobuf-5.26.1-cp37-abi3-manylinux2014_x86_64.whl (302 kB) + Using cached protobuf-5.27.0-cp38-abi3-manylinux2014_x86_64.whl (309 kB) Using cached filelock-3.14.0-py3-none-any.whl (12 kB) - Downloading fsspec-2024.5.0-py3-none-any.whl (316 kB) -  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 316.1/316.1 kB 2.6 MB/s eta 0:00:00 + Using cached fsspec-2024.6.0-py3-none-any.whl (176 kB) + Using cached sympy-1.12.1-py3-none-any.whl (5.7 MB) Using cached traittypes-0.2.1-py2.py3-none-any.whl (8.6 kB) Installing collected packages: openvino-telemetry, mpmath, traittypes, sympy, protobuf, numpy, networkx, fsspec, filelock, torch, openvino, opencv-python, onnx, openvino-dev, ipydatawidgets, pythreejs - Successfully installed filelock-3.14.0 fsspec-2024.5.0 ipydatawidgets-4.3.5 mpmath-1.3.0 networkx-3.1 numpy-1.24.4 onnx-1.16.0 opencv-python-4.9.0.80 openvino-2024.1.0 openvino-dev-2024.1.0 openvino-telemetry-2024.1.0 protobuf-5.26.1 pythreejs-2.4.2 sympy-1.12 torch-2.3.0+cpu traittypes-0.2.1 + Successfully installed filelock-3.14.0 fsspec-2024.6.0 ipydatawidgets-4.3.5 mpmath-1.3.0 networkx-3.1 numpy-1.24.4 onnx-1.16.1 opencv-python-4.10.0.82 openvino-2024.1.0 openvino-dev-2024.1.0 openvino-telemetry-2024.1.0 protobuf-5.27.0 pythreejs-2.4.2 sympy-1.12.1 torch-2.3.1+cpu traittypes-0.2.1 Note: you may need to restart the kernel to use updated packages. @@ -252,18 +252,18 @@ IR format. .. parsed-literal:: ========== Converting human-pose-estimation-3d-0001 to ONNX - Conversion to ONNX command: /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/bin/python -- /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/omz_tools/internal_scripts/pytorch_to_onnx.py --model-path=model/public/human-pose-estimation-3d-0001 --model-name=PoseEstimationWithMobileNet --model-param=is_convertible_by_mo=True --import-module=model --weights=model/public/human-pose-estimation-3d-0001/human-pose-estimation-3d-0001.pth --input-shape=1,3,256,448 --input-names=data --output-names=features,heatmaps,pafs --output-file=model/public/human-pose-estimation-3d-0001/human-pose-estimation-3d-0001.onnx + Conversion to ONNX command: /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/bin/python -- /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/omz_tools/internal_scripts/pytorch_to_onnx.py --model-path=model/public/human-pose-estimation-3d-0001 --model-name=PoseEstimationWithMobileNet --model-param=is_convertible_by_mo=True --import-module=model --weights=model/public/human-pose-estimation-3d-0001/human-pose-estimation-3d-0001.pth --input-shape=1,3,256,448 --input-names=data --output-names=features,heatmaps,pafs --output-file=model/public/human-pose-estimation-3d-0001/human-pose-estimation-3d-0001.onnx ONNX check passed successfully. ========== Converting human-pose-estimation-3d-0001 to IR (FP32) - Conversion command: /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/bin/python -- /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/bin/mo --framework=onnx --output_dir=model/public/human-pose-estimation-3d-0001/FP32 --model_name=human-pose-estimation-3d-0001 --input=data '--mean_values=data[128.0,128.0,128.0]' '--scale_values=data[255.0,255.0,255.0]' --output=features,heatmaps,pafs --input_model=model/public/human-pose-estimation-3d-0001/human-pose-estimation-3d-0001.onnx '--layout=data(NCHW)' '--input_shape=[1, 3, 256, 448]' --compress_to_fp16=False + Conversion command: /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/bin/python -- /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/bin/mo --framework=onnx --output_dir=model/public/human-pose-estimation-3d-0001/FP32 --model_name=human-pose-estimation-3d-0001 --input=data '--mean_values=data[128.0,128.0,128.0]' '--scale_values=data[255.0,255.0,255.0]' --output=features,heatmaps,pafs --input_model=model/public/human-pose-estimation-3d-0001/human-pose-estimation-3d-0001.onnx '--layout=data(NCHW)' '--input_shape=[1, 3, 256, 448]' --compress_to_fp16=False [ INFO ] MO command line tool is considered as the legacy conversion API as of OpenVINO 2023.2 release. Please use OpenVINO Model Converter (OVC). OVC represents a lightweight alternative of MO and provides simplified model conversion API. Find more information about transition from MO to OVC at https://docs.openvino.ai/2023.2/openvino_docs_OV_Converter_UG_prepare_model_convert_model_MO_OVC_transition.html [ SUCCESS ] Generated IR version 11 model. - [ SUCCESS ] XML file: /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/notebooks/3D-pose-estimation-webcam/model/public/human-pose-estimation-3d-0001/FP32/human-pose-estimation-3d-0001.xml - [ SUCCESS ] BIN file: /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/notebooks/3D-pose-estimation-webcam/model/public/human-pose-estimation-3d-0001/FP32/human-pose-estimation-3d-0001.bin + [ SUCCESS ] XML file: /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/notebooks/3D-pose-estimation-webcam/model/public/human-pose-estimation-3d-0001/FP32/human-pose-estimation-3d-0001.xml + [ SUCCESS ] BIN file: /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/notebooks/3D-pose-estimation-webcam/model/public/human-pose-estimation-3d-0001/FP32/human-pose-estimation-3d-0001.bin diff --git a/docs/notebooks/3D-segmentation-point-clouds-with-output.rst b/docs/notebooks/3D-segmentation-point-clouds-with-output.rst index 6447ad00919..8e4954bc00a 100644 --- a/docs/notebooks/3D-segmentation-point-clouds-with-output.rst +++ b/docs/notebooks/3D-segmentation-point-clouds-with-output.rst @@ -216,7 +216,7 @@ chair for example. .. parsed-literal:: - /tmp/ipykernel_16799/2434168836.py:12: UserWarning: No data for colormapping provided via 'c'. Parameters 'cmap' will be ignored + /tmp/ipykernel_3063563/2434168836.py:12: UserWarning: No data for colormapping provided via 'c'. Parameters 'cmap' will be ignored ax.scatter3D(X, Y, Z, s=5, cmap="jet", marker="o", label="chair") @@ -317,7 +317,7 @@ select device from dropdown list for running inference using OpenVINO .. parsed-literal:: - /tmp/ipykernel_16799/2804603389.py:23: UserWarning: No data for colormapping provided via 'c'. Parameters 'cmap' will be ignored + /tmp/ipykernel_3063563/2804603389.py:23: UserWarning: No data for colormapping provided via 'c'. Parameters 'cmap' will be ignored ax.scatter(XCur, YCur, ZCur, s=5, cmap="jet", marker="o", label=classes[i]) diff --git a/docs/notebooks/action-recognition-webcam-with-output_files/action-recognition-webcam-with-output_22_0.png b/docs/notebooks/action-recognition-webcam-with-output_files/action-recognition-webcam-with-output_22_0.png index 29fb7787324..acae41e0b1a 100644 --- a/docs/notebooks/action-recognition-webcam-with-output_files/action-recognition-webcam-with-output_22_0.png +++ b/docs/notebooks/action-recognition-webcam-with-output_files/action-recognition-webcam-with-output_22_0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1f9f7a4ff050de5ac1c035ff13546573f526abbc3d4b1e157edb3a278caba746 -size 69060 +oid sha256:f9519b2a12072147ebf54e1d7a840ccde81b965fa1844f42f79e66c6513d844a +size 68147 diff --git a/docs/notebooks/all_notebooks_paths.txt b/docs/notebooks/all_notebooks_paths.txt index ebe064c809a..481450364a1 100644 --- a/docs/notebooks/all_notebooks_paths.txt +++ b/docs/notebooks/all_notebooks_paths.txt @@ -15,6 +15,7 @@ notebooks/convert-to-openvino/convert-to-openvino.ipynb notebooks/convert-to-openvino/legacy-mo-convert-to-openvino.ipynb notebooks/cross-lingual-books-alignment/cross-lingual-books-alignment.ipynb notebooks/ct-segmentation-quantize/ct-segmentation-quantize-nncf.ipynb +notebooks/ddcolor-image-colorization/ddcolor-image-colorization.ipynb notebooks/decidiffusion-image-generation/decidiffusion-image-generation.ipynb notebooks/depth-anything/depth-anything.ipynb notebooks/detectron2-to-openvino/detectron2-to-openvino.ipynb @@ -63,6 +64,7 @@ notebooks/model-server/model-server.ipynb notebooks/model-tools/model-tools.ipynb notebooks/music-generation/music-generation.ipynb notebooks/named-entity-recognition/named-entity-recognition.ipynb +notebooks/nano-llava-multimodal-chatbot/nano-llava-multimodal-chatbot.ipynb notebooks/object-detection-webcam/object-detection.ipynb notebooks/oneformer-segmentation/oneformer-segmentation.ipynb notebooks/openvino-api/openvino-api.ipynb @@ -73,6 +75,7 @@ notebooks/optimize-preprocessing/optimize-preprocessing.ipynb notebooks/paddle-ocr-webcam/paddle-ocr-webcam.ipynb notebooks/paddle-to-openvino/paddle-to-openvino-classification.ipynb notebooks/paint-by-example/paint-by-example.ipynb +notebooks/person-counting-webcam/person-counting.ipynb notebooks/person-tracking-webcam/person-tracking.ipynb notebooks/photo-maker/photo-maker.ipynb notebooks/pix2struct-docvqa/pix2struct-docvqa.ipynb @@ -80,6 +83,7 @@ notebooks/pose-estimation-webcam/pose-estimation.ipynb notebooks/pyannote-speaker-diarization/pyannote-speaker-diarization.ipynb notebooks/pytorch-post-training-quantization-nncf/pytorch-post-training-quantization-nncf.ipynb notebooks/pytorch-quantization-aware-training/pytorch-quantization-aware-training.ipynb +notebooks/pytorch-quantization-sparsity-aware-training/pytorch-quantization-sparsity-aware-training.ipynb notebooks/pytorch-to-openvino/pytorch-onnx-to-openvino.ipynb notebooks/pytorch-to-openvino/pytorch-to-openvino.ipynb notebooks/qrcode-monster/qrcode-monster.ipynb @@ -87,6 +91,7 @@ notebooks/quantizing-model-with-accuracy-control/speech-recognition-quantization notebooks/quantizing-model-with-accuracy-control/yolov8-quantization-with-accuracy-control.ipynb notebooks/riffusion-text-to-music/riffusion-text-to-music.ipynb notebooks/rmbg-background-removal/rmbg-background-removal.ipynb +notebooks/s3d-mil-nce-text-to-video-retrieval/s3d-mil-nce-text-to-video-retrieval.ipynb notebooks/sdxl-turbo/sdxl-turbo.ipynb notebooks/segment-anything/segment-anything.ipynb notebooks/siglip-zero-shot-image-classification/siglip-zero-shot-image-classification.ipynb @@ -135,6 +140,7 @@ notebooks/vision-paddlegan-superresolution/vision-paddlegan-superresolution.ipyn notebooks/whisper-subtitles-generation/whisper-convert.ipynb notebooks/whisper-subtitles-generation/whisper-nncf-quantize.ipynb notebooks/wuerstchen-image-generation/wuerstchen-image-generation.ipynb +notebooks/yolov10-optimization/yolov10-optimization.ipynb notebooks/yolov7-optimization/yolov7-optimization.ipynb notebooks/yolov8-optimization/yolov8-instance-segmentation.ipynb notebooks/yolov8-optimization/yolov8-keypoint-detection.ipynb diff --git a/docs/notebooks/amused-lightweight-text-to-image-with-output.rst b/docs/notebooks/amused-lightweight-text-to-image-with-output.rst index d44c1c23128..4619212090a 100644 --- a/docs/notebooks/amused-lightweight-text-to-image-with-output.rst +++ b/docs/notebooks/amused-lightweight-text-to-image-with-output.rst @@ -78,8 +78,8 @@ Load and run the original pipeline .. parsed-literal:: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`. - warnings.warn( + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/models/transformers/transformer_2d.py:34: FutureWarning: `Transformer2DModelOutput` is deprecated and will be removed in version 1.0.0. Importing `Transformer2DModelOutput` from `diffusers.models.transformer_2d` is deprecated and this will be removed in a future version. Please use `from diffusers.models.modeling_outputs import Transformer2DModelOutput`, instead. + deprecate("Transformer2DModelOutput", "1.0.0", deprecation_message) @@ -202,29 +202,29 @@ Convert the Text Encoder .. parsed-literal:: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/modeling_utils.py:4371: FutureWarning: `_is_quantized_training_enabled` is going to be deprecated in transformers 4.39.0. Please use `model.hf_quantizer.is_trainable` instead + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/modeling_utils.py:4481: FutureWarning: `_is_quantized_training_enabled` is going to be deprecated in transformers 4.39.0. Please use `model.hf_quantizer.is_trainable` instead warnings.warn( - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/modeling_attn_mask_utils.py:86: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/modeling_attn_mask_utils.py:86: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if input_shape[-1] > 1 or self.sliding_window is not None: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/modeling_attn_mask_utils.py:162: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/modeling_attn_mask_utils.py:162: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if past_key_values_length > 0: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:620: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:622: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! encoder_states = () if output_hidden_states else None - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:625: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:627: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if output_hidden_states: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:279: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:276: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if attn_weights.size() != (bsz * self.num_heads, tgt_len, src_len): - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:287: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:284: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if causal_attention_mask.size() != (bsz, 1, tgt_len, src_len): - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:319: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:316: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if attn_output.size() != (bsz * self.num_heads, tgt_len, self.head_dim): - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:648: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:650: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if output_hidden_states: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:651: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:653: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if not return_dict: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:742: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:745: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if not return_dict: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:1227: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/clip/modeling_clip.py:1230: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if not return_dict: @@ -333,13 +333,13 @@ suitable. This function repeats part of ``AmusedPipeline``. .. parsed-literal:: - /tmp/ipykernel_17572/3779428577.py:34: TracerWarning: Converting a tensor to a Python list might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /tmp/ipykernel_3064357/3779428577.py:34: TracerWarning: Converting a tensor to a Python list might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! shape=shape.tolist(), - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/models/vq_model.py:144: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/models/vq_model.py:144: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if not force_not_quantize: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/models/upsampling.py:149: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/models/upsampling.py:146: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! assert hidden_states.shape[1] == self.channels - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/models/upsampling.py:165: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/models/upsampling.py:162: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if hidden_states.shape[0] >= 64: @@ -477,7 +477,7 @@ And insert wrappers instances in the pipeline: .. parsed-literal:: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/configuration_utils.py:139: FutureWarning: Accessing config attribute `_execution_device` directly via 'AmusedPipeline' object attribute is deprecated. Please access '_execution_device' over 'AmusedPipeline's config object instead, e.g. 'scheduler.config._execution_device'. + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/configuration_utils.py:140: FutureWarning: Accessing config attribute `_execution_device` directly via 'AmusedPipeline' object attribute is deprecated. Please access '_execution_device' over 'AmusedPipeline's config object instead, e.g. 'scheduler.config._execution_device'. deprecate("direct config name access", "1.0.0", deprecation_message, standard_warn=False) @@ -541,12 +541,8 @@ improve model inference speed. QUANTIZED_TRANSFORMER_OV_PATH = Path(str(TRANSFORMER_OV_PATH).replace(".xml", "_quantized.xml")) - to_quantize = widgets.Checkbox( - value=True, - description="Quantization", - disabled=False, - ) - + skip_for_device = "GPU" in device.value + to_quantize = widgets.Checkbox(value=not skip_for_device, description="Quantization", disabled=skip_for_device) to_quantize @@ -692,7 +688,7 @@ model. .. parsed-literal:: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/datasets/load.py:1486: FutureWarning: The repository for conceptual_captions contains custom code which must be executed to correctly load the dataset. You can inspect the repository content at https://hf.co/datasets/conceptual_captions + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/datasets/load.py:1491: FutureWarning: The repository for conceptual_captions contains custom code which must be executed to correctly load the dataset. You can inspect the repository content at https://hf.co/datasets/conceptual_captions You can avoid this message in future by passing the argument `trust_remote_code=True`. Passing `trust_remote_code=True` will be mandatory to load this dataset from the next major release of `datasets`. warnings.warn( @@ -706,7 +702,7 @@ model. .. parsed-literal:: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/configuration_utils.py:139: FutureWarning: Accessing config attribute `_execution_device` directly via 'AmusedPipeline' object attribute is deprecated. Please access '_execution_device' over 'AmusedPipeline's config object instead, e.g. 'scheduler.config._execution_device'. + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/configuration_utils.py:140: FutureWarning: Accessing config attribute `_execution_device` directly via 'AmusedPipeline' object attribute is deprecated. Please access '_execution_device' over 'AmusedPipeline's config object instead, e.g. 'scheduler.config._execution_device'. deprecate("direct config name access", "1.0.0", deprecation_message, standard_warn=False) @@ -784,17 +780,17 @@ model. .. parsed-literal:: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/experimental/tensor/tensor.py:84: RuntimeWarning: invalid value encountered in multiply + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/experimental/tensor/tensor.py:84: RuntimeWarning: invalid value encountered in multiply return Tensor(self.data * unwrap_tensor_data(other)) - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/experimental/tensor/tensor.py:84: RuntimeWarning: invalid value encountered in multiply + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/experimental/tensor/tensor.py:84: RuntimeWarning: invalid value encountered in multiply return Tensor(self.data * unwrap_tensor_data(other)) - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/experimental/tensor/tensor.py:84: RuntimeWarning: invalid value encountered in multiply + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/experimental/tensor/tensor.py:84: RuntimeWarning: invalid value encountered in multiply return Tensor(self.data * unwrap_tensor_data(other)) - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/experimental/tensor/tensor.py:84: RuntimeWarning: invalid value encountered in multiply + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/experimental/tensor/tensor.py:84: RuntimeWarning: invalid value encountered in multiply return Tensor(self.data * unwrap_tensor_data(other)) - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/experimental/tensor/tensor.py:84: RuntimeWarning: invalid value encountered in multiply + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/experimental/tensor/tensor.py:84: RuntimeWarning: invalid value encountered in multiply return Tensor(self.data * unwrap_tensor_data(other)) - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/experimental/tensor/tensor.py:84: RuntimeWarning: invalid value encountered in multiply + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/experimental/tensor/tensor.py:84: RuntimeWarning: invalid value encountered in multiply return Tensor(self.data * unwrap_tensor_data(other)) @@ -826,7 +822,7 @@ Demo generation with quantized pipeline .. parsed-literal:: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/configuration_utils.py:139: FutureWarning: Accessing config attribute `_execution_device` directly via 'AmusedPipeline' object attribute is deprecated. Please access '_execution_device' over 'AmusedPipeline's config object instead, e.g. 'scheduler.config._execution_device'. + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/configuration_utils.py:140: FutureWarning: Accessing config attribute `_execution_device` directly via 'AmusedPipeline' object attribute is deprecated. Please access '_execution_device' over 'AmusedPipeline's config object instead, e.g. 'scheduler.config._execution_device'. deprecate("direct config name access", "1.0.0", deprecation_message, standard_warn=False) @@ -910,7 +906,11 @@ a rough estimate of generation quality. .. parsed-literal:: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/torchmetrics/utilities/prints.py:43: UserWarning: Metric `InceptionScore` will save all extracted features in buffer. For large datasets this may lead to large memory footprint. + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/datasets/load.py:1491: FutureWarning: The repository for conceptual_captions contains custom code which must be executed to correctly load the dataset. You can inspect the repository content at https://hf.co/datasets/conceptual_captions + You can avoid this message in future by passing the argument `trust_remote_code=True`. + Passing `trust_remote_code=True` will be mandatory to load this dataset from the next major release of `datasets`. + warnings.warn( + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/torchmetrics/utilities/prints.py:43: UserWarning: Metric `InceptionScore` will save all extracted features in buffer. For large datasets this may lead to large memory footprint. warnings.warn(\*args, \*\*kwargs) # noqa: B028 @@ -922,9 +922,9 @@ a rough estimate of generation quality. .. parsed-literal:: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/configuration_utils.py:139: FutureWarning: Accessing config attribute `_execution_device` directly via 'AmusedPipeline' object attribute is deprecated. Please access '_execution_device' over 'AmusedPipeline's config object instead, e.g. 'scheduler.config._execution_device'. + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/configuration_utils.py:140: FutureWarning: Accessing config attribute `_execution_device` directly via 'AmusedPipeline' object attribute is deprecated. Please access '_execution_device' over 'AmusedPipeline's config object instead, e.g. 'scheduler.config._execution_device'. deprecate("direct config name access", "1.0.0", deprecation_message, standard_warn=False) - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/torchmetrics/image/inception.py:176: UserWarning: std(): degrees of freedom is <= 0. Correction should be strictly less than the reduction factor (input numel divided by output numel). (Triggered internally at ../aten/src/ATen/native/ReduceOps.cpp:1807.) + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/torchmetrics/image/inception.py:176: UserWarning: std(): degrees of freedom is <= 0. Correction should be strictly less than the reduction factor (input numel divided by output numel). (Triggered internally at ../aten/src/ATen/native/ReduceOps.cpp:1807.) return kl.mean(), kl.std() diff --git a/docs/notebooks/animate-anyone-with-output.rst b/docs/notebooks/animate-anyone-with-output.rst index c07b1321d80..9312ff261b1 100644 --- a/docs/notebooks/animate-anyone-with-output.rst +++ b/docs/notebooks/animate-anyone-with-output.rst @@ -64,7 +64,8 @@ Table of contents: - `Video post-processing <#video-post-processing>`__ - `Interactive inference <#interactive-inference>`__ -.. |image0| image:: https://github.com/openvinotoolkit/openvino_notebooks/raw/latest/notebooks/animate-anyone/animate-anyone.gif +.. |image0| image:: https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/notebooks/animate-anyone/animate-anyone.gif + Prerequisites ------------- @@ -153,11 +154,11 @@ Note that we clone a fork of original repo with tweaked forward methods. .. parsed-literal:: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead. + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead. torch.utils._pytree._register_pytree_node( - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead. + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead. torch.utils._pytree._register_pytree_node( - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead. + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead. torch.utils._pytree._register_pytree_node( @@ -278,13 +279,13 @@ Download weights .. parsed-literal:: - diffusion_pytorch_model.bin: 0%| | 0.00/335M [00:00`__. -.. |image1| image:: https://humanaigc.github.io/animate-anyone/static/images/f2_img.png +.. |image01| image:: https://humanaigc.github.io/animate-anyone/static/images/f2_img.png .. code:: ipython3 @@ -502,7 +503,7 @@ of the pipeline, it will be better to convert them to separate models. .. parsed-literal:: - WARNING:nncf:NNCF provides best results with torch==2.2.*, while current torch version is 2.3.0+cpu. If you encounter issues, consider switching to torch==2.2.* + WARNING:nncf:NNCF provides best results with torch==2.2.*, while current torch version is 2.3.1+cpu. If you encounter issues, consider switching to torch==2.2.* INFO:nncf:Statistics of the bitwidth distribution: ┍━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑ │ Num bits (N) │ % all parameters (layers) │ % ratio-defining parameters (layers) │ @@ -839,7 +840,7 @@ required for both reference and denoising UNets. .. parsed-literal:: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/modeling_utils.py:4371: FutureWarning: `_is_quantized_training_enabled` is going to be deprecated in transformers 4.39.0. Please use `model.hf_quantizer.is_trainable` instead + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/modeling_utils.py:4481: FutureWarning: `_is_quantized_training_enabled` is going to be deprecated in transformers 4.39.0. Please use `model.hf_quantizer.is_trainable` instead warnings.warn( @@ -1210,7 +1211,7 @@ Video post-processing .. raw:: html diff --git a/docs/notebooks/async-api-with-output.rst b/docs/notebooks/async-api-with-output.rst index b7d53ad0cd1..73435822bba 100644 --- a/docs/notebooks/async-api-with-output.rst +++ b/docs/notebooks/async-api-with-output.rst @@ -352,7 +352,7 @@ Test performance in Sync Mode .. parsed-literal:: Source ended - average throuput in sync mode: 43.35 fps + average throuput in sync mode: 60.54 fps Async Mode @@ -491,7 +491,7 @@ Test the performance in Async Mode .. parsed-literal:: Source ended - average throuput in async mode: 73.97 fps + average throuput in async mode: 103.70 fps Compare the performance @@ -634,5 +634,5 @@ Test the performance with ``AsyncInferQueue`` .. parsed-literal:: - average throughput in async mode with async infer queue: 111.33 fps + average throughput in async mode with async infer queue: 148.11 fps diff --git a/docs/notebooks/async-api-with-output_files/async-api-with-output_23_0.png b/docs/notebooks/async-api-with-output_files/async-api-with-output_23_0.png index 07fc6bb0553..589ab949487 100644 --- a/docs/notebooks/async-api-with-output_files/async-api-with-output_23_0.png +++ b/docs/notebooks/async-api-with-output_files/async-api-with-output_23_0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c6eb6b07a2e43cfab480087829f6babef1e7050550997c85a7a6824f8c308cc3 -size 30403 +oid sha256:0d82d618fb2b2ef25ecd8ad941de1d1173b3e21a3340314cc584dca9b32d6c55 +size 29416 diff --git a/docs/notebooks/auto-device-with-output.rst b/docs/notebooks/auto-device-with-output.rst index 06c0ef2defb..d05af42d516 100644 --- a/docs/notebooks/auto-device-with-output.rst +++ b/docs/notebooks/auto-device-with-output.rst @@ -96,7 +96,7 @@ Import modules and create Core core = ov.Core() - if "GPU" not in core.available_devices: + if not any("GPU" in device for device in core.available_devices): display( Markdown( '
Warning: A GPU device is not available. This notebook requires GPU device to have meaningful results.
' @@ -186,15 +186,15 @@ By default, ``compile_model`` API will select **AUTO** as .. parsed-literal:: - [23:28:01.3129]I[plugin.cpp:418][AUTO] device:CPU, config:LOG_LEVEL=LOG_INFO - [23:28:01.3129]I[plugin.cpp:418][AUTO] device:CPU, config:PERFORMANCE_HINT=LATENCY - [23:28:01.3130]I[plugin.cpp:418][AUTO] device:CPU, config:PERFORMANCE_HINT_NUM_REQUESTS=0 - [23:28:01.3130]I[plugin.cpp:418][AUTO] device:CPU, config:PERF_COUNT=NO - [23:28:01.3130]I[plugin.cpp:423][AUTO] device:CPU, priority:0 - [23:28:01.3130]I[schedule.cpp:17][AUTO] scheduler starting - [23:28:01.3130]I[auto_schedule.cpp:131][AUTO] select device:CPU - [23:28:01.4657]I[auto_schedule.cpp:109][AUTO] device:CPU compiling model finished - [23:28:01.4659]I[plugin.cpp:451][AUTO] underlying hardware does not support hardware context + [23:27:27.6972]I[plugin.cpp:418][AUTO] device:CPU, config:LOG_LEVEL=LOG_INFO + [23:27:27.6973]I[plugin.cpp:418][AUTO] device:CPU, config:PERFORMANCE_HINT=LATENCY + [23:27:27.6973]I[plugin.cpp:418][AUTO] device:CPU, config:PERFORMANCE_HINT_NUM_REQUESTS=0 + [23:27:27.6973]I[plugin.cpp:418][AUTO] device:CPU, config:PERF_COUNT=NO + [23:27:27.6973]I[plugin.cpp:423][AUTO] device:CPU, priority:0 + [23:27:27.6973]I[schedule.cpp:17][AUTO] scheduler starting + [23:27:27.6973]I[auto_schedule.cpp:131][AUTO] select device:CPU + [23:27:27.8462]I[auto_schedule.cpp:109][AUTO] device:CPU compiling model finished + [23:27:27.8464]I[plugin.cpp:451][AUTO] underlying hardware does not support hardware context Successfully compiled model without a device_name. @@ -208,7 +208,7 @@ By default, ``compile_model`` API will select **AUTO** as .. parsed-literal:: Deleted compiled_model - [23:28:01.4767]I[schedule.cpp:303][AUTO] scheduler ending + [23:27:27.8575]I[schedule.cpp:303][AUTO] scheduler ending Explicitly pass AUTO as device_name to Core::compile_model API @@ -318,7 +318,7 @@ Load the model to GPU device and perform inference .. code:: ipython3 - if "GPU" not in core.available_devices: + if not any("GPU" in device for device in core.available_devices): print(f"A GPU device is not available. Available devices are: {core.available_devices}") else: # Start time. @@ -366,7 +366,7 @@ executed on CPU until GPU is ready. .. parsed-literal:: - Time to load model using AUTO device and get first inference: 0.18 seconds. + Time to load model using AUTO device and get first inference: 0.16 seconds. .. code:: ipython3 @@ -538,12 +538,12 @@ Loop for inference and update the FPS/Latency every Compiling Model for AUTO device with THROUGHPUT hint Start inference, 6 groups of FPS/latency will be measured over 10s intervals - throughput: 177.51fps, latency: 32.04ms, time interval: 10.01s - throughput: 179.73fps, latency: 32.54ms, time interval: 10.01s - throughput: 178.74fps, latency: 32.73ms, time interval: 10.01s - throughput: 179.46fps, latency: 32.59ms, time interval: 10.01s - throughput: 178.98fps, latency: 32.74ms, time interval: 10.02s - throughput: 178.58fps, latency: 32.79ms, time interval: 10.01s + throughput: 177.73fps, latency: 32.02ms, time interval: 10.01s + throughput: 179.52fps, latency: 32.63ms, time interval: 10.00s + throughput: 178.56fps, latency: 32.79ms, time interval: 10.00s + throughput: 177.70fps, latency: 32.99ms, time interval: 10.01s + throughput: 178.80fps, latency: 32.69ms, time interval: 10.02s + throughput: 177.72fps, latency: 33.00ms, time interval: 10.01s Done @@ -589,12 +589,12 @@ Loop for inference and update the FPS/Latency for each Compiling Model for AUTO Device with LATENCY hint Start inference, 6 groups fps/latency will be out with 10s interval - throughput: 136.40fps, latency: 6.83ms, time interval: 10.01s - throughput: 137.96fps, latency: 6.81ms, time interval: 10.00s - throughput: 137.97fps, latency: 6.80ms, time interval: 10.00s - throughput: 137.97fps, latency: 6.80ms, time interval: 10.00s - throughput: 138.06fps, latency: 6.80ms, time interval: 10.00s - throughput: 133.29fps, latency: 7.06ms, time interval: 10.01s + throughput: 135.52fps, latency: 6.87ms, time interval: 10.01s + throughput: 137.89fps, latency: 6.85ms, time interval: 10.00s + throughput: 137.71fps, latency: 6.82ms, time interval: 10.01s + throughput: 137.83fps, latency: 6.83ms, time interval: 10.01s + throughput: 137.80fps, latency: 6.83ms, time interval: 10.01s + throughput: 138.34fps, latency: 6.84ms, time interval: 10.00s Done diff --git a/docs/notebooks/auto-device-with-output_files/auto-device-with-output_27_0.png b/docs/notebooks/auto-device-with-output_files/auto-device-with-output_27_0.png index dbe3a0edb38..9e2d67fe539 100644 --- a/docs/notebooks/auto-device-with-output_files/auto-device-with-output_27_0.png +++ b/docs/notebooks/auto-device-with-output_files/auto-device-with-output_27_0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d644b71f335dd26763dfad14f93ba1ff32ffe30cfdbe3ac06d1c7346aaba3985 -size 27550 +oid sha256:50f5fe192a152bfb8036a782ee93ab26543c9a30fc626e67aab5e5a7dba9e35a +size 27240 diff --git a/docs/notebooks/auto-device-with-output_files/auto-device-with-output_28_0.png b/docs/notebooks/auto-device-with-output_files/auto-device-with-output_28_0.png index 0e617d97958..1f42981e0fb 100644 --- a/docs/notebooks/auto-device-with-output_files/auto-device-with-output_28_0.png +++ b/docs/notebooks/auto-device-with-output_files/auto-device-with-output_28_0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b3e6b932de9fd81a384cccede0ed571c920f68e6a9176ce2d84cee626bb03f05 -size 40115 +oid sha256:5a4bfe1e79236b08d4848e6ff59eccf1e2c459d74cb8940b54e8cad3ef01a948 +size 40033 diff --git a/docs/notebooks/clip-zero-shot-classification-with-output.rst b/docs/notebooks/clip-zero-shot-classification-with-output.rst index 495813ec267..40cca0e2ec9 100644 --- a/docs/notebooks/clip-zero-shot-classification-with-output.rst +++ b/docs/notebooks/clip-zero-shot-classification-with-output.rst @@ -102,9 +102,9 @@ tokenizer and preparing the images. .. code:: ipython3 import platform - + %pip install -q --extra-index-url https://download.pytorch.org/whl/cpu "gradio>=4.19" "openvino>=2023.1.0" "transformers[torch]>=4.30" "datasets" "nncf>=2.6.0" "torch>=2.1" Pillow - + if platform.system() != "Windows": %pip install -q "matplotlib>=3.4" else: @@ -119,7 +119,7 @@ tokenizer and preparing the images. .. code:: ipython3 from transformers import CLIPProcessor, CLIPModel - + # load pre-trained model model = CLIPModel.from_pretrained("openai/clip-vit-base-patch16") # load preprocessor for model input @@ -141,8 +141,8 @@ tokenizer and preparing the images. import matplotlib.pyplot as plt import numpy as np from PIL import Image - - + + def visualize_result(image: Image, labels: List[str], probs: np.ndarray, top: int = 5): """ Utility function for visualization classification results @@ -160,7 +160,7 @@ tokenizer and preparing the images. plt.subplot(8, 8, 1) plt.imshow(image) plt.axis("off") - + plt.subplot(8, 8, 2) y = np.arange(top_probs.shape[-1]) plt.grid() @@ -189,17 +189,17 @@ similarity score for the final result. import requests from pathlib import Path - - + + sample_path = Path("data/coco.jpg") sample_path.parent.mkdir(parents=True, exist_ok=True) r = requests.get("https://storage.openvinotoolkit.org/repositories/openvino_notebooks/data/data/image/coco.jpg") - + with sample_path.open("wb") as f: f.write(r.content) - + image = Image.open(sample_path) - + input_labels = [ "cat", "dog", @@ -213,9 +213,9 @@ similarity score for the final result. "computer", ] text_descriptions = [f"This is a photo of a {label}" for label in input_labels] - + inputs = processor(text=text_descriptions, images=[image], return_tensors="pt", padding=True) - + results = model(**inputs) logits_per_image = results["logits_per_image"] # this is the image-text similarity score probs = logits_per_image.softmax(dim=1).detach().numpy() # we can take the softmax to get the label probabilities @@ -243,10 +243,10 @@ save it on disk for the next usage with ``ov.save_model``. .. code:: ipython3 import openvino as ov - + fp16_model_path = Path("clip-vit-base-patch16.xml") model.config.torchscript = True - + if not fp16_model_path.exists(): ov_model = ov.convert_model(model, example_input=dict(inputs)) ov.save_model(ov_model, fp16_model_path) @@ -263,7 +263,7 @@ same input data from the example above with PyTorch. .. code:: ipython3 from scipy.special import softmax - + # create OpenVINO core object instance core = ov.Core() @@ -277,14 +277,14 @@ select device from dropdown list for running inference using OpenVINO .. code:: ipython3 import ipywidgets as widgets - + device = widgets.Dropdown( options=core.available_devices + ["AUTO"], value="AUTO", description="Device:", disabled=False, ) - + device @@ -317,8 +317,6 @@ Great! Looks like we got the same result. Quantize model to INT8 using NNCF --------------------------------- - ## Quantize model to INT8 using -NNCF The goal of this part of tutorial is to demonstrate how to speed up the model by applying 8-bit post-training quantization from @@ -349,7 +347,7 @@ inference faster. The optimization process contains the following steps: description="Quantization", disabled=False, ) - + to_quantize @@ -368,7 +366,7 @@ inference faster. The optimization process contains the following steps: url="https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/skip_kernel_extension.py", ) open("skip_kernel_extension.py", "w").write(r.text) - + %load_ext skip_kernel_extension Prepare datasets @@ -384,16 +382,16 @@ model. .. code:: ipython3 %%skip not $to_quantize.value - + import requests from io import BytesIO import numpy as np from PIL import Image from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) - + max_length = model.config.text_config.max_position_embeddings - + def check_text_data(data): """ Check if the given data is text-based. @@ -403,7 +401,7 @@ model. if isinstance(data, list): return all(isinstance(x, str) for x in data) return False - + def get_pil_from_url(url): """ Downloads and converts an image from a URL to a PIL Image object. @@ -411,7 +409,7 @@ model. response = requests.get(url, verify=False, timeout=20) image = Image.open(BytesIO(response.content)) return image.convert("RGB") - + def collate_fn(example, image_column="image_url", text_column="caption"): """ Preprocesses an example by loading and transforming image and text data. @@ -422,10 +420,10 @@ model. """ assert len(example) == 1 example = example[0] - + if not check_text_data(example[text_column]): raise ValueError("Text data is not valid") - + url = example[image_column] try: image = get_pil_from_url(url) @@ -434,7 +432,7 @@ model. return None except Exception: return None - + inputs = processor(text=example[text_column], images=[image], return_tensors="pt", padding=True) if inputs['input_ids'].shape[1] > max_length: return None @@ -443,11 +441,11 @@ model. .. code:: ipython3 %%skip not $to_quantize.value - + import torch from datasets import load_dataset from tqdm.notebook import tqdm - + def prepare_calibration_data(dataloader, init_steps): """ This function prepares calibration data from a dataloader for a specified number of initialization steps. @@ -470,8 +468,8 @@ model. } ) return data - - + + def prepare_dataset(opt_init_steps=50, max_train_samples=1000): """ Prepares a vision-text dataset for quantization. @@ -485,14 +483,14 @@ model. .. code:: ipython3 %%skip not $to_quantize.value - + import logging import nncf - + core = ov.Core() - + nncf.set_log_level(logging.ERROR) - + int8_model_path = 'clip-vit-base-patch16_int8.xml' calibration_data = prepare_dataset() ov_model = core.read_model(fp16_model_path) @@ -535,12 +533,12 @@ Create a quantized model from the pre-trained ``FP16`` model. .. code:: ipython3 %%skip not $to_quantize.value - + if len(calibration_data) == 0: raise RuntimeError( 'Calibration dataset is empty. Please check internet connection and try to download images manually.' ) - + calibration_dataset = nncf.Dataset(calibration_data) quantized_model = nncf.quantize( model=ov_model, @@ -654,7 +652,7 @@ the same input data that we used before. .. code:: ipython3 %%skip not $to_quantize.value - + # compile model for loading on device compiled_model = core.compile_model(quantized_model, device.value) # run inference on preprocessed data and get image-text similarity score @@ -679,9 +677,9 @@ Compare File Size .. code:: ipython3 %%skip not $to_quantize.value - + from pathlib import Path - + fp16_ir_model_size = Path(fp16_model_path).with_suffix(".bin").stat().st_size / 1024 / 1024 quantized_model_size = Path(int8_model_path).with_suffix(".bin").stat().st_size / 1024 / 1024 print(f"FP16 IR model size: {fp16_ir_model_size:.2f} MB") @@ -711,9 +709,9 @@ up of the dynamic quantized models. .. code:: ipython3 %%skip not $to_quantize.value - + import time - + def calculate_inference_time(model_path, calibration_data): model = core.compile_model(model_path, device.value) inference_time = [] @@ -728,7 +726,7 @@ up of the dynamic quantized models. .. code:: ipython3 %%skip not $to_quantize.value - + fp16_latency = calculate_inference_time(fp16_model_path, calibration_data) int8_latency = calculate_inference_time(int8_model_path, calibration_data) print(f"Performance speed up: {fp16_latency / int8_latency:.3f}") @@ -742,8 +740,6 @@ up of the dynamic quantized models. Interactive demo ---------------- - ## Interactive demo - Now, it is your turn! You can provide your own image and comma-separated list of labels for zero-shot classification. @@ -754,13 +750,13 @@ example, ``cat,dog,bird``) .. code:: ipython3 import gradio as gr - + model_path = Path("clip-vit-base-patch16-int8.xml") if not model_path.exists(): model_path = Path("clip-vit-base-patch16.xml") compiled_model = core.compile_model(model_path, device.value) - - + + def classify(image, text): """Classify image using classes listing. Args: @@ -774,10 +770,10 @@ example, ``cat,dog,bird``) inputs = processor(text=text_descriptions, images=[image], return_tensors="np", padding=True) ov_logits_per_image = compiled_model(dict(inputs))[0] probs = softmax(ov_logits_per_image, axis=1)[0] - + return {label: float(prob) for label, prob in zip(labels, probs)} - - + + demo = gr.Interface( classify, [ diff --git a/docs/notebooks/convert-to-openvino-with-output.rst b/docs/notebooks/convert-to-openvino-with-output.rst index 60b730e4f49..c3a12ea70bd 100644 --- a/docs/notebooks/convert-to-openvino-with-output.rst +++ b/docs/notebooks/convert-to-openvino-with-output.rst @@ -35,7 +35,7 @@ Table of contents: .. parsed-literal:: - Requirement already satisfied: pip in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (24.0) + Requirement already satisfied: pip in /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages (24.0) Note: you may need to restart the kernel to use updated packages. Note: you may need to restart the kernel to use updated packages. @@ -181,13 +181,11 @@ NLP model from Hugging Face and export it in ONNX format: .. parsed-literal:: - 2024-05-15 23:49:16.064636: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. - 2024-05-15 23:49:16.099980: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. + 2024-06-05 23:48:38.001731: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. + 2024-06-05 23:48:38.036985: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. - 2024-05-15 23:49:16.617080: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`. - warnings.warn( - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/distilbert/modeling_distilbert.py:234: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect. + 2024-06-05 23:48:38.551703: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/transformers/models/distilbert/modeling_distilbert.py:231: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect. mask, torch.tensor(torch.finfo(scores.dtype).min) @@ -664,12 +662,12 @@ frameworks conversion guides. .. parsed-literal:: - 2024-05-15 23:49:36.583572: E tensorflow/compiler/xla/stream_executor/cuda/cuda_driver.cc:266] failed call to cuInit: CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE: forward compatibility was attempted on non supported HW - 2024-05-15 23:49:36.583606: I tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:168] retrieving CUDA diagnostic information for host: iotg-dev-workstation-07 - 2024-05-15 23:49:36.583610: I tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:175] hostname: iotg-dev-workstation-07 - 2024-05-15 23:49:36.583842: I tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:199] libcuda reported version is: 470.223.2 - 2024-05-15 23:49:36.583866: I tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:203] kernel reported version is: 470.182.3 - 2024-05-15 23:49:36.583871: E tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:312] kernel version 470.182.3 does not match DSO version 470.223.2 -- cannot find working devices in this configuration + 2024-06-05 23:48:58.596260: E tensorflow/compiler/xla/stream_executor/cuda/cuda_driver.cc:266] failed call to cuInit: CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE: forward compatibility was attempted on non supported HW + 2024-06-05 23:48:58.596295: I tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:168] retrieving CUDA diagnostic information for host: iotg-dev-workstation-07 + 2024-06-05 23:48:58.596299: I tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:175] hostname: iotg-dev-workstation-07 + 2024-06-05 23:48:58.596508: I tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:199] libcuda reported version is: 470.223.2 + 2024-06-05 23:48:58.596524: I tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:203] kernel reported version is: 470.182.3 + 2024-06-05 23:48:58.596528: E tensorflow/compiler/xla/stream_executor/cuda/cuda_diagnostics.cc:312] kernel version 470.182.3 does not match DSO version 470.223.2 -- cannot find working devices in this configuration Migration from Legacy conversion API diff --git a/docs/notebooks/convnext-classification-with-output.rst b/docs/notebooks/convnext-classification-with-output.rst index 692982069bd..6e7c73162fa 100644 --- a/docs/notebooks/convnext-classification-with-output.rst +++ b/docs/notebooks/convnext-classification-with-output.rst @@ -183,7 +183,7 @@ And print results Predicted Class: 281 Predicted Label: n02123045 tabby, tabby cat - Predicted Probability: 0.4661690592765808 + Predicted Probability: 0.5808374285697937 Convert the model to OpenVINO Intermediate representation format diff --git a/docs/notebooks/cross-lingual-books-alignment-with-output.rst b/docs/notebooks/cross-lingual-books-alignment-with-output.rst index fb79d3ab196..f80b3eb809c 100644 --- a/docs/notebooks/cross-lingual-books-alignment-with-output.rst +++ b/docs/notebooks/cross-lingual-books-alignment-with-output.rst @@ -197,7 +197,7 @@ which in a raw format looks like this: .. parsed-literal:: - '\ufeffThe Project Gutenberg eBook of Anna Karenina\r\n \r\nThis ebook is for the use of anyone anywhere in the United States and\r\nmost other parts of the world at no cost and with almost no restrictions\r\nwhatsoever. You may copy it, give it away or re-use it under the terms\r\nof the Project Gutenberg License included with this ebook or online\r\nat www.gutenberg.org. If you are not located in the United States,\r\nyou will have to check the laws of the country where you are located\r\nbefore using this eBook.\r\n\r\nTitle: Anna Karenina\r\n\r\n\r\nAuthor: graf Leo Tolstoy\r\n\r\nTranslator: Constance Garnett\r\n\r\nRelease date: July 1, 1998 [eBook #1399]\r\n Most recently updated: April 9, 2023\r\n\r\nLanguage: English\r\n\r\n\r\n\r\n*** START OF THE PROJECT GUTENBERG EBOOK ANNA KARENINA \*\*\*\r\n[Illustration]\r\n\r\n\r\n\r\n\r\n ANNA KARENINA \r\n\r\n by Leo Tolstoy \r\n\r\n Translated by Constance Garnett \r\n\r\nContents\r\n\r\n\r\n PART ONE\r\n PART TWO\r\n PART THREE\r\n PART FOUR\r\n PART FIVE\r\n PART SIX\r\n PART SEVEN\r\n PART EIGHT\r\n\r\n\r\n\r\n\r\nPART ONE\r\n\r\nChapter 1\r\n\r\n\r\nHappy families are all alike; every unhappy family is unhappy in its\r\nown way.\r\n\r\nEverything was in confusion in the Oblonskys’ house. The wife had\r\ndiscovered that the husband was carrying on an intrigue with a French\r\ngirl, who had been a governess in their family, and she had announced\r\nto her husband that she could not go on living in the same house with\r\nhim. This position of affairs had now lasted three days, and not only\r\nthe husband and wife themselves, but all the me' + '\ufeffThe Project Gutenberg eBook of Anna Karenina\r\n \r\nThis ebook is for the use of anyone anywhere in the United States and\r\nmost other parts of the world at no cost and with almost no restrictions\r\nwhatsoever. You may copy it, give it away or re-use it under the terms\r\nof the Project Gutenberg License included with this ebook or online\r\nat www.gutenberg.org. If you are not located in the United States,\r\nyou will have to check the laws of the country where you are located\r\nbefore using this eBook.\r\n\r\nTitle: Anna Karenina\r\n\r\n\r\nAuthor: graf Leo Tolstoy\r\n\r\nTranslator: Constance Garnett\r\n\r\nRelease date: July 1, 1998 [eBook #1399]\r\n Most recently updated: April 9, 2023\r\n\r\nLanguage: English\r\n\r\n\r\n\r\n\*\*\* START OF THE PROJECT GUTENBERG EBOOK ANNA KARENINA \*\*\*\r\n[Illustration]\r\n\r\n\r\n\r\n\r\n ANNA KARENINA \r\n\r\n by Leo Tolstoy \r\n\r\n Translated by Constance Garnett \r\n\r\nContents\r\n\r\n\r\n PART ONE\r\n PART TWO\r\n PART THREE\r\n PART FOUR\r\n PART FIVE\r\n PART SIX\r\n PART SEVEN\r\n PART EIGHT\r\n\r\n\r\n\r\n\r\nPART ONE\r\n\r\nChapter 1\r\n\r\n\r\nHappy families are all alike; every unhappy family is unhappy in its\r\nown way.\r\n\r\nEverything was in confusion in the Oblonskys’ house. The wife had\r\ndiscovered that the husband was carrying on an intrigue with a French\r\ngirl, who had been a governess in their family, and she had announced\r\nto her husband that she could not go on living in the same house with\r\nhim. This position of affairs had now lasted three days, and not only\r\nthe husband and wife themselves, but all the me' @@ -210,7 +210,7 @@ which in a raw format looks like this: .. parsed-literal:: - 'The Project Gutenberg EBook of Anna Karenina, 1. Band, by Leo N. Tolstoi\r\n\r\nThis eBook is for the use of anyone anywhere at no cost and with\r\nalmost no restrictions whatsoever. You may copy it, give it away or\r\nre-use it under the terms of the Project Gutenberg License included\r\nwith this eBook or online at www.gutenberg.org\r\n\r\n\r\nTitle: Anna Karenina, 1. Band\r\n\r\nAuthor: Leo N. Tolstoi\r\n\r\nRelease Date: February 18, 2014 [EBook #44956]\r\n\r\nLanguage: German\r\n\r\nCharacter set encoding: ISO-8859-1\r\n\r\n\*\*\* START OF THIS PROJECT GUTENBERG EBOOK ANNA KARENINA, 1. BAND \*\*\*\r\n\r\n\r\n\r\n\r\nProduced by Norbert H. Langkau, Jens Nordmann and the\r\nOnline Distributed Proofreading Team at http://www.pgdp.net\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n Anna Karenina.\r\n\r\n\r\n Roman aus dem Russischen\r\n\r\n des\r\n\r\n Grafen Leo N. Tolstoi.\r\n\r\n\r\n\r\n Nach der siebenten Auflage übersetzt\r\n\r\n von\r\n\r\n Hans Moser.\r\n\r\n\r\n Erster Band.\r\n\r\n\r\n\r\n Leipzig\r\n\r\n Druck und Verlag von Philipp Reclam jun.\r\n\r\n \* \* \* \* *\r\n\r\n\r\n\r\n\r\n Erster Teil.\r\n\r\n »Die Rache ist mein, ich will vergelten.«\r\n\r\n 1.\r\n\r\n\r\nAlle glücklichen Familien sind einander ähnlich; jede unglücklich' + 'The Project Gutenberg EBook of Anna Karenina, 1. Band, by Leo N. Tolstoi\r\n\r\nThis eBook is for the use of anyone anywhere at no cost and with\r\nalmost no restrictions whatsoever. You may copy it, give it away or\r\nre-use it under the terms of the Project Gutenberg License included\r\nwith this eBook or online at www.gutenberg.org\r\n\r\n\r\nTitle: Anna Karenina, 1. Band\r\n\r\nAuthor: Leo N. Tolstoi\r\n\r\nRelease Date: February 18, 2014 [EBook #44956]\r\n\r\nLanguage: German\r\n\r\nCharacter set encoding: ISO-8859-1\r\n\r\n\*\*\* START OF THIS PROJECT GUTENBERG EBOOK ANNA KARENINA, 1. BAND \*\*\*\r\n\r\n\r\n\r\n\r\nProduced by Norbert H. Langkau, Jens Nordmann and the\r\nOnline Distributed Proofreading Team at http://www.pgdp.net\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n Anna Karenina.\r\n\r\n\r\n Roman aus dem Russischen\r\n\r\n des\r\n\r\n Grafen Leo N. Tolstoi.\r\n\r\n\r\n\r\n Nach der siebenten Auflage übersetzt\r\n\r\n von\r\n\r\n Hans Moser.\r\n\r\n\r\n Erster Band.\r\n\r\n\r\n\r\n Leipzig\r\n\r\n Druck und Verlag von Philipp Reclam jun.\r\n\r\n * * * * *\r\n\r\n\r\n\r\n\r\n Erster Teil.\r\n\r\n »Die Rache ist mein, ich will vergelten.«\r\n\r\n 1.\r\n\r\n\r\nAlle glücklichen Familien sind einander ähnlich; jede unglücklich' @@ -407,12 +407,12 @@ languages. It has the same architecture as the BERT model but has been trained on a different task: to produce identical embeddings for translation pairs. -|image1| +|image01| This makes LaBSE a great choice for our task and it can be reused for different language pairs still producing good results. -.. |image1| image:: https://github.com/openvinotoolkit/openvino_notebooks/assets/29454499/627d3a39-7076-479f-a7b1-392f49a0b83e +.. |image01| image:: https://github.com/openvinotoolkit/openvino_notebooks/assets/29454499/627d3a39-7076-479f-a7b1-392f49a0b83e .. code:: ipython3 diff --git a/docs/notebooks/ct-segmentation-quantize-nncf-with-output.rst b/docs/notebooks/ct-segmentation-quantize-nncf-with-output.rst index c2991dc95a3..602a5753f5c 100644 --- a/docs/notebooks/ct-segmentation-quantize-nncf-with-output.rst +++ b/docs/notebooks/ct-segmentation-quantize-nncf-with-output.rst @@ -152,10 +152,10 @@ Imports .. parsed-literal:: - 2024-05-15 23:50:56.536543: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. - 2024-05-15 23:50:56.573924: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. + 2024-06-05 23:50:19.239580: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. + 2024-06-05 23:50:19.274774: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. - 2024-05-15 23:50:57.174238: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT + 2024-06-05 23:50:19.860831: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT .. parsed-literal:: @@ -435,7 +435,7 @@ this notebook. .. parsed-literal:: [ WARNING ] Please fix your imports. Module %s has been moved to %s. The old module will be deleted in version %s. - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/monai/networks/nets/basic_unet.py:168: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/monai/networks/nets/basic_unet.py:168: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if x_e.shape[-i - 1] != x_0.shape[-i - 1]: @@ -534,18 +534,18 @@ Convert quantized model to OpenVINO IR model and save it. .. parsed-literal:: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/torch/quantization/layers.py:337: TracerWarning: Converting a tensor to a Python number might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/torch/quantization/layers.py:337: TracerWarning: Converting a tensor to a Python number might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! return self._level_low.item() - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/torch/quantization/layers.py:345: TracerWarning: Converting a tensor to a Python number might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/nncf/torch/quantization/layers.py:345: TracerWarning: Converting a tensor to a Python number might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! return self._level_high.item() - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/monai/networks/nets/basic_unet.py:168: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/monai/networks/nets/basic_unet.py:168: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if x_e.shape[-i - 1] != x_0.shape[-i - 1]: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/torch/jit/_trace.py:1116: TracerWarning: Output nr 1. of the traced function does not match the corresponding output of the Python function. Detailed error: + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/torch/jit/_trace.py:1116: TracerWarning: Output nr 1. of the traced function does not match the corresponding output of the Python function. Detailed error: Tensor-likes are not close! - Mismatched elements: 247888 / 262144 (94.6%) - Greatest absolute difference: 6.055658936500549 at index (0, 0, 158, 273) (up to 1e-05 allowed) - Greatest relative difference: 13834.454856259192 at index (0, 0, 343, 273) (up to 1e-05 allowed) + Mismatched elements: 249914 / 262144 (95.3%) + Greatest absolute difference: 4.319500803947449 at index (0, 0, 125, 295) (up to 1e-05 allowed) + Greatest relative difference: 10952.699411314505 at index (0, 0, 220, 387) (up to 1e-05 allowed) _check_trace( @@ -679,7 +679,7 @@ be run in the notebook with ``! benchmark_app`` or [ WARNING ] Performance hint was not explicitly specified in command line. Device(AUTO) performance hint will be set to PerformanceMode.LATENCY. [Step 4/11] Reading model files [ INFO ] Loading model files - [ INFO ] Read model took 8.68 ms + [ INFO ] Read model took 8.75 ms [ INFO ] Original model I/O parameters: [ INFO ] Model inputs: [ INFO ] x (node: x) : f32 / [...] / [?,?,?,?] @@ -693,7 +693,7 @@ be run in the notebook with ``! benchmark_app`` or [ INFO ] Model outputs: [ INFO ] ***NO_NAME*** (node: __module.final_conv/aten::_convolution/Add) : f32 / [...] / [?,1,16..,16..] [Step 7/11] Loading the model to the device - [ INFO ] Compile model took 149.48 ms + [ INFO ] Compile model took 150.71 ms [Step 8/11] Querying optimal runtime parameters [ INFO ] Model: [ INFO ] NETWORK_NAME: Model0 @@ -728,9 +728,9 @@ be run in the notebook with ``! benchmark_app`` or [Step 9/11] Creating infer requests and preparing input tensors [ ERROR ] Input x is dynamic. Provide data shapes! Traceback (most recent call last): - File "/opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/openvino/tools/benchmark/main.py", line 486, in main + File "/opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/openvino/tools/benchmark/main.py", line 486, in main data_queue = get_input_data(paths_to_input, app_inputs_info) - File "/opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/openvino/tools/benchmark/utils/inputs_filling.py", line 123, in get_input_data + File "/opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/.venv/lib/python3.8/site-packages/openvino/tools/benchmark/utils/inputs_filling.py", line 123, in get_input_data raise Exception(f"Input {info.name} is dynamic. Provide data shapes!") Exception: Input x is dynamic. Provide data shapes! @@ -758,7 +758,7 @@ be run in the notebook with ``! benchmark_app`` or [ WARNING ] Performance hint was not explicitly specified in command line. Device(AUTO) performance hint will be set to PerformanceMode.LATENCY. [Step 4/11] Reading model files [ INFO ] Loading model files - [ INFO ] Read model took 10.82 ms + [ INFO ] Read model took 10.69 ms [ INFO ] Original model I/O parameters: [ INFO ] Model inputs: [ INFO ] x (node: x) : f32 / [...] / [1,1,512,512] @@ -772,7 +772,7 @@ be run in the notebook with ``! benchmark_app`` or [ INFO ] Model outputs: [ INFO ] ***NO_NAME*** (node: __module.final_conv/aten::_convolution/Add) : f32 / [...] / [1,1,512,512] [Step 7/11] Loading the model to the device - [ INFO ] Compile model took 257.40 ms + [ INFO ] Compile model took 275.30 ms [Step 8/11] Querying optimal runtime parameters [ INFO ] Model: [ INFO ] NETWORK_NAME: Model49 @@ -809,17 +809,17 @@ be run in the notebook with ``! benchmark_app`` or [ INFO ] Fill input 'x' with random values [Step 10/11] Measuring performance (Start inference synchronously, limits: 15000 ms duration) [ INFO ] Benchmarking in inference only mode (inputs filling are not included in measurement loop). - [ INFO ] First inference took 27.38 ms + [ INFO ] First inference took 29.48 ms [Step 11/11] Dumping statistics report [ INFO ] Execution Devices:['CPU'] - [ INFO ] Count: 959 iterations - [ INFO ] Duration: 15011.96 ms + [ INFO ] Count: 969 iterations + [ INFO ] Duration: 15001.31 ms [ INFO ] Latency: - [ INFO ] Median: 15.40 ms - [ INFO ] Average: 15.45 ms - [ INFO ] Min: 15.18 ms - [ INFO ] Max: 17.18 ms - [ INFO ] Throughput: 63.88 FPS + [ INFO ] Median: 15.23 ms + [ INFO ] Average: 15.28 ms + [ INFO ] Min: 14.97 ms + [ INFO ] Max: 17.10 ms + [ INFO ] Throughput: 64.59 FPS Visually Compare Inference Results @@ -904,7 +904,7 @@ seed is displayed to enable reproducing specific runs of this cell. .. parsed-literal:: - Visualizing results with seed 1715809926 + Visualizing results with seed 1717624288 @@ -987,8 +987,8 @@ performs inference, and displays the results on the frames loaded in .. parsed-literal:: - Loaded model to AUTO in 0.21 seconds. - Total time for 68 frames: 2.72 seconds, fps:25.33 + Loaded model to AUTO in 0.23 seconds. + Total time for 68 frames: 2.33 seconds, fps:29.56 References diff --git a/docs/notebooks/ct-segmentation-quantize-nncf-with-output_files/ct-segmentation-quantize-nncf-with-output_37_1.png b/docs/notebooks/ct-segmentation-quantize-nncf-with-output_files/ct-segmentation-quantize-nncf-with-output_37_1.png index b3af95598c6..60f97677de5 100644 --- a/docs/notebooks/ct-segmentation-quantize-nncf-with-output_files/ct-segmentation-quantize-nncf-with-output_37_1.png +++ b/docs/notebooks/ct-segmentation-quantize-nncf-with-output_files/ct-segmentation-quantize-nncf-with-output_37_1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:28010020834c2072a301b1a4eab4743fe594249fd6868e415af89e0dbc74892e -size 383860 +oid sha256:1a4a6ad8cf666b4ce12cb07fa53b22a2ba0257697d926d9846ee4c18752fc553 +size 380300 diff --git a/docs/notebooks/ddcolor-image-colorization-with-output.rst b/docs/notebooks/ddcolor-image-colorization-with-output.rst new file mode 100644 index 00000000000..24f1c30e773 --- /dev/null +++ b/docs/notebooks/ddcolor-image-colorization-with-output.rst @@ -0,0 +1,778 @@ +Colorize grayscale images using DDColor and OpenVINO +====================================================== + +Image colorization is the process of adding color to grayscale images. +Initially captured in black and white, these images are transformed into +vibrant, lifelike representations by estimating RGB colors. This +technology enhances both aesthetic appeal and perceptual quality. +Historically, artists manually applied colors to monochromatic +photographs, a painstaking task that could take up to a month for a +single image. However, with advancements in information technology and +the rise of deep neural networks, automated image colorization has +become increasingly important. + +DDColor is one of the most progressive methods of image colorization in +our days. It is a novel approach using dual decoders: a pixel decoder +and a query-based color decoder, that stands out in its ability to +produce photo-realistic colorization, particularly in complex scenes +with multiple objects and diverse contexts. |image0| + +More details about this approach can be found in original model +`repository `__ and +`paper `__. + +In this tutorial we consider how to convert and run DDColor using +OpenVINO. Additionally, we will demonstrate how to optimize this model +using `NNCF `__. + +🪄 Let’s start to explore magic of image colorization! + +Table of contents: +^^^^^^^^^^^^^^^^^^ + +- `Prerequisites <#prerequisites>`__ +- `Load PyTorch model <#load-pytorch-model>`__ +- `Run PyTorch model inference <#run-pytorch-model-inference>`__ +- `Convert PyTorch model to OpenVINO Intermediate + Representation <#convert-pytorch-model-to-openvino-intermediate-representation>`__ +- `Run OpenVINO model inference <#run-openvino-model-inference>`__ +- `Optimize OpenVINO model using + NNCF <#optimize-openvino-model-using-nncf>`__ + + - `Collect quantization dataset <#collect-quantization-dataset>`__ + - `Perform model quantization <#perform-model-quantization>`__ + +- `Run INT8 model inference <#run-int8-model-inference>`__ +- `Compare FP16 and INT8 model + size <#compare-fp16-and-int8-model-size>`__ +- `Compare inference time of the FP16 and INT8 + models <#compare-inference-time-of-the-fp16-and-int8-models>`__ +- `Interactive inference <#interactive-inference>`__ + +.. |image0| image:: https://github.com/piddnad/DDColor/raw/master/assets/network_arch.jpg + +Prerequisites +------------- + + + +.. code:: ipython3 + + import platform + import os + + os.environ["GIT_CLONE_PROTECTION_ACTIVE"] = "false" + + %pip install -q timm "torch>=2.1" "torchvision" "opencv_python" "pillow" "PyYAML" "scipy" "scikit-image" "datasets" "gradio>=4.19" --extra-index-url https://download.pytorch.org/whl/cpu + %pip install -Uq --pre "openvino" --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly + %pip install -q "git+https://github.com/openvinotoolkit/nncf.git" + + if platform.python_version_tuple()[1] in ["8", "9"]: + %pip install -q "gradio-imageslider<=0.0.17" "typing-extensions>=4.9.0" + else: + %pip install -q "gradio-imageslider" + + +.. parsed-literal:: + + Note: you may need to restart the kernel to use updated packages. + 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. + openvino-dev 2024.1.0 requires openvino==2024.1.0, but you have openvino 2024.3.0.dev20240605 which is incompatible. + Note: you may need to restart the kernel to use updated packages. + Note: you may need to restart the kernel to use updated packages. + Note: you may need to restart the kernel to use updated packages. + + +.. code:: ipython3 + + import sys + from pathlib import Path + + repo_dir = Path("DDColor") + + if not repo_dir.exists(): + !git clone https://github.com/piddnad/DDColor.git + + sys.path.append(str(repo_dir)) + + +.. parsed-literal:: + + Cloning into 'DDColor'... + remote: Enumerating objects: 223, done. + remote: Counting objects: 100% (69/69), done. + remote: Compressing objects: 100% (35/35), done. + remote: Total 223 (delta 51), reused 36 (delta 33), pack-reused 154 + Receiving objects: 100% (223/223), 13.34 MiB | 22.50 MiB/s, done. + Resolving deltas: 100% (72/72), done. + + +.. code:: ipython3 + + try: + from inference.colorization_pipeline_hf import DDColorHF, ImageColorizationPipelineHF + except Exception: + from inference.colorization_pipeline_hf import DDColorHF, ImageColorizationPipelineHF + +Load PyTorch model +------------------ + + + +There are several models from DDColor’s family provided in `model +repository `__. +We will use DDColor-T, the most lightweight version of ddcolor model, +but demonstrated in the tutorial steps are also applicable to other +models from DDColor family. + +.. code:: ipython3 + + import torch + + model_name = "ddcolor_paper_tiny" + + ddcolor_model = DDColorHF.from_pretrained(f"piddnad/{model_name}") + + + colorizer = ImageColorizationPipelineHF(model=ddcolor_model, input_size=512) + + ddcolor_model.to("cpu") + colorizer.device = torch.device("cpu") + + + +.. parsed-literal:: + + config.json: 0%| | 0.00/258 [00:00 lab -> get grey -> rgb + img = cv2.resize(img, (512, 512)) + img_l = cv2.cvtColor(img, cv2.COLOR_BGR2Lab)[:, :, :1] + img_gray_lab = np.concatenate((img_l, np.zeros_like(img_l), np.zeros_like(img_l)), axis=-1) + img_gray_rgb = cv2.cvtColor(img_gray_lab, cv2.COLOR_LAB2RGB) + + # Transpose HWC -> CHW and add batch dimension + tensor_gray_rgb = torch.from_numpy(img_gray_rgb.transpose((2, 0, 1))).float().unsqueeze(0) + + # Run model inference + output_ab = compiled_model(tensor_gray_rgb)[0] + + # Postprocess result + # resize ab -> concat original l -> rgb + output_ab_resize = F.interpolate(torch.from_numpy(output_ab), size=(height, width))[0].float().numpy().transpose(1, 2, 0) + output_lab = np.concatenate((orig_l, output_ab_resize), axis=-1) + output_bgr = cv2.cvtColor(output_lab, cv2.COLOR_LAB2BGR) + + output_img = (output_bgr * 255.0).round().astype(np.uint8) + + return output_img + +.. code:: ipython3 + + ov_processed_img = process(img, compiled_model) + PIL.Image.fromarray(ov_processed_img[:, :, ::-1]) + + + + +.. image:: ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_16_0.png + + + +Optimize OpenVINO model using NNCF +---------------------------------- + + + +`NNCF `__ enables +post-training quantization by adding quantization layers into model +graph and then using a subset of the training dataset to initialize the +parameters of these additional quantization layers. Quantized operations +are executed in ``INT8`` instead of ``FP32``/``FP16`` making model +inference faster. + +The optimization process contains the following steps: + +1. Create a calibration dataset for quantization. +2. Run ``nncf.quantize()`` to obtain quantized model. +3. Save the ``INT8`` model using ``openvino.save_model()`` function. + +Please select below whether you would like to run quantization to +improve model inference speed. + +.. code:: ipython3 + + to_quantize = widgets.Checkbox( + value=True, + description="Quantization", + disabled=False, + ) + + to_quantize + + + + +.. parsed-literal:: + + Checkbox(value=True, description='Quantization') + + + +.. code:: ipython3 + + import requests + + OV_INT8_COLORIZER_PATH = Path("ddcolor_int8.xml") + compiled_int8_model = None + + r = requests.get( + url="https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/skip_kernel_extension.py", + ) + open("skip_kernel_extension.py", "w").write(r.text) + + %load_ext skip_kernel_extension + +Collect quantization dataset +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + +We use a portion of +`ummagumm-a/colorization_dataset `__ +dataset from Hugging Face as calibration data. + +.. code:: ipython3 + + %%skip not $to_quantize.value + + from datasets import load_dataset + + subset_size = 300 + calibration_data = [] + + if not OV_INT8_COLORIZER_PATH.exists(): + dataset = load_dataset("ummagumm-a/colorization_dataset", split="train").shuffle(seed=42) + for idx, batch in enumerate(dataset): + if idx >= subset_size: + break + img = np.array(batch["conditioning_image"]) + img = (img / 255.0).astype(np.float32) + img = cv2.resize(img, (512, 512)) + img_l = cv2.cvtColor(np.stack([img, img, img], axis=2), cv2.COLOR_BGR2Lab)[:, :, :1] + img_gray_lab = np.concatenate((img_l, np.zeros_like(img_l), np.zeros_like(img_l)), axis=-1) + img_gray_rgb = cv2.cvtColor(img_gray_lab, cv2.COLOR_LAB2RGB) + + image = np.expand_dims(img_gray_rgb.transpose((2, 0, 1)).astype(np.float32), axis=0) + calibration_data.append(image) + + + +.. parsed-literal:: + + Downloading readme: 0%| | 0.00/574 [00:00 + + + + +.. raw:: html + +
+    
+ + + + +.. parsed-literal:: + + Output() + + + +.. raw:: html + +

+
+
+
+
+.. raw:: html
+
+    
+    
+ + + +Run INT8 model inference +------------------------ + + + +.. code:: ipython3 + + from IPython.display import display + + if OV_INT8_COLORIZER_PATH.exists(): + compiled_int8_model = core.compile_model(OV_INT8_COLORIZER_PATH, device.value) + img = cv2.imread("DDColor/assets/test_images/Ansel Adams _ Moore Photography.jpeg") + img_out = process(img, compiled_int8_model) + display(PIL.Image.fromarray(img_out[:, :, ::-1])) + + + +.. image:: ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_25_0.png + + +Compare FP16 and INT8 model size +-------------------------------- + + + +.. code:: ipython3 + + fp16_ir_model_size = OV_COLORIZER_PATH.with_suffix(".bin").stat().st_size / 2**20 + + print(f"FP16 model size: {fp16_ir_model_size:.2f} MB") + + if OV_INT8_COLORIZER_PATH.exists(): + quantized_model_size = OV_INT8_COLORIZER_PATH.with_suffix(".bin").stat().st_size / 2**20 + print(f"INT8 model size: {quantized_model_size:.2f} MB") + print(f"Model compression rate: {fp16_ir_model_size / quantized_model_size:.3f}") + + +.. parsed-literal:: + + FP16 model size: 104.89 MB + INT8 model size: 52.97 MB + Model compression rate: 1.980 + + +Compare inference time of the FP16 and INT8 models +-------------------------------------------------- + + + +To measure the inference performance of OpenVINO FP16 and INT8 models, +use `Benchmark +Tool `__. + + **NOTE**: For the most accurate performance estimation, it is + recommended to run ``benchmark_app`` in a terminal/command prompt + after closing other applications. + +.. code:: ipython3 + + !benchmark_app -m $OV_COLORIZER_PATH -d $device.value -api async -shape "[1,3,512,512]" -t 15 + + +.. parsed-literal:: + + [Step 1/11] Parsing and validating input arguments + [ INFO ] Parsing input parameters + [Step 2/11] Loading OpenVINO Runtime + [ INFO ] OpenVINO: + [ INFO ] Build ................................. 2024.3.0-15599-de4d00a5970 + [ INFO ] + [ INFO ] Device info: + [ INFO ] AUTO + [ INFO ] Build ................................. 2024.3.0-15599-de4d00a5970 + [ INFO ] + [ INFO ] + [Step 3/11] Setting device configuration + [ WARNING ] Performance hint was not explicitly specified in command line. Device(AUTO) performance hint will be set to PerformanceMode.THROUGHPUT. + [Step 4/11] Reading model files + [ INFO ] Loading model files + [ INFO ] Read model took 42.73 ms + [ INFO ] Original model I/O parameters: + [ INFO ] Model inputs: + [ INFO ] x (node: x) : f32 / [...] / [1,3,512,512] + [ INFO ] Model outputs: + [ INFO ] ***NO_NAME*** (node: __module.refine_net.0.0/aten::_convolution/Add) : f32 / [...] / [1,2,512,512] + [Step 5/11] Resizing model to match image sizes and given batch + [ INFO ] Model batch size: 1 + [ INFO ] Reshaping model: 'x': [1,3,512,512] + [ INFO ] Reshape model took 0.03 ms + [Step 6/11] Configuring input of the model + [ INFO ] Model inputs: + [ INFO ] x (node: x) : u8 / [N,C,H,W] / [1,3,512,512] + [ INFO ] Model outputs: + [ INFO ] ***NO_NAME*** (node: __module.refine_net.0.0/aten::_convolution/Add) : f32 / [...] / [1,2,512,512] + [Step 7/11] Loading the model to the device + [ INFO ] Compile model took 1527.31 ms + [Step 8/11] Querying optimal runtime parameters + [ INFO ] Model: + [ INFO ] NETWORK_NAME: Model0 + [ INFO ] EXECUTION_DEVICES: ['CPU'] + [ INFO ] PERFORMANCE_HINT: PerformanceMode.THROUGHPUT + [ INFO ] OPTIMAL_NUMBER_OF_INFER_REQUESTS: 6 + [ INFO ] MULTI_DEVICE_PRIORITIES: CPU + [ INFO ] CPU: + [ INFO ] AFFINITY: Affinity.CORE + [ INFO ] CPU_DENORMALS_OPTIMIZATION: False + [ INFO ] CPU_SPARSE_WEIGHTS_DECOMPRESSION_RATE: 1.0 + [ INFO ] DYNAMIC_QUANTIZATION_GROUP_SIZE: 0 + [ INFO ] ENABLE_CPU_PINNING: True + [ INFO ] ENABLE_HYPER_THREADING: True + [ INFO ] EXECUTION_DEVICES: ['CPU'] + [ INFO ] EXECUTION_MODE_HINT: ExecutionMode.PERFORMANCE + [ INFO ] INFERENCE_NUM_THREADS: 24 + [ INFO ] INFERENCE_PRECISION_HINT: + [ INFO ] KV_CACHE_PRECISION: + [ INFO ] LOG_LEVEL: Level.NO + [ INFO ] MODEL_DISTRIBUTION_POLICY: set() + [ INFO ] NETWORK_NAME: Model0 + [ INFO ] NUM_STREAMS: 6 + [ INFO ] OPTIMAL_NUMBER_OF_INFER_REQUESTS: 6 + [ INFO ] PERFORMANCE_HINT: THROUGHPUT + [ INFO ] PERFORMANCE_HINT_NUM_REQUESTS: 0 + [ INFO ] PERF_COUNT: NO + [ INFO ] SCHEDULING_CORE_TYPE: SchedulingCoreType.ANY_CORE + [ INFO ] MODEL_PRIORITY: Priority.MEDIUM + [ INFO ] LOADED_FROM_CACHE: False + [ INFO ] PERF_COUNT: False + [Step 9/11] Creating infer requests and preparing input tensors + [ WARNING ] No input files were given for input 'x'!. This input will be filled with random values! + [ INFO ] Fill input 'x' with random values + [Step 10/11] Measuring performance (Start inference asynchronously, 6 inference requests, limits: 15000 ms duration) + [ INFO ] Benchmarking in inference only mode (inputs filling are not included in measurement loop). + [ INFO ] First inference took 548.36 ms + [Step 11/11] Dumping statistics report + [ INFO ] Execution Devices:['CPU'] + [ INFO ] Count: 72 iterations + [ INFO ] Duration: 16675.11 ms + [ INFO ] Latency: + [ INFO ] Median: 1385.45 ms + [ INFO ] Average: 1386.39 ms + [ INFO ] Min: 1326.48 ms + [ INFO ] Max: 1447.89 ms + [ INFO ] Throughput: 4.32 FPS + + +.. code:: ipython3 + + if OV_INT8_COLORIZER_PATH.exists(): + !benchmark_app -m $OV_INT8_COLORIZER_PATH -d $device.value -api async -shape "[1,3,512,512]" -t 15 + + +.. parsed-literal:: + + [Step 1/11] Parsing and validating input arguments + [ INFO ] Parsing input parameters + [Step 2/11] Loading OpenVINO Runtime + [ INFO ] OpenVINO: + [ INFO ] Build ................................. 2024.3.0-15599-de4d00a5970 + [ INFO ] + [ INFO ] Device info: + [ INFO ] AUTO + [ INFO ] Build ................................. 2024.3.0-15599-de4d00a5970 + [ INFO ] + [ INFO ] + [Step 3/11] Setting device configuration + [ WARNING ] Performance hint was not explicitly specified in command line. Device(AUTO) performance hint will be set to PerformanceMode.THROUGHPUT. + [Step 4/11] Reading model files + [ INFO ] Loading model files + [ INFO ] Read model took 67.54 ms + [ INFO ] Original model I/O parameters: + [ INFO ] Model inputs: + [ INFO ] x (node: x) : f32 / [...] / [1,3,512,512] + [ INFO ] Model outputs: + [ INFO ] ***NO_NAME*** (node: __module.refine_net.0.0/aten::_convolution/Add) : f32 / [...] / [1,2,512,512] + [Step 5/11] Resizing model to match image sizes and given batch + [ INFO ] Model batch size: 1 + [ INFO ] Reshaping model: 'x': [1,3,512,512] + [ INFO ] Reshape model took 0.03 ms + [Step 6/11] Configuring input of the model + [ INFO ] Model inputs: + [ INFO ] x (node: x) : u8 / [N,C,H,W] / [1,3,512,512] + [ INFO ] Model outputs: + [ INFO ] ***NO_NAME*** (node: __module.refine_net.0.0/aten::_convolution/Add) : f32 / [...] / [1,2,512,512] + [Step 7/11] Loading the model to the device + [ INFO ] Compile model took 2704.43 ms + [Step 8/11] Querying optimal runtime parameters + [ INFO ] Model: + [ INFO ] NETWORK_NAME: Model0 + [ INFO ] EXECUTION_DEVICES: ['CPU'] + [ INFO ] PERFORMANCE_HINT: PerformanceMode.THROUGHPUT + [ INFO ] OPTIMAL_NUMBER_OF_INFER_REQUESTS: 6 + [ INFO ] MULTI_DEVICE_PRIORITIES: CPU + [ INFO ] CPU: + [ INFO ] AFFINITY: Affinity.CORE + [ INFO ] CPU_DENORMALS_OPTIMIZATION: False + [ INFO ] CPU_SPARSE_WEIGHTS_DECOMPRESSION_RATE: 1.0 + [ INFO ] DYNAMIC_QUANTIZATION_GROUP_SIZE: 0 + [ INFO ] ENABLE_CPU_PINNING: True + [ INFO ] ENABLE_HYPER_THREADING: True + [ INFO ] EXECUTION_DEVICES: ['CPU'] + [ INFO ] EXECUTION_MODE_HINT: ExecutionMode.PERFORMANCE + [ INFO ] INFERENCE_NUM_THREADS: 24 + [ INFO ] INFERENCE_PRECISION_HINT: + [ INFO ] KV_CACHE_PRECISION: + [ INFO ] LOG_LEVEL: Level.NO + [ INFO ] MODEL_DISTRIBUTION_POLICY: set() + [ INFO ] NETWORK_NAME: Model0 + [ INFO ] NUM_STREAMS: 6 + [ INFO ] OPTIMAL_NUMBER_OF_INFER_REQUESTS: 6 + [ INFO ] PERFORMANCE_HINT: THROUGHPUT + [ INFO ] PERFORMANCE_HINT_NUM_REQUESTS: 0 + [ INFO ] PERF_COUNT: NO + [ INFO ] SCHEDULING_CORE_TYPE: SchedulingCoreType.ANY_CORE + [ INFO ] MODEL_PRIORITY: Priority.MEDIUM + [ INFO ] LOADED_FROM_CACHE: False + [ INFO ] PERF_COUNT: False + [Step 9/11] Creating infer requests and preparing input tensors + [ WARNING ] No input files were given for input 'x'!. This input will be filled with random values! + [ INFO ] Fill input 'x' with random values + [Step 10/11] Measuring performance (Start inference asynchronously, 6 inference requests, limits: 15000 ms duration) + [ INFO ] Benchmarking in inference only mode (inputs filling are not included in measurement loop). + [ INFO ] First inference took 290.81 ms + [Step 11/11] Dumping statistics report + [ INFO ] Execution Devices:['CPU'] + [ INFO ] Count: 150 iterations + [ INFO ] Duration: 15775.52 ms + [ INFO ] Latency: + [ INFO ] Median: 627.63 ms + [ INFO ] Average: 626.88 ms + [ INFO ] Min: 535.42 ms + [ INFO ] Max: 721.71 ms + [ INFO ] Throughput: 9.51 FPS + + +Interactive inference +--------------------- + + + +.. code:: ipython3 + + import gradio as gr + from gradio_imageslider import ImageSlider + from functools import partial + + + def generate(image, use_int8=True): + image_in = cv2.imread(image) + image_out = process(image_in, compiled_model if not use_int8 else compiled_int8_model) + image_in_pil = PIL.Image.fromarray(cv2.cvtColor(image_in, cv2.COLOR_BGR2RGB)) + image_out_pil = PIL.Image.fromarray(cv2.cvtColor(image_out, cv2.COLOR_BGR2RGB)) + return (image_in_pil, image_out_pil) + + + with gr.Blocks() as demo: + with gr.Row(equal_height=False): + image = gr.Image(type="filepath") + with gr.Column(): + output_image = ImageSlider(show_label=True, type="filepath", interactive=False, label="FP16 model output") + button = gr.Button(value="Run{}".format(" FP16 model" if compiled_int8_model is not None else "")) + with gr.Column(visible=compiled_int8_model is not None): + output_image_int8 = ImageSlider(show_label=True, type="filepath", interactive=False, label="INT8 model output") + button_i8 = gr.Button(value="Run INT8 model") + button.click(fn=partial(generate, use_int8=False), inputs=[image], outputs=[output_image]) + button_i8.click(fn=partial(generate, use_int8=True), inputs=[image], outputs=[output_image_int8]) + examples = gr.Examples( + [ + "DDColor/assets/test_images/New York Riverfront December 15, 1931.jpg", + "DDColor/assets/test_images/Audrey Hepburn.jpg", + "DDColor/assets/test_images/Acrobats Balance On Top Of The Empire State Building, 1934.jpg", + ], + inputs=[image], + ) + + + if __name__ == "__main__": + try: + demo.queue().launch(debug=False) + except Exception: + demo.queue().launch(share=True, debug=False) + # if you are launching remotely, specify server_name and server_port + # demo.launch(server_name='your server name', server_port='server port in int') + # Read more in the docs: https://gradio.app/docs/ + + +.. parsed-literal:: + + Running on local URL: http://127.0.0.1:7860 + + To create a public link, set `share=True` in `launch()`. + + + + + + + diff --git a/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_16_0.jpg b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_16_0.jpg new file mode 100644 index 00000000000..4941cb1f611 --- /dev/null +++ b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_16_0.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e152195f834e9ac26e7df50e12c80cf13ee8d747e62dd29edf85b6fabb98cf84 +size 164898 diff --git a/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_16_0.png b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_16_0.png new file mode 100644 index 00000000000..df05154ccae --- /dev/null +++ b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_16_0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5d2b934619e33836937b6f9fe32987a37ca7506ecaf7d044d8286b6212bebe5 +size 1497558 diff --git a/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_25_0.jpg b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_25_0.jpg new file mode 100644 index 00000000000..96f01e15434 --- /dev/null +++ b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_25_0.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c70e32cab8d811d577a589a2212a382d02aa7c51f0093e8537ee86828314c592 +size 167271 diff --git a/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_25_0.png b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_25_0.png new file mode 100644 index 00000000000..d4f05aeb95e --- /dev/null +++ b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_25_0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:634bf7305f368aea78f429424e11e7f00fc341a485d74823434ac1d624a6515d +size 1521926 diff --git a/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_8_0.jpg b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_8_0.jpg new file mode 100644 index 00000000000..8fb53b4e8d0 --- /dev/null +++ b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_8_0.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:614b930200ec51d4631b7c2a3cc743e18a8f3f94c3ea47673ef1fca37028af31 +size 152058 diff --git a/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_8_0.png b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_8_0.png new file mode 100644 index 00000000000..d28e544903e --- /dev/null +++ b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_8_0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c105b02bbf0b3c82c253b6b4e92d7b28518775279197cbf239ca40dd52c9e9e +size 792834 diff --git a/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_9_0.jpg b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_9_0.jpg new file mode 100644 index 00000000000..77e9e43ffd6 --- /dev/null +++ b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_9_0.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a92ff02af12364a2b15169f96657de93c6a172e20174f7b8a857578d58405f9 +size 164917 diff --git a/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_9_0.png b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_9_0.png new file mode 100644 index 00000000000..5e84b839762 --- /dev/null +++ b/docs/notebooks/ddcolor-image-colorization-with-output_files/ddcolor-image-colorization-with-output_9_0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82894174823bc19a70eb250cf7238d542f2d81127e6bd3760d210c94796f2968 +size 1497540 diff --git a/docs/notebooks/decidiffusion-image-generation-with-output.rst b/docs/notebooks/decidiffusion-image-generation-with-output.rst index 9e878c71157..e951bc6ad86 100644 --- a/docs/notebooks/decidiffusion-image-generation-with-output.rst +++ b/docs/notebooks/decidiffusion-image-generation-with-output.rst @@ -1174,12 +1174,8 @@ improve model inference speed. .. code:: ipython3 - to_quantize = widgets.Checkbox( - value=True, - description="Quantization", - disabled=False, - ) - + skip_for_device = "GPU" in device.value + to_quantize = widgets.Checkbox(value=not skip_for_device, description="Quantization", disabled=skip_for_device) to_quantize diff --git a/docs/notebooks/depth-anything-with-output.rst b/docs/notebooks/depth-anything-with-output.rst index d583ea67720..f9d03cb4fcd 100644 --- a/docs/notebooks/depth-anything-with-output.rst +++ b/docs/notebooks/depth-anything-with-output.rst @@ -79,9 +79,9 @@ Prerequisites remote: Counting objects: 100% (144/144), done. remote: Compressing objects: 100% (105/105), done. remote: Total 421 (delta 101), reused 43 (delta 39), pack-reused 277 - Receiving objects: 100% (421/421), 237.89 MiB | 27.94 MiB/s, done. + Receiving objects: 100% (421/421), 237.89 MiB | 26.31 MiB/s, done. Resolving deltas: 100% (144/144), done. - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/notebooks/depth-anything/Depth-Anything + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/notebooks/depth-anything/Depth-Anything Note: you may need to restart the kernel to use updated packages. Note: you may need to restart the kernel to use updated packages. WARNING: typer 0.12.3 does not provide the extra 'all' @@ -273,13 +273,13 @@ loading on device using ``core.complie_model``. .. parsed-literal:: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/notebooks/depth-anything/Depth-Anything/torchhub/facebookresearch_dinov2_main/dinov2/layers/patch_embed.py:73: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/notebooks/depth-anything/Depth-Anything/torchhub/facebookresearch_dinov2_main/dinov2/layers/patch_embed.py:73: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! assert H % patch_H == 0, f"Input image height {H} is not a multiple of patch height {patch_H}" - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/notebooks/depth-anything/Depth-Anything/torchhub/facebookresearch_dinov2_main/dinov2/layers/patch_embed.py:74: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/notebooks/depth-anything/Depth-Anything/torchhub/facebookresearch_dinov2_main/dinov2/layers/patch_embed.py:74: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! assert W % patch_W == 0, f"Input image width {W} is not a multiple of patch width: {patch_W}" - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/notebooks/depth-anything/Depth-Anything/torchhub/facebookresearch_dinov2_main/vision_transformer.py:183: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/notebooks/depth-anything/Depth-Anything/torchhub/facebookresearch_dinov2_main/vision_transformer.py:183: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if npatch == N and w == h: - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/notebooks/depth-anything/Depth-Anything/depth_anything/dpt.py:133: TracerWarning: Converting a tensor to a Python integer might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/notebooks/depth-anything/Depth-Anything/depth_anything/dpt.py:133: TracerWarning: Converting a tensor to a Python integer might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! out = F.interpolate(out, (int(patch_h * 14), int(patch_w * 14)), mode="bilinear", align_corners=True) @@ -571,7 +571,7 @@ Run inference on video .. parsed-literal:: - Processed 60 frames in 13.28 seconds. Total FPS (including video processing): 4.52.Inference FPS: 10.54 + Processed 60 frames in 13.62 seconds. Total FPS (including video processing): 4.41.Inference FPS: 10.01 Video saved to 'output/Coco Walking in Berkeley_depth_anything.mp4'. @@ -598,7 +598,7 @@ Run inference on video .. parsed-literal:: Showing video saved at - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/notebooks/depth-anything/Depth-Anything/output/Coco Walking in Berkeley_depth_anything.mp4 + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/notebooks/depth-anything/Depth-Anything/output/Coco Walking in Berkeley_depth_anything.mp4 If you cannot see the video in your browser, please click on the following link to download the video @@ -612,7 +612,7 @@ Run inference on video .. raw:: html @@ -735,10 +735,10 @@ quantization code below may take some time. .. parsed-literal:: - 2024-05-15 23:54:08.057348: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. - 2024-05-15 23:54:08.091208: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. + 2024-06-06 00:01:26.132845: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. + 2024-06-06 00:01:26.165931: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. - 2024-05-15 23:54:08.654880: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT + 2024-06-06 00:01:26.726838: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT @@ -902,10 +902,10 @@ data. .. parsed-literal:: - Processed 60 frames in 12.70 seconds. Total FPS (including video processing): 4.73.Inference FPS: 12.89 + Processed 60 frames in 12.67 seconds. Total FPS (including video processing): 4.74.Inference FPS: 12.82 Video saved to 'output/Coco Walking in Berkeley_depth_anything_int8.mp4'. Showing video saved at - /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-681/.workspace/scm/ov-notebook/notebooks/depth-anything/Depth-Anything/output/Coco Walking in Berkeley_depth_anything.mp4 + /opt/home/k8sworker/ci-ai/cibuilds/ov-notebook/OVNotebookOps-697/.workspace/scm/ov-notebook/notebooks/depth-anything/Depth-Anything/output/Coco Walking in Berkeley_depth_anything.mp4 If you cannot see the video in your browser, please click on the following link to download the video @@ -919,7 +919,7 @@ data. .. raw:: html @@ -985,9 +985,9 @@ Tool =2023.1.0" diff --git a/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_22_0.jpg b/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_22_0.jpg index f80eeeb0a2b..009298597f3 100644 --- a/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_22_0.jpg +++ b/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_22_0.jpg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:402297f642d1ae24c5f34c947b243308e80a2353a297ff4fbc29a80a91447f3d -size 57749 +oid sha256:eb6a3c05535408d011ad8aa46258978d309afda0fe57ab8c97ea81078386469c +size 58366 diff --git a/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_22_0.png b/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_22_0.png index 914c56acc0b..84292f2d1d3 100644 --- a/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_22_0.png +++ b/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_22_0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bfdce03dd80512c030e07a93860311e984178cc6c00aea85904d97a9d85fd91b -size 507627 +oid sha256:84897b3dce254b9f229b11ab01345853e5a8397bb232c2dbf9e9062f6a3d3857 +size 509075 diff --git a/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_32_0.jpg b/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_32_0.jpg index de3cdef72f0..42770b2466d 100644 --- a/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_32_0.jpg +++ b/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_32_0.jpg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d467c3878c59234b1e763ec286626e3036584d037e32857396ec873b73347d3c -size 53573 +oid sha256:c558219ed9c6dae7fa76cbd8791cdb30ea5ee7d88af767ff82b989067e11ff6b +size 54727 diff --git a/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_32_0.png b/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_32_0.png index 2d5cc464a97..946beed11b4 100644 --- a/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_32_0.png +++ b/docs/notebooks/detectron2-to-openvino-with-output_files/detectron2-to-openvino-with-output_32_0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ef9d6efc8183a218693431a458cd84831e4820d02518cfd9d67f6c532ffc6f53 -size 456551 +oid sha256:a3202c1e5f4b8914b4290f1189e147f965b87d6556b8ed8d59d12ebf7812db9a +size 457983 diff --git a/docs/notebooks/distil-whisper-asr-with-output.rst b/docs/notebooks/distil-whisper-asr-with-output.rst index d1090b4abbb..1e27e7ebf6a 100644 --- a/docs/notebooks/distil-whisper-asr-with-output.rst +++ b/docs/notebooks/distil-whisper-asr-with-output.rst @@ -105,7 +105,7 @@ using tokenizer. .. code:: ipython3 import ipywidgets as widgets - + model_ids = { "Distil-Whisper": [ "distil-whisper/distil-large-v2", @@ -126,14 +126,14 @@ using tokenizer. "openai/whisper-tiny.en", ], } - + model_type = widgets.Dropdown( options=model_ids.keys(), value="Distil-Whisper", description="Model type:", disabled=False, ) - + model_type .. code:: ipython3 @@ -144,15 +144,15 @@ using tokenizer. description="Model:", disabled=False, ) - + model_id .. code:: ipython3 from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq - + processor = AutoProcessor.from_pretrained(model_id.value) - + pt_model = AutoModelForSpeechSeq2Seq.from_pretrained(model_id.value) pt_model.eval(); @@ -175,8 +175,8 @@ by Hugging Face datasets implementation. .. code:: ipython3 from datasets import load_dataset - - + + def extract_input_features(sample): input_features = processor( sample["audio"]["array"], @@ -184,8 +184,8 @@ by Hugging Face datasets implementation. return_tensors="pt", ).input_features return input_features - - + + dataset = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation") sample = dataset[0] input_features = extract_input_features(sample) @@ -202,10 +202,10 @@ for decoding predicted token_ids into text transcription. .. code:: ipython3 import IPython.display as ipd - + predicted_ids = pt_model.generate(input_features) transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True) - + display(ipd.Audio(sample["audio"]["array"], rate=sample["audio"]["sampling_rate"])) print(f"Reference: {sample['text']}") print(f"Result: {transcription[0]}") @@ -214,7 +214,7 @@ for decoding predicted token_ids into text transcription. .. raw:: html - +