Spaces:
Running
Running
Commit
·
3ff595d
1
Parent(s):
58538bf
do not specify font
Browse files
app.py
CHANGED
@@ -98,11 +98,11 @@ def retrieve_results(selected_dataset, selected_sequence, selected_models, selec
|
|
98 |
if row_idx == 0:
|
99 |
pad_height = font_size+padding*2
|
100 |
pad_txt_str = ",pad={}:{}:0:{}:white".format(w+padding*2, h+font_size+padding*4, pad_height)
|
101 |
-
text_str = get_text_str(pad_height, w, cur_model['display_name'],
|
102 |
pad_txt_str = pad_txt_str + "," + text_str
|
103 |
elif row_idx > 0 and col_idx == 0:
|
104 |
pad_txt_str = ",pad={}:ih:{}:0:white".format(w + left_pad + padding*2, left_pad)
|
105 |
-
text_str = get_text_str("h", left_pad, model_viz[row_idx]['display_name'],
|
106 |
pad_txt_str = pad_txt_str + "," + text_str
|
107 |
else:
|
108 |
pad_txt_str = ""
|
@@ -149,8 +149,6 @@ def retrieve_results(selected_dataset, selected_sequence, selected_models, selec
|
|
149 |
|
150 |
st.title("Result Analysis Tool")
|
151 |
|
152 |
-
font_path = "font/Ubuntu-B.ttf"
|
153 |
-
|
154 |
base_data_dir = "data"
|
155 |
dataset_cfg_path = os.path.join("cfg", "dataset")
|
156 |
model_cfg_path = os.path.join("cfg", "model")
|
|
|
98 |
if row_idx == 0:
|
99 |
pad_height = font_size+padding*2
|
100 |
pad_txt_str = ",pad={}:{}:0:{}:white".format(w+padding*2, h+font_size+padding*4, pad_height)
|
101 |
+
text_str = get_text_str(pad_height, w, cur_model['display_name'], font_size)
|
102 |
pad_txt_str = pad_txt_str + "," + text_str
|
103 |
elif row_idx > 0 and col_idx == 0:
|
104 |
pad_txt_str = ",pad={}:ih:{}:0:white".format(w + left_pad + padding*2, left_pad)
|
105 |
+
text_str = get_text_str("h", left_pad, model_viz[row_idx]['display_name'], font_size)
|
106 |
pad_txt_str = pad_txt_str + "," + text_str
|
107 |
else:
|
108 |
pad_txt_str = ""
|
|
|
149 |
|
150 |
st.title("Result Analysis Tool")
|
151 |
|
|
|
|
|
152 |
base_data_dir = "data"
|
153 |
dataset_cfg_path = os.path.join("cfg", "dataset")
|
154 |
model_cfg_path = os.path.join("cfg", "model")
|
utils.py
CHANGED
@@ -37,10 +37,10 @@ def get_path_for_viz(basedir, dataset, sequence, model, viz):
|
|
37 |
return video_path
|
38 |
|
39 |
|
40 |
-
def get_text_str(height, width, text,
|
41 |
-
return "drawtext=
|
42 |
"fontsize={}:fontcolor={}:" \
|
43 |
-
"x=({}-text_w)/2:y=({}-text_h)/2".format(
|
44 |
|
45 |
|
46 |
def get_video_height(video_path):
|
|
|
37 |
return video_path
|
38 |
|
39 |
|
40 |
+
def get_text_str(height, width, text, fontsize, fontcolor="black"):
|
41 |
+
return "drawtext=text='{}':" \
|
42 |
"fontsize={}:fontcolor={}:" \
|
43 |
+
"x=({}-text_w)/2:y=({}-text_h)/2".format(text, fontsize, fontcolor, width, height)
|
44 |
|
45 |
|
46 |
def get_video_height(video_path):
|