Skip to content

Commit 93a86e4

Browse files
Fixed 101 wrong label, moved imagenet classes to data dir (openvinotoolkit#777)
1 parent 02fe568 commit 93a86e4

File tree

6 files changed

+5
-1011
lines changed

6 files changed

+5
-1011
lines changed

notebooks/001-hello-world/001-hello-world.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"outputs": [],
109109
"source": [
110110
"# Convert the inference result to a class name.\n",
111-
"imagenet_classes = open(\"utils/imagenet_2012.txt\").read().splitlines()\n",
111+
"imagenet_classes = open(\"../data/datasets/imagenet/imagenet_2012.txt\").read().splitlines()\n",
112112
"\n",
113113
"# The model description states that for this model, class 0 is a background.\n",
114114
"# Therefore, a background must be added at the beginning of imagenet_classes.\n",

notebooks/101-tensorflow-to-openvino/101-tensorflow-to-openvino.ipynb

+3-9
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,8 @@
105105
"source": [
106106
"# Construct the command for Model Optimizer.\n",
107107
"mo_command = f\"\"\"mo\n",
108-
" --saved_model_dir \"{model_path}\" \n",
109-
" --input_shape \"[1,224,224,3]\" \n",
110-
" --mean_values=\"[127.5,127.5,127.5]\"\n",
111-
" --scale_values=\"[127.5]\" \n",
108+
" --saved_model_dir \"{model_path}\"\n",
109+
" --input_shape \"[1,224,224,3]\"\n",
112110
" --model_name \"{model_path.name}\"\n",
113111
" --compress_to_fp16\n",
114112
" --output_dir \"{model_path.parent}\"\n",
@@ -227,11 +225,7 @@
227225
"outputs": [],
228226
"source": [
229227
"# Convert the inference result to a class name.\n",
230-
"imagenet_classes = open(\"utils/imagenet_2012.txt\").read().splitlines()\n",
231-
"\n",
232-
"# The model description states that for this model, class 0 is background.\n",
233-
"# Therefore, add background at the beginning of imagenet_classes\n",
234-
"imagenet_classes = ['background'] + imagenet_classes\n",
228+
"imagenet_classes = open(\"../data/datasets/imagenet/imagenet_2012.txt\").read().splitlines()\n",
235229
"\n",
236230
"imagenet_classes[result_index]"
237231
]

0 commit comments

Comments
 (0)