Skip to content

Instantly share code, notes, and snippets.

@RITIK-12
Created September 20, 2020 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RITIK-12/3fccc0dae3eb787604da6d34f69003e5 to your computer and use it in GitHub Desktop.
Save RITIK-12/3fccc0dae3eb787604da6d34f69003e5 to your computer and use it in GitHub Desktop.
# training the head of the network
H = model.fit(
aug.flow(trainX, trainY, batch_size=BS),
steps_per_epoch=len(trainX) // BS,
validation_data=(testX, testY),
validation_steps=len(testX) // BS,
epochs=EPOCHS)
# making predictions on the testing set
predIdxs = model.predict(testX, batch_size=BS)
# for each image in the testing set we need to find the index of the label with corresponding largest predicted probability
predIdxs = np.argmax(predIdxs, axis=1)
# Creating a classification report
print(classification_report(testY.argmax(axis=1), predIdxs,
target_names=lb.classes_))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment