Ayesha352 commited on
Commit
71dfbbc
·
verified ·
1 Parent(s): 94c03e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -116,7 +116,10 @@ def homography_all_detectors(flat_file, persp_file, json_file):
116
  result_rgb = cv2.cvtColor(persp_debug, cv2.COLOR_BGR2RGB)
117
 
118
  # Save result for download
119
- file_name = f"result_{method.lower()}.png"
 
 
 
120
  cv2.imwrite(file_name, cv2.cvtColor(result_rgb, cv2.COLOR_RGB2BGR))
121
 
122
  gallery_images.append((result_rgb, f"{method} Result"))
 
116
  result_rgb = cv2.cvtColor(persp_debug, cv2.COLOR_BGR2RGB)
117
 
118
  # Save result for download
119
+ base_name = os.path.splitext(os.path.basename(persp_file))[0]
120
+
121
+ # Save with same name + detector
122
+ file_name = f"{base_name}_{method.lower()}.png"
123
  cv2.imwrite(file_name, cv2.cvtColor(result_rgb, cv2.COLOR_RGB2BGR))
124
 
125
  gallery_images.append((result_rgb, f"{method} Result"))