Skip to content

Commit

Permalink
Merge branch 'main' into yt/remove-digits
Browse files Browse the repository at this point in the history
  • Loading branch information
yatarkan committed Mar 25, 2024
2 parents 060838b + dfea613 commit 8cd9506
Show file tree
Hide file tree
Showing 21 changed files with 599 additions and 846 deletions.
4 changes: 3 additions & 1 deletion notebooks/attention-center/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ The tutorial consists of the following steps:

## Installation Instructions

If you have not installed all required dependencies, follow the [Installation Guide](../../README.md).
This is a self-contained example that relies solely on its own code.</br>
We recommend running the notebook in a virtual environment. You only need a Jupyter server to start.
For details, please refer to [Installation Guide](../../README.md).

### See Also

Expand Down
13 changes: 10 additions & 3 deletions notebooks/attention-center/attention-center.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@
"source": [
"import platform\n",
"\n",
"%pip install \"openvino>=2023.2.0\"\n",
"%pip install \"openvino>=2023.2.0\" \"opencv-python\" \"pillow\" \"numpy\"\n",
"\n",
"%pip install -q \"tensorflow-macos>=2.5; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version > '3.8'\" # macOS M1 and M2\n",
"%pip install -q \"tensorflow-macos>=2.5,<=2.12.0; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version <= '3.8'\" # macOS M1 and M2\n",
"%pip install -q \"tensorflow>=2.5; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version > '3.8'\" # macOS x86\n",
"%pip install -q \"tensorflow>=2.5,<=2.12.0; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version <= '3.8'\" # macOS x86\n",
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin' and python_version > '3.8'\"\n",
"%pip install -q \"tensorflow>=2.5,<=2.12.0; sys_platform != 'darwin' and python_version <= '3.8'\"\n",
"\n",
"if platform.system() != \"Windows\":\n",
" %pip install -q \"matplotlib>=3.4\"\n",
Expand Down Expand Up @@ -403,7 +410,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -417,7 +424,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.11.4"
},
"openvino_notebooks": {
"imageUrl": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@
}
],
"source": [
"%pip install -q \"openvino>=2024.0.0\" \"nncf>=2.7.0\" \"tensorflow-hub>=0.15.0\" \"tensorflow_datasets\"\n",
"%pip install -q \"tensorflow-macos>=2.5; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version > '3.8'\" # macOS M1 and M2\n",
"%pip install -q \"tensorflow-macos>=2.5,<=2.12.0; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version <= '3.8'\" # macOS M1 and M2\n",
"%pip install -q \"tensorflow>=2.5; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version > '3.8'\" # macOS x86\n",
"%pip install -q \"tensorflow>=2.5,<=2.12.0; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version <= '3.8'\" # macOS x86\n",
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin' and python_version > '3.8'\"\n",
"%pip install -q \"tensorflow>=2.5,<=2.12.0; sys_platform != 'darwin' and python_version <= '3.8'\"\n",
"\n",
"%pip install -q \"openvino>=2024.0.0\" \"nncf>=2.7.0\" \"tensorflow-hub>=0.15.0\" \"tensorflow_datasets\" tf_keras\n",
"%pip install -q \"scikit-learn>=1.3.2\""
]
},
Expand Down Expand Up @@ -89,6 +96,9 @@
"\n",
"from sklearn.metrics import accuracy_score\n",
"\n",
"os.environ[\"TF_USE_LEGACY_KERAS\"] = \"1\"\n",
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n",
"\n",
"import tensorflow as tf\n",
"import tensorflow_datasets as tfds\n",
"import tensorflow_hub as hub\n",
Expand All @@ -105,7 +115,6 @@
"source": [
"core = Core()\n",
"tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)\n",
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n",
"\n",
"\n",
"# For top 5 labels.\n",
Expand Down Expand Up @@ -743,7 +752,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -757,7 +766,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.11.4"
},
"openvino_notebooks": {
"imageUrl": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "285a34a4-18ff-493c-8322-71adf1f09622",
"metadata": {},
Expand All @@ -16,7 +15,8 @@
"![image.png](https://github.com/openvinotoolkit/openvino_notebooks/assets/29454499/17546d66-12b9-4841-9293-cc878258a186)\n",
"\n",
"\n",
"#### Table of contents:\n\n",
"#### Table of contents:\n",
"\n",
"- [Prerequisites](#Prerequisites)\n",
"- [Instantiate audio compression pipeline](#Instantiate-audio-compression-pipeline)\n",
"- [Explore EnCodec pipeline](#Explore-EnCodec-pipeline)\n",
Expand All @@ -31,7 +31,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "e328a76f-03b8-4972-afa9-36d3f8cc8364",
"metadata": {},
Expand All @@ -49,11 +48,10 @@
"metadata": {},
"outputs": [],
"source": [
"%pip install -q --extra-index-url https://download.pytorch.org/whl/cpu \"openvino>=2023.3.0\" \"torch>=2.1\" \"torchaudio>=2.1\" encodec gradio \"librosa>=0.8.1\""
"%pip install -q --extra-index-url https://download.pytorch.org/whl/cpu \"openvino>=2023.3.0\" \"torch>=2.1\" \"torchaudio>=2.1\" encodec gradio \"librosa>=0.8.1\" \"matplotlib<=3.7\""
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "82279f60-a018-4ea8-9b0b-77f0f40903cf",
"metadata": {},
Expand Down Expand Up @@ -110,7 +108,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "2146fbd2-6f15-4e31-b9f6-7c8e69daabd0",
"metadata": {},
Expand Down Expand Up @@ -186,7 +183,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "970e162d-ea7e-4d32-bb35-3c3ed29f9720",
"metadata": {},
Expand Down Expand Up @@ -232,7 +228,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "f51bfa76-25ad-427c-851a-fb61481f02e3",
"metadata": {},
Expand Down Expand Up @@ -270,7 +265,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "22b28212-9cf1-4f89-ac92-da469239e87e",
"metadata": {},
Expand Down Expand Up @@ -305,7 +299,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "94c1a9dd-09bc-4369-8b55-935db09c729b",
"metadata": {},
Expand All @@ -314,7 +307,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "41301b36-2757-48c7-91dd-5c2d38d5c467",
"metadata": {},
Expand Down Expand Up @@ -356,7 +348,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "40e394db-512b-4b87-bfd0-fd5afe8ef1a3",
"metadata": {},
Expand Down Expand Up @@ -408,7 +399,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "ac4cc2e5-fd24-409e-8104-77d8c24bfa7d",
"metadata": {},
Expand All @@ -417,7 +407,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "44271e54-ea69-4da6-a84b-838b7896c586",
"metadata": {},
Expand Down Expand Up @@ -510,7 +499,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "bc8cf59c-a3fa-48ea-9f18-0979860f0aa9",
"metadata": {},
Expand All @@ -526,7 +514,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "e32cea0b-e92c-40e7-912f-b5d47a43f921",
"metadata": {},
Expand Down Expand Up @@ -636,7 +623,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "21b2e5b4-035c-4123-8257-00cd3f4af3fc",
"metadata": {},
Expand Down Expand Up @@ -831,4 +817,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
76 changes: 31 additions & 45 deletions notebooks/film-slowmo/film-slowmo.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions notebooks/instant-id/instant-id.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2790,7 +2790,7 @@
" [examples_dir / \"face_4.png\", \"a girl\", \"Snow\", \"\"]\n",
"]\n",
"\n",
"pipeline = int8_pipe if use_quantized_model.value else ov_pipe\n",
"pipeline = int8_pipe if use_quantized_models.value else ov_pipe\n",
"\n",
"\n",
"if not examples_dir.exists():\n",
Expand Down Expand Up @@ -3071,7 +3071,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"version": "3.8.10"
},
"openvino_notebooks": {
"imageUrl": "https://github.com/openvinotoolkit/openvino_notebooks/assets/29454499/79d9d244-8c65-4564-9baa-80a73c4674bf",
Expand Down
4 changes: 3 additions & 1 deletion notebooks/optimize-preprocessing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ The tutorial consists of the following steps:

## Installation Instructions

If you have not installed all required dependencies, follow the [Installation Guide](../../README.md).
This is a self-contained example that relies solely on its own code.</br>
We recommend running the notebook in a virtual environment. You only need a Jupyter server to start.
For details, please refer to [Installation Guide](../../README.md).
27 changes: 22 additions & 5 deletions notebooks/optimize-preprocessing/optimize-preprocessing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"metadata": {},
"source": [
"\n",
"#### Table of contents:\n\n",
"#### Table of contents:\n",
"\n",
"- [Settings](#Settings)\n",
"- [Imports](#Imports)\n",
" - [Setup image and device](#Setup-image-and-device)\n",
Expand Down Expand Up @@ -65,8 +66,20 @@
"metadata": {},
"outputs": [],
"source": [
"import platform\n",
"# Install openvino package\n",
"%pip install -q \"openvino>=2023.1.0\" tensorflow opencv-python matplotlib"
"%pip install -q \"openvino>=2023.1.0\" opencv-python\n",
"if platform.system() != \"Windows\":\n",
" %pip install -q \"matplotlib>=3.4\"\n",
"else:\n",
" %pip install -q \"matplotlib>=3.4,<3.7\"\n",
"\n",
"%pip install -q \"tensorflow-macos>=2.5; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version > '3.8'\" # macOS M1 and M2\n",
"%pip install -q \"tensorflow-macos>=2.5,<=2.12.0; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version <= '3.8'\" # macOS M1 and M2\n",
"%pip install -q \"tensorflow>=2.5; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version > '3.8'\" # macOS x86\n",
"%pip install -q \"tensorflow>=2.5,<=2.12.0; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version <= '3.8'\" # macOS x86\n",
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin' and python_version > '3.8'\"\n",
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin' and python_version <= '3.8'\"\n"
]
},
{
Expand Down Expand Up @@ -97,8 +110,12 @@
],
"source": [
"import time\n",
"import os\n",
"from pathlib import Path\n",
"\n",
"os.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"2\"\n",
"os.environ[\"TF_USE_LEGACY_KERAS\"] = \"1\"\n",
"\n",
"import cv2\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
Expand Down Expand Up @@ -789,7 +806,7 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -803,7 +820,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.11.4"
},
"openvino_notebooks": {
"imageUrl": "",
Expand All @@ -827,4 +844,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@
"ov_config = {}\n",
"if \"GPU\" in device.value or (\"AUTO\" in device.value and \"GPU\" in core.available_devices):\n",
" ov_config = {\"GPU_DISABLE_WINOGRAD_CONVOLUTION\": \"YES\"}\n",
"quantized_compiled_model = core.compile_model(model=quantized_model, device.value, ov_config)\n",
"compiled_ov_model = core.compile_model(model=ov_model, device.value, ov_config)\n",
"quantized_compiled_model = core.compile_model(quantized_model, device.value, ov_config)\n",
"compiled_ov_model = core.compile_model(ov_model, device.value, ov_config)\n",
"\n",
"pt_result = validation_ac(compiled_ov_model, data_loader, validator)\n",
"quantized_result = validation_ac(quantized_compiled_model, data_loader, validator)\n",
Expand Down
Loading

0 comments on commit 8cd9506

Please sign in to comment.