Skip to content

Instantly share code, notes, and snippets.

@poojatambe
Created June 6, 2022 16:27
Show Gist options
  • Save poojatambe/9d67b88f8541fe845c1f1a39a4cd5136 to your computer and use it in GitHub Desktop.
Save poojatambe/9d67b88f8541fe845c1f1a39a4cd5136 to your computer and use it in GitHub Desktop.
#load weights of the trained model.
input_shape = (224, 224, 3)
optim_1 = Adam(learning_rate=0.0001)
n_classes=6
vgg_model = model(input_shape, n_classes, optim_1, fine_tune=2)
vgg_model.load_weights('/content/drive/MyDrive/vgg/tune_model19.weights.best.hdf5')
# prediction on model
vgg_preds = vgg_model.predict(img)
vgg_pred_classes = np.argmax(vgg_preds, axis=1)
c2.header('Output')
c2.subheader('Predicted class :')
c2.write(classes[vgg_pred_classes[0]] )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment