text_plain_output_1.png image_output_2.png image_output_1.png
from glob import glob

from keras import layers

from keras.applications.vgg16 import VGG16

from keras.layers import Input, Dense

from keras.models import Sequential

from keras.preprocessing.image import ImageDataGenerator, img_to_array, load_img

import matplotlib.pyplot as plt

train_path = '/kaggle/input/signature/signature/Train/'
test_path = '/kaggle/input/signature/signature/Test/'

img = load_img(train_path + 'forged/f138.png')
x = img_to_array(img)
img = load_img(train_path + '/forged/f98.png')
x = img_to_array(img)
numberOfClass = len(glob(train_path + '/*'))

vgg = VGG16()
vgg_layer_list = vgg.layers
model = Sequential()
for i in range(len(vgg_layer_list) - 1):
    model.add(vgg_layer_list[i])
for layers in model.layers:
    layers.trainable = False
model.add(Dense(numberOfClass, activation='softmax'))
print(model.summary())