Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -77,7 +77,7 @@ def add_title(img_bgr, title):
|
|
77 |
return np.vstack([bar, img_bgr])
|
78 |
|
79 |
def parse_xml_roi_points(xml_path):
|
80 |
-
"""Parse
|
81 |
polys = []
|
82 |
try:
|
83 |
tree = ET.parse(xml_path)
|
@@ -165,8 +165,11 @@ def homography_all_detectors(flat_file, persp_file, json_file, xml_file):
|
|
165 |
results.append((cv2.cvtColor(composite, cv2.COLOR_BGR2RGB), f"{method} Grid"))
|
166 |
download_files.append(file_name)
|
167 |
|
168 |
-
|
169 |
-
|
|
|
|
|
|
|
170 |
|
171 |
# ---------------- Gradio UI ----------------
|
172 |
iface = gr.Interface(
|
|
|
77 |
return np.vstack([bar, img_bgr])
|
78 |
|
79 |
def parse_xml_roi_points(xml_path):
|
80 |
+
"""Parse XML, return list of polygons (Nx2 points)."""
|
81 |
polys = []
|
82 |
try:
|
83 |
tree = ET.parse(xml_path)
|
|
|
165 |
results.append((cv2.cvtColor(composite, cv2.COLOR_BGR2RGB), f"{method} Grid"))
|
166 |
download_files.append(file_name)
|
167 |
|
168 |
+
# pad list with "" instead of None (to avoid Gradio error)
|
169 |
+
while len(download_files) < 5:
|
170 |
+
download_files.append("")
|
171 |
+
|
172 |
+
return [results] + download_files[:5]
|
173 |
|
174 |
# ---------------- Gradio UI ----------------
|
175 |
iface = gr.Interface(
|