Skip to content

Commit

Permalink
fix errors found in nightly (#2561)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova authored Nov 27, 2024
1 parent 1e356e3 commit e242c65
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
21 changes: 16 additions & 5 deletions notebooks/async-api/async-api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"outputs": [],
"source": [
"%pip install -q \"openvino>=2023.1.0\"\n",
"%pip install -q opencv-python \"matplotlib>=3.4\""
"%pip install -q opencv-python tqdm \"matplotlib>=3.4\""
]
},
{
Expand Down Expand Up @@ -116,15 +116,23 @@
}
],
"source": [
"from pathlib import Path\n",
"\n",
"# directory where model will be downloaded\n",
"base_model_dir = \"model\"\n",
"\n",
"# model name as named in Open Model Zoo\n",
"model_name = \"person-detection-0202\"\n",
"precision = \"FP16\"\n",
"model_path = f\"model/intel/{model_name}/{precision}/{model_name}.xml\"\n",
"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",
"! $download_command"
"model_path = Path(\"model\") / f\"{model_name}.xml\"\n",
"\n",
"base_model_url = \"https://storage.openvinotoolkit.org/repositories/open_model_zoo/2023.0/models_bin/1\"\n",
"\n",
"if not Path(model_path).exists():\n",
" utils.download_file(f\"{base_model_url}/{model_name}/{precision}/{model_name}.xml\", filename=model_path.name, directory=model_path.parent)\n",
" utils.download_file(\n",
" f\"{base_model_url}/{model_name}/{precision}/{model_name}.bin\", filename=model_path.name.replace(\".xml\", \".bin\"), directory=model_path.parent\n",
" )"
]
},
{
Expand Down Expand Up @@ -270,7 +278,10 @@
"metadata": {},
"outputs": [],
"source": [
"video_path = \"https://storage.openvinotoolkit.org/repositories/openvino_notebooks/data/data/video/CEO%20Pat%20Gelsinger%20on%20Leading%20Intel.mp4\""
"video_url = \"https://storage.openvinotoolkit.org/repositories/openvino_notebooks/data/data/video/CEO%20Pat%20Gelsinger%20on%20Leading%20Intel.mp4\"\n",
"video_path = Path(\"data/test_video.mp4\")\n",
"if not video_path.exists():\n",
" utils.download_file(video_url, video_path.name, video_path.parent)"
]
},
{
Expand Down
18 changes: 14 additions & 4 deletions notebooks/omniparser/omniparser.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@
"metadata": {},
"outputs": [],
"source": [
"%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",
"%pip install -q \"openvino>=2024.4.0\""
"import platform\n",
"\n",
"%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",
"%pip install -q \"openvino>=2024.4.0\"\n",
"\n",
"if platform.system() == \"Darwin\":\n",
" %pip install -q \"numpy<2.0\""
]
},
{
Expand All @@ -77,16 +82,21 @@
"\n",
"notebook_utils_path = Path(\"notebook_utils.py\")\n",
"florence_helper_path = Path(\"ov_florence2_helper.py\")\n",
"omniparser_helper_path = Path(\"ov_omniparser_helper.py\")\n",
"\n",
"if not notebook_utils_path.exists():\n",
" r = requests.get(\n",
" url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/notebook_utils.py\",\n",
" )\n",
" notebook_utils_path.open(\"w\").write(r.text)\n",
" notebook_utils_path.open(\"w\", encoding=\"utf-8\").write(r.text)\n",
"\n",
"if not florence_helper_path.exists():\n",
" r = requests.get(url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/notebooks/florence2/ov_florence2_helper.py\")\n",
" florence_helper_path.open(\"w\").write(r.text)"
" florence_helper_path.open(\"w\", encoding=\"utf-8\").write(r.text)\n",
"\n",
"if not omniparser_helper_path.exists():\n",
" r = requests.get(url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/notebooks/omniparser/ov_omniparser_helper.py\")\n",
" omniparser_helper_path.open(\"w\", encoding=\"utf-8\").write(r.text)"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"source": [
"%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",
"%pip install -qU \"openvino>=2024.3.0\"\n",
"%pip install -q \"nncf>=2.14.0\""
"%pip install -q \"nncf>=2.14.0\" \"typing_extensions>=4.11\""
]
},
{
Expand Down

0 comments on commit e242c65

Please sign in to comment.