Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file downloading when offline #2545

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions notebooks/vision-monodepth/vision-monodepth.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@
"ir_model_name_bin = \"MiDaS_small.bin\"\n",
"\n",
"\n",
"if not Path(ir_model_name_xml).exists():\n",
"if not Path(model_folder / ir_model_name_xml).exists():\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"if not Path(model_folder / ir_model_name_xml).exists():\n",
"if not (model_folder / ir_model_name_xml).exists():\n",

" download_file(ir_model_url + ir_model_name_xml, filename=ir_model_name_xml, directory=model_folder)\n",
"if not Path(ir_model_name_bin).exists():\n",
"if not Path(model_folder / ir_model_name_bin).exists():\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"if not Path(model_folder / ir_model_name_bin).exists():\n",
"if not (model_folder / ir_model_name_bin).exists():\n",

" download_file(ir_model_url + ir_model_name_bin, filename=ir_model_name_bin, directory=model_folder)\n",
"\n",
"model_xml_path = model_folder / ir_model_name_xml"
Expand Down Expand Up @@ -347,11 +347,13 @@
},
"outputs": [],
"source": [
"IMAGE_FILE = \"https://storage.openvinotoolkit.org/repositories/openvino_notebooks/data/data/image/coco_bike.jpg\"\n",
"if not Path(\"coco_bike.jpg\").exists():\n",
" image = load_image(path=IMAGE_FILE)\n",
"else:\n",
" image = load_image(path=\"coco_bike.jpg\")\n",
"IMAGE_URL = \"https://storage.openvinotoolkit.org/repositories/openvino_notebooks/data/data/image/coco_bike.jpg\"\n",
"IMAGE_PATH = \"coco_bike.jpg\"\n",
"\n",
"if not Path(IMAGE_PATH).exists():\n",
" download_file(IMAGE_URL, IMAGE_PATH)\n",
"\n",
"image = load_image(IMAGE_PATH)\n",
"\n",
"\n",
"# Resize to input shape for network.\n",
Expand Down
Loading