mirror of
https://github.com/fchollet/deep-learning-with-python-notebooks.git
synced 2021-07-27 01:28:40 +03:00
Update notebooks for TF 2.6
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
" \"coast.jpg\", origin=\"https://img-datasets.s3.amazonaws.com/coast.jpg\")\n",
|
||||
"\n",
|
||||
"plt.axis(\"off\")\n",
|
||||
"plt.imshow(keras.preprocessing.image.load_img(base_image_path))"
|
||||
"plt.imshow(keras.utils.load_img(base_image_path))"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -154,8 +154,8 @@
|
||||
"import numpy as np\n",
|
||||
"\n",
|
||||
"def preprocess_image(image_path):\n",
|
||||
" img = keras.preprocessing.image.load_img(image_path)\n",
|
||||
" img = keras.preprocessing.image.img_to_array(img)\n",
|
||||
" img = keras.utils.load_img(image_path)\n",
|
||||
" img = keras.utils.img_to_array(img)\n",
|
||||
" img = np.expand_dims(img, axis=0)\n",
|
||||
" img = keras.applications.inception_v3.preprocess_input(img)\n",
|
||||
" return img\n",
|
||||
@@ -201,7 +201,7 @@
|
||||
" img += lost_detail\n",
|
||||
" shrunk_original_img = tf.image.resize(original_img, shape)\n",
|
||||
"\n",
|
||||
"keras.preprocessing.image.save_img(\"dream.png\", deprocess_image(img.numpy()))"
|
||||
"keras.utils.save_img(\"dream.png\", deprocess_image(img.numpy()))"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user