Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
8ffcc2fa
Commit
8ffcc2fa
authored
Sep 19, 2018
by
Aysar
Committed by
pkulzc
Sep 19, 2018
Browse files
Allow loading png images in object detection jupyter notebook (#5269)
parent
8ff61153
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
research/object_detection/object_detection_tutorial.ipynb
research/object_detection/object_detection_tutorial.ipynb
+2
-0
No files found.
research/object_detection/object_detection_tutorial.ipynb
View file @
8ffcc2fa
...
@@ -297,6 +297,8 @@
...
@@ -297,6 +297,8 @@
"source": [
"source": [
"def load_image_into_numpy_array(image):\n",
"def load_image_into_numpy_array(image):\n",
" (im_width, im_height) = image.size\n",
" (im_width, im_height) = image.size\n",
" if image.format == 'PNG':\n",
" image = image.convert('RGB')\n",
" return np.array(image.getdata()).reshape(\n",
" return np.array(image.getdata()).reshape(\n",
" (im_height, im_width, 3)).astype(np.uint8)"
" (im_height, im_width, 3)).astype(np.uint8)"
]
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment