Spaces:
Runtime error
Runtime error
ercanburak
commited on
Commit
•
df9abf4
1
Parent(s):
5c6d504
ui draft
Browse files- app.py +55 -0
- data/BS_ERGB.json +18 -0
- data/ECD.json +43 -0
- data/ECD_FAST.json +24 -0
- data/HDR.json +11 -0
- data/HQF.json +22 -0
- data/MVSEC.json +38 -0
- data/MVSEC_NIGHT.json +11 -0
- utils.py +44 -0
app.py
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
from utils import get_dataset_config_names, get_sequence_names, pretrained_models_dict, full_ref_metrics, no_ref_metrics
|
4 |
+
|
5 |
+
# st.header("EVREAL - Event-based Video Reconstruction Evaluation and Analysis Library")
|
6 |
+
#
|
7 |
+
# paper_link = "https://arxiv.org/abs/2305.00434"
|
8 |
+
# code_link = "https://github.com/ercanburak/EVREAL"
|
9 |
+
# page_link = "https://ercanburak.github.io/evreal.html"
|
10 |
+
#
|
11 |
+
# st.markdown("Paper: " + paper_link, unsafe_allow_html=True)
|
12 |
+
# st.markdown("Code: " + paper_link, unsafe_allow_html=True)
|
13 |
+
# st.markdown("Page: " + paper_link, unsafe_allow_html=True)
|
14 |
+
|
15 |
+
st.title("Result Analysis Tool")
|
16 |
+
|
17 |
+
datasets = get_dataset_config_names("data")
|
18 |
+
dataset_sequences_dict = {}
|
19 |
+
for dataset in datasets:
|
20 |
+
dataset_sequences_dict[dataset] = get_sequence_names("data", dataset)
|
21 |
+
datasets = list(dataset_sequences_dict.keys())
|
22 |
+
|
23 |
+
pretrained_models = list(pretrained_models_dict.keys())
|
24 |
+
|
25 |
+
selected_pretrained_model_names = st.multiselect(
|
26 |
+
'Select multiple methods to compare',
|
27 |
+
pretrained_models)
|
28 |
+
|
29 |
+
col1, col2, col3 = st.columns(3)
|
30 |
+
|
31 |
+
# A selectbox on the sidebar, for selecting dataset:
|
32 |
+
with col1:
|
33 |
+
selected_dataset = st.selectbox(
|
34 |
+
'Select dataset',
|
35 |
+
options=datasets
|
36 |
+
)
|
37 |
+
|
38 |
+
# A selectbox on the sidebar, for selecting sequence:
|
39 |
+
with col2:
|
40 |
+
selected_sequence = st.selectbox(
|
41 |
+
'Select sequence',
|
42 |
+
options=dataset_sequences_dict[selected_dataset]
|
43 |
+
)
|
44 |
+
|
45 |
+
metric_names = no_ref_metrics if selected_dataset in ["ECD_FAST", "MVSEC_NIGHT", "HDR"] else full_ref_metrics
|
46 |
+
metric_names = [name.upper() for name in metric_names]
|
47 |
+
|
48 |
+
selected_metric_names = st.multiselect('Select metrics to display', metric_names)
|
49 |
+
|
50 |
+
other_visualizations = ["ground truth frames", "event_rates", "event_images", "histograms"]
|
51 |
+
|
52 |
+
selected_viz = st.multiselect('Select other visualizations to display', other_visualizations)
|
53 |
+
|
54 |
+
if not st.button('Get Results'):
|
55 |
+
st.stop()
|
data/BS_ERGB.json
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "BS_ERGB",
|
3 |
+
"root_path": "data/test/BS_ERGB",
|
4 |
+
"loader_type": "MMP",
|
5 |
+
"sequences":
|
6 |
+
{
|
7 |
+
"may29_handheld_01": {},
|
8 |
+
"may29_handheld_02": {},
|
9 |
+
"may29_handheld_03": {},
|
10 |
+
"may29_handheld_04": {},
|
11 |
+
"may29_rooftop_handheld_01": {},
|
12 |
+
"may29_rooftop_handheld_02": {},
|
13 |
+
"may29_rooftop_handheld_03": {},
|
14 |
+
"may29_rooftop_handheld_05": {},
|
15 |
+
"street_crossing_07": {},
|
16 |
+
"street_crossing_08": {}
|
17 |
+
}
|
18 |
+
}
|
data/ECD.json
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "ECD",
|
3 |
+
"root_path": "data/test/ECD",
|
4 |
+
"loader_type": "MMP",
|
5 |
+
"sequences":
|
6 |
+
{
|
7 |
+
"calibration":
|
8 |
+
{
|
9 |
+
"start_time_s": 5.0,
|
10 |
+
"end_time_s": 20.0
|
11 |
+
},
|
12 |
+
"boxes_6dof":
|
13 |
+
{
|
14 |
+
"start_time_s": 5.0,
|
15 |
+
"end_time_s": 20.0
|
16 |
+
},
|
17 |
+
"dynamic_6dof":
|
18 |
+
{
|
19 |
+
"start_time_s": 5.0,
|
20 |
+
"end_time_s": 20.0
|
21 |
+
},
|
22 |
+
"office_zigzag":
|
23 |
+
{
|
24 |
+
"start_time_s": 5.0,
|
25 |
+
"end_time_s": 12.0
|
26 |
+
},
|
27 |
+
"poster_6dof":
|
28 |
+
{
|
29 |
+
"start_time_s": 5.0,
|
30 |
+
"end_time_s": 20.0
|
31 |
+
},
|
32 |
+
"shapes_6dof":
|
33 |
+
{
|
34 |
+
"start_time_s": 5.0,
|
35 |
+
"end_time_s": 20.0
|
36 |
+
},
|
37 |
+
"slider_depth":
|
38 |
+
{
|
39 |
+
"start_time_s": 1.0,
|
40 |
+
"end_time_s": 2.5
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
data/ECD_FAST.json
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "ECD_FAST",
|
3 |
+
"root_path": "data/test/ECD",
|
4 |
+
"loader_type": "MMP",
|
5 |
+
"sequences":
|
6 |
+
{
|
7 |
+
"boxes_6dof":
|
8 |
+
{
|
9 |
+
"start_time_s": 20.0
|
10 |
+
},
|
11 |
+
"dynamic_6dof":
|
12 |
+
{
|
13 |
+
"start_time_s": 20.0
|
14 |
+
},
|
15 |
+
"poster_6dof":
|
16 |
+
{
|
17 |
+
"start_time_s": 20.0
|
18 |
+
},
|
19 |
+
"shapes_6dof":
|
20 |
+
{
|
21 |
+
"start_time_s": 20.0
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
data/HDR.json
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "HDR",
|
3 |
+
"root_path": "data/test/TPAMI20",
|
4 |
+
"loader_type": "MMP",
|
5 |
+
"sequences":
|
6 |
+
{
|
7 |
+
"hdr_selfie": {},
|
8 |
+
"hdr_sun": {},
|
9 |
+
"hdr_tunnel": {}
|
10 |
+
}
|
11 |
+
}
|
data/HQF.json
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "HQF",
|
3 |
+
"root_path": "data/test/HQF",
|
4 |
+
"loader_type": "MMP",
|
5 |
+
"sequences":
|
6 |
+
{
|
7 |
+
"bike_bay_hdr": {},
|
8 |
+
"boxes": {},
|
9 |
+
"desk": {},
|
10 |
+
"desk_fast": {},
|
11 |
+
"desk_hand_only": {},
|
12 |
+
"desk_slow": {},
|
13 |
+
"engineering_posters": {},
|
14 |
+
"high_texture_plants": {},
|
15 |
+
"poster_pillar_1": {},
|
16 |
+
"poster_pillar_2": {},
|
17 |
+
"reflective_materials": {},
|
18 |
+
"slow_and_fast_desk": {},
|
19 |
+
"slow_hand": {},
|
20 |
+
"still_life": {}
|
21 |
+
}
|
22 |
+
}
|
data/MVSEC.json
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "MVSEC",
|
3 |
+
"root_path": "data/test/MVSEC",
|
4 |
+
"loader_type": "MMP",
|
5 |
+
"sequences":
|
6 |
+
{
|
7 |
+
"indoor_flying1_data":
|
8 |
+
{
|
9 |
+
"start_time_s": 10.0,
|
10 |
+
"end_time_s": 70.0
|
11 |
+
},
|
12 |
+
"indoor_flying2_data":
|
13 |
+
{
|
14 |
+
"start_time_s": 10.0,
|
15 |
+
"end_time_s": 70.0
|
16 |
+
},
|
17 |
+
"indoor_flying3_data":
|
18 |
+
{
|
19 |
+
"start_time_s": 10.0,
|
20 |
+
"end_time_s": 70.0
|
21 |
+
},
|
22 |
+
"indoor_flying4_data":
|
23 |
+
{
|
24 |
+
"start_time_s": 10.0,
|
25 |
+
"end_time_s": 19.8
|
26 |
+
},
|
27 |
+
"outdoor_day1_data":
|
28 |
+
{
|
29 |
+
"start_time_s": 0.0,
|
30 |
+
"end_time_s": 60.0
|
31 |
+
},
|
32 |
+
"outdoor_day2_data":
|
33 |
+
{
|
34 |
+
"start_time_s": 100.0,
|
35 |
+
"end_time_s": 160.0
|
36 |
+
}
|
37 |
+
}
|
38 |
+
}
|
data/MVSEC_NIGHT.json
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "MVSEC_NIGHT",
|
3 |
+
"root_path": "data/test/MVSEC",
|
4 |
+
"loader_type": "MMP",
|
5 |
+
"sequences":
|
6 |
+
{
|
7 |
+
"outdoor_night1_data": {},
|
8 |
+
"outdoor_night2_data": {},
|
9 |
+
"outdoor_night3_data": {}
|
10 |
+
}
|
11 |
+
}
|
utils.py
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import glob
|
3 |
+
import json
|
4 |
+
from pathlib import Path
|
5 |
+
from collections import OrderedDict
|
6 |
+
|
7 |
+
|
8 |
+
pretrained_models_dict = {'E2VID': "0000_000012", 'FireNet': "0000_000020",
|
9 |
+
'E2VID+': "0000_000000", 'FireNet+': "0000_000002",
|
10 |
+
'ET-Net': "0000_000030", 'SSL_E2VID': "0000_000040",
|
11 |
+
'SPADE_E2VID': "0000_000050"}
|
12 |
+
|
13 |
+
full_ref_metrics = ['mse', 'ssim', 'lpips']
|
14 |
+
no_ref_metrics = ['brisque', 'niqe', 'maniqa']
|
15 |
+
|
16 |
+
|
17 |
+
def read_json(fname):
|
18 |
+
fname = Path(fname)
|
19 |
+
with fname.open('rt') as handle:
|
20 |
+
return json.load(handle, object_hook=OrderedDict)
|
21 |
+
|
22 |
+
|
23 |
+
def get_filenames(base_path, filename_pattern):
|
24 |
+
file_names = []
|
25 |
+
glob_pattern = os.path.join(base_path, filename_pattern)
|
26 |
+
file_paths = glob.glob(glob_pattern)
|
27 |
+
for file_path in file_paths:
|
28 |
+
file_name = Path(file_path).stem
|
29 |
+
file_names.append(file_name)
|
30 |
+
return file_names
|
31 |
+
|
32 |
+
|
33 |
+
def get_dataset_config_names(data_configs_path):
|
34 |
+
data_configs_filename_pattern = "*.json"
|
35 |
+
return get_filenames(data_configs_path, data_configs_filename_pattern)
|
36 |
+
|
37 |
+
|
38 |
+
def get_sequence_names(data_configs_path, dataset_name):
|
39 |
+
sequences = []
|
40 |
+
dataset_file_name = os.path.join(data_configs_path, dataset_name + ".json")
|
41 |
+
dataset_config = read_json(dataset_file_name)
|
42 |
+
for sequence in dataset_config['sequences']:
|
43 |
+
sequences.append(sequence)
|
44 |
+
return sequences
|