Skip to content

Commit

Permalink
Update tf_hub_delf_module.ipynb
Browse files Browse the repository at this point in the history
removing StringIO and PY3 setup since they are the same inside of the six package

PiperOrigin-RevId: 207256626
  • Loading branch information
kmader authored and arnoegw committed Aug 3, 2018
1 parent 226b710 commit 42d7bce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/colab/tf_hub_delf_module.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"from skimage.feature import plot_matches\n",
"from skimage.measure import ransac\n",
"from skimage.transform import AffineTransform\n",
"from six import StringIO\n",
"from six import BytesIO\n",
"import tensorflow as tf\n",
"import tensorflow_hub as hub\n",
"from six.moves.urllib.request import urlopen"
Expand Down Expand Up @@ -222,7 +222,8 @@
"def download_and_resize_image(url, filename, new_width=256, new_height=256):\n",
" response = urlopen(url)\n",
" image_data = response.read()\n",
" pil_image = Image.open(StringIO(image_data))\n",
" image_data = BytesIO(image_data)\n",
" pil_image = Image.open(image_data)\n",
" pil_image = ImageOps.fit(pil_image, (new_width, new_height), Image.ANTIALIAS)\n",
" pil_image_rgb = pil_image.convert('RGB')\n",
" pil_image_rgb.save(filename, format='JPEG', quality=90)\n",
Expand Down

0 comments on commit 42d7bce

Please sign in to comment.