Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8ffcc2f

Browse files
aysarkpkulzc
authored andcommitted
Allow loading png images in object detection jupyter notebook (tensorflow#5269)
1 parent 8ff6115 commit 8ffcc2f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

research/object_detection/object_detection_tutorial.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@
297297
"source": [
298298
"def load_image_into_numpy_array(image):\n",
299299
" (im_width, im_height) = image.size\n",
300+
" if image.format == 'PNG':\n",
301+
" image = image.convert('RGB')\n",
300302
" return np.array(image.getdata()).reshape(\n",
301303
" (im_height, im_width, 3)).astype(np.uint8)"
302304
]

0 commit comments

Comments
 (0)