Skip to content

Commit e242c65

Browse files
authored
fix errors found in nightly (#2561)
1 parent 1e356e3 commit e242c65

File tree

3 files changed

+31
-10
lines changed

3 files changed

+31
-10
lines changed

notebooks/async-api/async-api.ipynb

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"outputs": [],
5757
"source": [
5858
"%pip install -q \"openvino>=2023.1.0\"\n",
59-
"%pip install -q opencv-python \"matplotlib>=3.4\""
59+
"%pip install -q opencv-python tqdm \"matplotlib>=3.4\""
6060
]
6161
},
6262
{
@@ -116,15 +116,23 @@
116116
}
117117
],
118118
"source": [
119+
"from pathlib import Path\n",
120+
"\n",
119121
"# directory where model will be downloaded\n",
120122
"base_model_dir = \"model\"\n",
121123
"\n",
122124
"# model name as named in Open Model Zoo\n",
123125
"model_name = \"person-detection-0202\"\n",
124126
"precision = \"FP16\"\n",
125-
"model_path = f\"model/intel/{model_name}/{precision}/{model_name}.xml\"\n",
126-
"download_command = f\"omz_downloader \" f\"--name {model_name} \" f\"--precision {precision} \" f\"--output_dir {base_model_dir} \" f\"--cache_dir {base_model_dir}\"\n",
127-
"! $download_command"
127+
"model_path = Path(\"model\") / f\"{model_name}.xml\"\n",
128+
"\n",
129+
"base_model_url = \"https://storage.openvinotoolkit.org/repositories/open_model_zoo/2023.0/models_bin/1\"\n",
130+
"\n",
131+
"if not Path(model_path).exists():\n",
132+
" utils.download_file(f\"{base_model_url}/{model_name}/{precision}/{model_name}.xml\", filename=model_path.name, directory=model_path.parent)\n",
133+
" utils.download_file(\n",
134+
" f\"{base_model_url}/{model_name}/{precision}/{model_name}.bin\", filename=model_path.name.replace(\".xml\", \".bin\"), directory=model_path.parent\n",
135+
" )"
128136
]
129137
},
130138
{
@@ -270,7 +278,10 @@
270278
"metadata": {},
271279
"outputs": [],
272280
"source": [
273-
"video_path = \"https://storage.openvinotoolkit.org/repositories/openvino_notebooks/data/data/video/CEO%20Pat%20Gelsinger%20on%20Leading%20Intel.mp4\""
281+
"video_url = \"https://storage.openvinotoolkit.org/repositories/openvino_notebooks/data/data/video/CEO%20Pat%20Gelsinger%20on%20Leading%20Intel.mp4\"\n",
282+
"video_path = Path(\"data/test_video.mp4\")\n",
283+
"if not video_path.exists():\n",
284+
" utils.download_file(video_url, video_path.name, video_path.parent)"
274285
]
275286
},
276287
{

notebooks/omniparser/omniparser.ipynb

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@
6161
"metadata": {},
6262
"outputs": [],
6363
"source": [
64-
"%pip install -q \"torch>=2.1\" easyocr torchvision accelerate \"supervision==0.18.0\" accelerate timm \"einops==0.8.0\" \"ultralytics==8.1.24\" pillow opencv-python \"gradio>=4.19\" --extra-index-url https://download.pytorch.org/whl/cpu\n",
65-
"%pip install -q \"openvino>=2024.4.0\""
64+
"import platform\n",
65+
"\n",
66+
"%pip install -q \"torch>=2.1\" easyocr torchvision accelerate \"supervision==0.18.0\" \"transformers>=4.45\" timm \"einops==0.8.0\" \"ultralytics==8.1.24\" pillow opencv-python \"gradio>=4.19\" --extra-index-url https://download.pytorch.org/whl/cpu\n",
67+
"%pip install -q \"openvino>=2024.4.0\"\n",
68+
"\n",
69+
"if platform.system() == \"Darwin\":\n",
70+
" %pip install -q \"numpy<2.0\""
6671
]
6772
},
6873
{
@@ -77,16 +82,21 @@
7782
"\n",
7883
"notebook_utils_path = Path(\"notebook_utils.py\")\n",
7984
"florence_helper_path = Path(\"ov_florence2_helper.py\")\n",
85+
"omniparser_helper_path = Path(\"ov_omniparser_helper.py\")\n",
8086
"\n",
8187
"if not notebook_utils_path.exists():\n",
8288
" r = requests.get(\n",
8389
" url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/notebook_utils.py\",\n",
8490
" )\n",
85-
" notebook_utils_path.open(\"w\").write(r.text)\n",
91+
" notebook_utils_path.open(\"w\", encoding=\"utf-8\").write(r.text)\n",
8692
"\n",
8793
"if not florence_helper_path.exists():\n",
8894
" r = requests.get(url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/notebooks/florence2/ov_florence2_helper.py\")\n",
89-
" florence_helper_path.open(\"w\").write(r.text)"
95+
" florence_helper_path.open(\"w\", encoding=\"utf-8\").write(r.text)\n",
96+
"\n",
97+
"if not omniparser_helper_path.exists():\n",
98+
" r = requests.get(url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/notebooks/omniparser/ov_omniparser_helper.py\")\n",
99+
" omniparser_helper_path.open(\"w\", encoding=\"utf-8\").write(r.text)"
90100
]
91101
},
92102
{

notebooks/stable-diffusion-v3/stable-diffusion-v3-torch-fx.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"source": [
8989
"%pip install -q \"gradio>=4.19\" \"torch>=2.5\" \"torchvision>=0.20\" \"numpy<2.0\" \"transformers\" \"datasets>=2.14.6\" \"opencv-python\" \"pillow\" \"peft>=0.7.0\" \"diffusers>=0.31.0\" --extra-index-url https://download.pytorch.org/whl/cpu\n",
9090
"%pip install -qU \"openvino>=2024.3.0\"\n",
91-
"%pip install -q \"nncf>=2.14.0\""
91+
"%pip install -q \"nncf>=2.14.0\" \"typing_extensions>=4.11\""
9292
]
9393
},
9494
{

0 commit comments

Comments
 (0)