This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import glob | |
| import random | |
| import numpy as np | |
| from sklearn.metrics import accuracy_score | |
| from keras.utils import np_utils | |
| from keras.models import Sequential | |
| from keras.preprocessing import image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import numpy as np | |
| from PIL import Image | |
| from scipy import misc, ndimage | |
| from keras import Model | |
| from keras import Sequential | |
| from keras.layers import Activation | |
| from keras.layers import Dropout | |
| from keras.layers import Flatten | |
| from keras.layers import ZeroPadding2D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from keras.preprocessing.image import ImageDataGenerator | |
| from keras.optimizers import SGD | |
| from keras.models import Model | |
| from keras.utils import np_utils | |
| from keras.preprocessing import image | |
| from keras.applications.inception_resnet_v2 import InceptionResNetV2 | |
| from keras.applications.inception_resnet_v2 import preprocess_input, decode_predictions | |
| from keras.layers import Dense, GlobalAveragePooling2D | |
| from sklearn.model_selection import train_test_split |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from keras.applications.inception_resnet_v2 import InceptionResNetV2 | |
| from keras.preprocessing import image | |
| from keras.applications.inception_resnet_v2 import preprocess_input, decode_predictions | |
| import numpy as np | |
| model = InceptionResNetV2(weights='imagenet') | |
| img_path = 'aguila.jpg' | |
| img = image.load_img(img_path, target_size=(224, 224)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from keras.datasets import mnist | |
| from keras.models import Model | |
| from keras.layers import Input, Dense, Dropout, Flatten, Conv2D, MaxPooling2D | |
| from keras.utils import np_utils | |
| (x_train, y_train), (x_test, y_test) = mnist.load_data() | |
| x_train = x_train.reshape(x_train.shape+(1,)) | |
| x_test = x_test.reshape(x_test.shape+(1,)) | |