Skip to content

Commit 63ceb8c

Browse files
committed
offline experience fixes
1 parent 9f4fefd commit 63ceb8c

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

notebooks/depth-anything/depth-anything.ipynb

+8-8
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,7 @@
6969
" r = requests.get(\n",
7070
" url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/cmd_helper.py\",\n",
7171
" )\n",
72-
" open(\"cmd_helper.py\", \"w\").write(r.text)\n",
73-
"\n",
74-
"if not Path(\"notebook_utils.py\").exists():\n",
75-
" r = requests.get(\n",
76-
" url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/notebook_utils.py\",\n",
77-
" )\n",
78-
" open(\"notebook_utils.py\", \"w\").write(r.text)"
72+
" open(\"cmd_helper.py\", \"w\").write(r.text)"
7973
]
8074
},
8175
{
@@ -109,7 +103,13 @@
109103
"if platform.system() == \"Darwin\":\n",
110104
" %pip install -q \"numpy<2.0.0\"\n",
111105
"if platform.python_version_tuple()[1] in [\"8\", \"9\"]:\n",
112-
" %pip install -q \"gradio-imageslider<=0.0.17\" \"typing-extensions>=4.9.0\""
106+
" %pip install -q \"gradio-imageslider<=0.0.17\" \"typing-extensions>=4.9.0\"\n",
107+
"\n",
108+
"if not Path(\"notebook_utils.py\").exists():\n",
109+
" r = requests.get(\n",
110+
" url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/notebook_utils.py\",\n",
111+
" )\n",
112+
" open(\"notebook_utils.py\", \"w\").write(r.text)"
113113
]
114114
},
115115
{

notebooks/optical-character-recognition/optical-character-recognition.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
" )\n",
9595
"\n",
9696
" open(\"notebook_utils.py\", \"w\").write(r.text)\n",
97-
"from notebook_utils import load_image, device_widget\n",
97+
"from notebook_utils import download_file, device_widget\n",
9898
"\n",
9999
"# Read more about telemetry collection at https://github.com/openvinotoolkit/openvino_notebooks?tab=readme-ov-file#-telemetry\n",
100100
"from notebook_utils import collect_telemetry\n",
@@ -290,14 +290,14 @@
290290
}
291291
],
292292
"source": [
293-
"# The `image_file` variable can point to a URL or a local image.\n",
294-
"image_url = \"https://storage.openvinotoolkit.org/repositories/openvino_notebooks/data/data/image/intel_rnb.jpg\"\n",
295-
"\n",
296293
"image_path = Path(\"intel_rnb.jpg\")\n",
297294
"\n",
298295
"if not image_path.exists():\n",
299-
" image = load_image(image_url)\n",
300-
" cv2.imwrite(str(image_path), image)\n",
296+
" download_file(\n",
297+
" url=\"https://storage.openvinotoolkit.org/repositories/openvino_notebooks/data/data/image/intel_rnb.jpg\",\n",
298+
" filename=image_path.name,\n",
299+
" directory=image_path.parent,\n",
300+
" )\n",
301301
"else:\n",
302302
" image = cv2.imread(str(image_path))\n",
303303
"\n",

notebooks/yolov11-optimization/yolov11-keypoint-detection.ipynb

+1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
" )\n",
124124
"\n",
125125
" open(\"notebook_utils.py\", \"w\").write(r.text)\n",
126+
"\n",
126127
"from notebook_utils import download_file, VideoPlayer, device_widget\n",
127128
"\n",
128129
"# Read more about telemetry collection at https://github.com/openvinotoolkit/openvino_notebooks?tab=readme-ov-file#-telemetry\n",

notebooks/yolov8-optimization/yolov8-object-detection.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
"# Fetch `notebook_utils` module\n",
133133
"import requests\n",
134134
"\n",
135-
"if not Path(\"notebook_utils.py\").exists()\n",
135+
"if not Path(\"notebook_utils.py\").exists():\n",
136136
" r = requests.get(\n",
137137
" url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/notebook_utils.py\",\n",
138138
" )\n",

0 commit comments

Comments
 (0)