Spaces:
Runtime error
Runtime error
ercanburak
commited on
Commit
•
902a216
1
Parent(s):
523c064
fix gt column height issue
Browse files
app.py
CHANGED
@@ -110,14 +110,17 @@ xstack_input_parts = []
|
|
110 |
layout_parts = []
|
111 |
video_paths = []
|
112 |
row_heights = [""]*num_rows
|
|
|
113 |
for row_idx in range(num_rows):
|
114 |
for col_idx in range(num_cols):
|
|
|
115 |
cur_model = selected_models[col_idx]
|
116 |
if cur_model['name'] == "gt":
|
117 |
if row_idx < len(gt_viz):
|
118 |
video_path = get_path_for_viz(data_base_path, selected_dataset, selected_sequence, cur_model, gt_viz[row_idx])
|
119 |
# if not os.path.isfile(video_path):
|
120 |
# raise ValueError("Video path does not exist: " + video_path)
|
|
|
121 |
else:
|
122 |
continue
|
123 |
else:
|
@@ -128,7 +131,6 @@ for row_idx in range(num_rows):
|
|
128 |
else:
|
129 |
continue
|
130 |
|
131 |
-
vid_idx = len(video_paths)
|
132 |
if row_heights[row_idx] == "":
|
133 |
row_heights[row_idx] = "h{}".format(vid_idx)
|
134 |
input_filter_part = "[{}:v]scale={}:-1,{}[v{}]".format(vid_idx, w, pad_str, vid_idx)
|
@@ -137,7 +139,10 @@ for row_idx in range(num_rows):
|
|
137 |
xstack_input_parts.append(xstack_input_part)
|
138 |
video_paths.append(video_path)
|
139 |
layout_w = "+".join(["w{}".format(i) for i in range(col_idx)]) if col_idx > 0 else "0"
|
140 |
-
|
|
|
|
|
|
|
141 |
layout_part = layout_w + "_" + layout_h
|
142 |
layout_parts.append(layout_part)
|
143 |
|
|
|
110 |
layout_parts = []
|
111 |
video_paths = []
|
112 |
row_heights = [""]*num_rows
|
113 |
+
gt_viz_indices = []
|
114 |
for row_idx in range(num_rows):
|
115 |
for col_idx in range(num_cols):
|
116 |
+
vid_idx = len(video_paths)
|
117 |
cur_model = selected_models[col_idx]
|
118 |
if cur_model['name'] == "gt":
|
119 |
if row_idx < len(gt_viz):
|
120 |
video_path = get_path_for_viz(data_base_path, selected_dataset, selected_sequence, cur_model, gt_viz[row_idx])
|
121 |
# if not os.path.isfile(video_path):
|
122 |
# raise ValueError("Video path does not exist: " + video_path)
|
123 |
+
gt_viz_indices.append(vid_idx)
|
124 |
else:
|
125 |
continue
|
126 |
else:
|
|
|
131 |
else:
|
132 |
continue
|
133 |
|
|
|
134 |
if row_heights[row_idx] == "":
|
135 |
row_heights[row_idx] = "h{}".format(vid_idx)
|
136 |
input_filter_part = "[{}:v]scale={}:-1,{}[v{}]".format(vid_idx, w, pad_str, vid_idx)
|
|
|
139 |
xstack_input_parts.append(xstack_input_part)
|
140 |
video_paths.append(video_path)
|
141 |
layout_w = "+".join(["w{}".format(i) for i in range(col_idx)]) if col_idx > 0 else "0"
|
142 |
+
if cur_model['name'] == "gt":
|
143 |
+
layout_h = "+".join(["h{}".format(i) for i in gt_viz_indices[:-1]]) if row_idx > 0 else "0"
|
144 |
+
else:
|
145 |
+
layout_h = "+".join(row_heights[:row_idx]) if row_idx > 0 else "0"
|
146 |
layout_part = layout_w + "_" + layout_h
|
147 |
layout_parts.append(layout_part)
|
148 |
|