Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resize deprecated from scipy.misc #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Keras_Transfer_CIFAR10.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"from keras.applications.inception_v3 import InceptionV3, preprocess_input\n",
"import scipy\n",
"from scipy import misc\n",
"from PIL import Image\n",
"import os\n",
"\n",
"# load the data\n",
Expand All @@ -63,7 +64,7 @@
" print('bottleneck features file not detected (train)')\n",
" print('calculating now ...')\n",
" # pre-process the train data\n",
" big_x_train = np.array([scipy.misc.imresize(x_train[i], (139, 139, 3)) \n",
" big_x_train = np.array([np.array(Image.fromarray(x_train[i]).resize((139, 139))) \n",
" for i in range(0, len(x_train))]).astype('float32')\n",
" inception_input_train = preprocess_input(big_x_train)\n",
" print('train data preprocessed')\n",
Expand Down Expand Up @@ -171,7 +172,7 @@
" print('bottleneck features file not detected (test)')\n",
" print('calculating now ...')\n",
" # pre-process the test data\n",
" big_x_test = np.array([scipy.misc.imresize(x_test[i], (139, 139, 3)) \n",
" big_x_test = np.array([np.array(Image.fromarray(x_test[i]).resize(139, 139))) \n",
" for i in range(0, len(x_test))]).astype('float32')\n",
" inception_input_test = preprocess_input(big_x_test)\n",
" # extract, process, and save bottleneck features (test)\n",
Expand Down