Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # partition the data into training and testing splits using 75% of
- # the data for training and the remaining 25% for testing
- (trainX, testX, trainY, testY) = train_test_split(data,
- labels, test_size=0.25, random_state=42)
- print ("trainX.shape------>>",trainX.shape)
- # convert the labels from integers to vectors (for 2-class, binary
- # classification you should use Keras' to_categorical function
- # instead as the scikit-learn's LabelBinarizer will not return a
- # vector)
- lb = LabelBinarizer()
- trainY = lb.fit_transform(trainY)
- testY = lb.transform(testY)
- # construct the image generator for data augmentation
- aug = ImageDataGenerator(rotation_range=30, width_shift_range=0.1,
- height_shift_range=0.1, shear_range=0.2, zoom_range=0.2,
- horizontal_flip=True, fill_mode="nearest")
- height = 64
- width = 64
- depth =3
- inputShape = (height, width, depth)
- classes = len(lb.classes_)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement