Skip to content
Snippets Groups Projects
Commit 838d3459 authored by razvan841's avatar razvan841
Browse files

added debugging toggle

parent 1926e167
Branches
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense # type:
import os
import json
DEBUGGING = True
# extract 9 patches from the image assuming the image
# contains only the cube and is properly aligned.
def extract_patches(image):
......@@ -125,12 +125,13 @@ def main():
else:
# Show the incorrect patch
patch = test_patches[i]
cv2.imshow("Incorrect Patch", patch)
print(f"File: {file_name}, Patch: {i}")
print(f"Predicted: {pred}, True: {true}")
print("Press any key to continue...")
cv2.waitKey(0) # Wait for a key press
cv2.destroyAllWindows() # Close the window
if(DEBUGGING):
cv2.imshow("Incorrect Patch", patch)
print(f"File: {file_name}, Patch: {i}")
print(f"Predicted: {pred}, True: {true}")
print("Press any key to continue...")
cv2.waitKey(0) # Wait for a key press
cv2.destroyAllWindows() # Close the window
accuracy = (correct / total) * 100 if total > 0 else 0
print(f"Accuracy: {accuracy:.2f}%")
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment