# Predict labels for images imgs, lbls, names = predict(predict_loader, model) # Iterate over classified images for idx, image in enumerate(imgs): plt.figure(figsize=(8,6)) plt.imshow(image.squeeze(), cmap="gray") plt.title(f"nFile: {names[idx]}, Predicted label: {lbls[idx]}", fontsize=18) plt.axis("off") plt.show() plt.close()