@@ -68,11 +68,11 @@ def add_labels(base64_data, yolo_model):
6868 ) # Create a separate draw object for the debug image
6969 font_size = 45
7070
71- predictions_dir = "predictions "
71+ detections_dir = "detections "
7272 label_coordinates = {} # Dictionary to store coordinates
7373
74- if not os .path .exists (predictions_dir ):
75- os .makedirs (predictions_dir )
74+ if not os .path .exists (detections_dir ):
75+ os .makedirs (detections_dir )
7676
7777 counter = 0
7878 drawn_boxes = [] # List to keep track of boxes already drawn
@@ -117,14 +117,10 @@ def add_labels(base64_data, yolo_model):
117117
118118 # Save the image
119119 timestamp = time .strftime ("%Y%m%d-%H%M%S" )
120- print ("[app.py][process_image] image" , f"prediction_{ timestamp } _labeled.png" )
121- output_path = os .path .join (predictions_dir , f"prediction_{ timestamp } _labeled.png" )
122- output_path_debug = os .path .join (
123- predictions_dir , f"prediction_{ timestamp } _debug.png"
124- )
125- output_path_original = os .path .join (
126- predictions_dir , f"prediction_{ timestamp } _original.png"
127- )
120+ print ("[app.py][process_image] image" , f"img_{ timestamp } _labeled.png" )
121+ output_path = os .path .join (detections_dir , f"img_{ timestamp } _labeled.png" )
122+ output_path_debug = os .path .join (detections_dir , f"img_{ timestamp } _debug.png" )
123+ output_path_original = os .path .join (detections_dir , f"img_{ timestamp } _original.png" )
128124
129125 image_labeled .save (output_path )
130126 image_debug .save (output_path_debug )
0 commit comments