Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
| 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"))
|