Spaces:
Running
Running
Commit
·
8b5d61a
1
Parent(s):
16aee15
return earlier local file path calculation
Browse files
app.py
CHANGED
|
@@ -5,7 +5,6 @@ import glob
|
|
| 5 |
import streamlit as st
|
| 6 |
|
| 7 |
from utils import get_configs, get_display_names, get_path_for_viz, get_video_height, get_text_str
|
| 8 |
-
# from gdrive import download_file
|
| 9 |
|
| 10 |
# st.header("EVREAL - Event-based Video Reconstruction Evaluation and Analysis Library")
|
| 11 |
#
|
|
@@ -23,6 +22,7 @@ st.title("Result Analysis Tool")
|
|
| 23 |
|
| 24 |
font_path = "font/Ubuntu-B.ttf"
|
| 25 |
|
|
|
|
| 26 |
dataset_cfg_path = os.path.join("cfg", "dataset")
|
| 27 |
model_cfg_path = os.path.join("cfg", "model")
|
| 28 |
metric_cfg_path = os.path.join("cfg", "metric")
|
|
@@ -135,9 +135,7 @@ for row_idx in range(num_rows):
|
|
| 135 |
cur_model = selected_models[col_idx]
|
| 136 |
if cur_model['name'] == "gt":
|
| 137 |
if row_idx < len(gt_viz):
|
| 138 |
-
video_path = get_path_for_viz(selected_dataset, selected_sequence, cur_model, gt_viz[row_idx])
|
| 139 |
-
video_path = os.path.join("data", video_path)
|
| 140 |
-
# download_file(video_path, local_video_path)
|
| 141 |
if not os.path.isfile(video_path):
|
| 142 |
raise ValueError("Could not find video: " + video_path)
|
| 143 |
gt_viz_indices.append(vid_idx)
|
|
@@ -145,9 +143,7 @@ for row_idx in range(num_rows):
|
|
| 145 |
continue
|
| 146 |
else:
|
| 147 |
if row_idx < len(model_viz):
|
| 148 |
-
video_path = get_path_for_viz(selected_dataset, selected_sequence, cur_model, model_viz[row_idx])
|
| 149 |
-
video_path = os.path.join("data", video_path)
|
| 150 |
-
# download_file(video_path, local_video_path)
|
| 151 |
if not os.path.isfile(video_path):
|
| 152 |
raise ValueError("Could not find video: " + video_path)
|
| 153 |
else:
|
|
|
|
| 5 |
import streamlit as st
|
| 6 |
|
| 7 |
from utils import get_configs, get_display_names, get_path_for_viz, get_video_height, get_text_str
|
|
|
|
| 8 |
|
| 9 |
# st.header("EVREAL - Event-based Video Reconstruction Evaluation and Analysis Library")
|
| 10 |
#
|
|
|
|
| 22 |
|
| 23 |
font_path = "font/Ubuntu-B.ttf"
|
| 24 |
|
| 25 |
+
base_data_dir = "data"
|
| 26 |
dataset_cfg_path = os.path.join("cfg", "dataset")
|
| 27 |
model_cfg_path = os.path.join("cfg", "model")
|
| 28 |
metric_cfg_path = os.path.join("cfg", "metric")
|
|
|
|
| 135 |
cur_model = selected_models[col_idx]
|
| 136 |
if cur_model['name'] == "gt":
|
| 137 |
if row_idx < len(gt_viz):
|
| 138 |
+
video_path = get_path_for_viz(base_data_dir, selected_dataset, selected_sequence, cur_model, gt_viz[row_idx])
|
|
|
|
|
|
|
| 139 |
if not os.path.isfile(video_path):
|
| 140 |
raise ValueError("Could not find video: " + video_path)
|
| 141 |
gt_viz_indices.append(vid_idx)
|
|
|
|
| 143 |
continue
|
| 144 |
else:
|
| 145 |
if row_idx < len(model_viz):
|
| 146 |
+
video_path = get_path_for_viz(base_data_dir, selected_dataset, selected_sequence, cur_model, model_viz[row_idx])
|
|
|
|
|
|
|
| 147 |
if not os.path.isfile(video_path):
|
| 148 |
raise ValueError("Could not find video: " + video_path)
|
| 149 |
else:
|
utils.py
CHANGED
|
@@ -31,9 +31,9 @@ def get_display_names(configs):
|
|
| 31 |
return display_names
|
| 32 |
|
| 33 |
|
| 34 |
-
def get_path_for_viz(dataset, sequence, model, viz):
|
| 35 |
dat_seq = "_".join([dataset["name"], sequence])
|
| 36 |
-
video_path = os.path.join(model['model_id'], dat_seq, "videos", viz["name"] + ".mp4")
|
| 37 |
return video_path
|
| 38 |
|
| 39 |
|
|
|
|
| 31 |
return display_names
|
| 32 |
|
| 33 |
|
| 34 |
+
def get_path_for_viz(basedir, dataset, sequence, model, viz):
|
| 35 |
dat_seq = "_".join([dataset["name"], sequence])
|
| 36 |
+
video_path = os.path.join(basedir, model['model_id'], dat_seq, "videos", viz["name"] + ".mp4")
|
| 37 |
return video_path
|
| 38 |
|
| 39 |
|