This file contains 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, array_to_img, img_to_array, load_img | |
datagen = ImageDataGenerator( | |
rotation_range=40, | |
width_shift_range=0.2, | |
height_shift_range=0.2, | |
shear_range=0.2, | |
zoom_range=0.2, | |
horizontal_flip=True, | |
fill_mode='nearest') |
This file contains 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.models import Sequential | |
from keras.layers import Conv2D, MaxPooling2D | |
from keras.layers import Activation, Dropout, Flatten, Dense | |
from keras import backend as K | |
no_train_img,no_validation_img = 1001,800 | |
img_width, img_height = 150, 150 | |
batch_size = 16 | |
if K.image_data_format() == 'channels_first': | |
input_shape = (3, img_width, img_height)#theano |
This file contains 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 all dependencies | |
import PIL | |
import keras | |
import numpy as np | |
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img | |
print ("\n") | |
print("Your backend is ----------------------------------------------------------------->",keras.backend.backend()) |
This file contains 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 all dependencies | |
import PIL | |
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img | |
import numpy as np | |
datagen = ImageDataGenerator( | |
rotation_range=40, | |
width_shift_range=0.2, | |
height_shift_range=0.2, |
This file contains 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 cv2 | |
import numpy as np | |
filename = '/dog_clip.png' | |
img = cv2.imread(filename) | |
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) | |
gray = np.float32(gray) | |
dst = cv2.cornerHarris(gray,2,3,0.04) |
This file contains 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 necessary components to build LeNet | |
from keras.models import Sequential | |
from keras.layers.core import Dense, Dropout, Activation, Flatten | |
from keras.layers.convolutional import Conv2D, MaxPooling2D, ZeroPadding2D | |
from keras.layers.normalization import BatchNormalization | |
from keras.regularizers import l2 | |
# Initialize model | |
alexnet = Sequential() |
This file contains 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
# set the matplotlib backend so figures can be saved in the background | |
import matplotlib | |
matplotlib.use("Agg") | |
# import the necessary packages | |
from sklearn.preprocessing import LabelBinarizer | |
from sklearn import preprocessing | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import classification_report | |
from keras.models import Sequential |
This file contains 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
# set the matplotlib backend so figures can be saved in the background | |
import matplotlib | |
matplotlib.use("Agg") | |
# import the necessary packages | |
from sklearn.preprocessing import LabelBinarizer | |
from sklearn import preprocessing | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import classification_report | |
from keras.models import Sequential |
This file contains 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 the necessary packages | |
from keras.models import load_model | |
import argparse | |
import pickle | |
import cv2 | |
import os | |
test_image_path = "/test_image/cats.jpg" |
This file contains 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 the necessary packages | |
from keras.models import load_model | |
import argparse | |
import pickle | |
import cv2 | |
import os | |
import imutils | |
test_image_path = "/panda_00125.jpg" | |
model_path = "/simple_binary_classifcation_model.model" |
OlderNewer