Skip to content

Instantly share code, notes, and snippets.

@amankharwal

amankharwal/sign language.py Secret

Created Dec 5, 2020
Embed
What would you like to do?
# Predictions
predictions = model.predict_classes(testing_images)
for i in range(len(predictions)):
if(predictions[i] >= 9):
predictions[i] += 1
predictions[:5]
#Output
#array([ 6, 8, 11, 14, 18])
# Precision, recall, f1-score for all the classes
from sklearn.metrics import classification_report, confusion_matrix
classes = ["Class " + str(i) for i in range(26) if i != 9]
print(classification_report(data_test['label'], predictions, target_names = classes))
# Confusion Matrix for the model predictions
cm = confusion_matrix(data_test['label'],predictions)
plt.figure(figsize=(12,7))
g = sns.heatmap(cm, cmap='Reds',annot=True,
fmt='')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment