ercanburak commited on
Commit
c103e03
1 Parent(s): 0d0ab89

commit wip

Browse files
app.py CHANGED
@@ -58,7 +58,13 @@ usable_metric_display_names = get_display_names(usable_metrics)
58
  selected_metric_names = st.multiselect('Select metrics to display', usable_metric_display_names)
59
  selected_metrics = [metric for metric in usable_metrics if metric['display_name'] in selected_metric_names]
60
 
61
- selected_viz = st.multiselect('Select other visualizations to display', viz_display_names)
 
 
 
 
 
 
62
  selected_visualizations = [viz for viz in visualizations if viz['display_name'] in selected_viz]
63
 
64
  if not st.button('Get Results'):
@@ -68,21 +74,29 @@ gt_only_viz = [viz for viz in selected_visualizations if viz['viz_type'] == 'gt_
68
  model_only_viz = [viz for viz in selected_visualizations if viz['viz_type'] == 'model_only']
69
  both_viz = [viz for viz in selected_visualizations if viz['viz_type'] == 'both']
70
 
71
- recon_viz = {"name": "recon", "display_name": "Reconstruction", "viz_type": "both"}
72
  ground_truth = {"name": "gt", "display_name": "Ground Truth", "model_id": "groundtruth"}
73
 
74
  model_viz = [recon_viz] + both_viz + selected_metrics + model_only_viz
 
 
 
 
 
 
 
75
 
76
- num_columns = len(selected_models) + 1
77
- if len(gt_only_viz) > 0:
78
- num_columns += 1
79
- selected_models.append(ground_truth)
80
 
81
- num_rows = max(len(selected_metrics) + 1, len(gt_only_viz)) + 1 + len(both_viz)
 
 
 
82
 
83
  for row_idx in range(num_rows):
84
  row_visualizations = []
85
- for col_idx in range(num_columns):
86
  if row_idx == 0 and col_idx == 0:
87
  print("meta")
88
  pass
@@ -94,10 +108,6 @@ for row_idx in range(num_rows):
94
  # metric names
95
  print(model_viz[row_idx - 1]['display_name'])
96
  pass
97
- elif col_idx == num_columns - 1:
98
- # gt only viz
99
- print(gt_only_viz[row_idx - 1]['display_name'])
100
- pass
101
  else:
102
  video_path = get_path_for_viz(data_base_path, selected_dataset, selected_sequence, selected_models[col_idx - 1], model_viz[row_idx - 1])
103
  print(video_path)
 
58
  selected_metric_names = st.multiselect('Select metrics to display', usable_metric_display_names)
59
  selected_metrics = [metric for metric in usable_metrics if metric['display_name'] in selected_metric_names]
60
 
61
+ if not selected_dataset['has_frames']:
62
+ usable_viz = [viz for viz in visualizations if viz['gt_type'] != 'frame']
63
+ else:
64
+ usable_viz = visualizations
65
+ usable_viz_display_names = get_display_names(usable_viz)
66
+
67
+ selected_viz = st.multiselect('Select other visualizations to display', usable_viz_display_names)
68
  selected_visualizations = [viz for viz in visualizations if viz['display_name'] in selected_viz]
69
 
70
  if not st.button('Get Results'):
 
74
  model_only_viz = [viz for viz in selected_visualizations if viz['viz_type'] == 'model_only']
75
  both_viz = [viz for viz in selected_visualizations if viz['viz_type'] == 'both']
76
 
77
+ recon_viz = {"name": "recon", "display_name": "Reconstruction", "viz_type": "both", "gt_type": "frame"}
78
  ground_truth = {"name": "gt", "display_name": "Ground Truth", "model_id": "groundtruth"}
79
 
80
  model_viz = [recon_viz] + both_viz + selected_metrics + model_only_viz
81
+ num_model_rows = len(model_viz) + 1
82
+
83
+ gt_viz = []
84
+ if selected_dataset['has_frames']:
85
+ gt_viz.append(recon_viz)
86
+ gt_viz.extend([viz for viz in both_viz if viz['gt_type'] == 'frame'])
87
+ gt_viz.extend([viz for viz in gt_only_viz if viz['gt_type'] == 'frame'])
88
 
89
+ gt_viz.extend([viz for viz in both_viz if viz['gt_type'] == 'event'])
90
+ gt_viz.extend([viz for viz in gt_viz if viz['gt_type'] == 'event'])
 
 
91
 
92
+ num_gt_rows = len(gt_viz) + 1
93
+ num_rows = max(num_model_rows, num_gt_rows)
94
+
95
+ num_model_columns = len(selected_models) + 1
96
 
97
  for row_idx in range(num_rows):
98
  row_visualizations = []
99
+ for col_idx in range(num_model_columns):
100
  if row_idx == 0 and col_idx == 0:
101
  print("meta")
102
  pass
 
108
  # metric names
109
  print(model_viz[row_idx - 1]['display_name'])
110
  pass
 
 
 
 
111
  else:
112
  video_path = get_path_for_viz(data_base_path, selected_dataset, selected_sequence, selected_models[col_idx - 1], model_viz[row_idx - 1])
113
  print(video_path)
cfg/dataset/BS_ERGB.json CHANGED
@@ -3,7 +3,7 @@
3
  "width": 970,
4
  "height": 625,
5
  "no_ref": false,
6
- "has_gt": true,
7
  "sequences":
8
  {
9
  "may29_handheld_01": {},
 
3
  "width": 970,
4
  "height": 625,
5
  "no_ref": false,
6
+ "has_frames": true,
7
  "sequences":
8
  {
9
  "may29_handheld_01": {},
cfg/dataset/ECD.json CHANGED
@@ -3,7 +3,7 @@
3
  "width": 240,
4
  "height": 180,
5
  "no_ref": false,
6
- "has_gt": true,
7
  "sequences":
8
  {
9
  "calibration":
 
3
  "width": 240,
4
  "height": 180,
5
  "no_ref": false,
6
+ "has_frames": true,
7
  "sequences":
8
  {
9
  "calibration":
cfg/dataset/ECD_FAST.json CHANGED
@@ -3,7 +3,7 @@
3
  "width": 240,
4
  "height": 180,
5
  "no_ref": true,
6
- "has_gt": true,
7
  "sequences":
8
  {
9
  "boxes_6dof":
 
3
  "width": 240,
4
  "height": 180,
5
  "no_ref": true,
6
+ "has_frames": true,
7
  "sequences":
8
  {
9
  "boxes_6dof":
cfg/dataset/HDR.json CHANGED
@@ -3,7 +3,7 @@
3
  "width": 640,
4
  "height": 480,
5
  "no_ref": true,
6
- "has_gt": false,
7
  "sequences":
8
  {
9
  "hdr_selfie": {},
 
3
  "width": 640,
4
  "height": 480,
5
  "no_ref": true,
6
+ "has_frames": false,
7
  "sequences":
8
  {
9
  "hdr_selfie": {},
cfg/dataset/HQF.json CHANGED
@@ -3,7 +3,7 @@
3
  "width": 240,
4
  "height": 180,
5
  "no_ref": false,
6
- "has_gt": true,
7
  "sequences":
8
  {
9
  "bike_bay_hdr": {},
 
3
  "width": 240,
4
  "height": 180,
5
  "no_ref": false,
6
+ "has_frames": true,
7
  "sequences":
8
  {
9
  "bike_bay_hdr": {},
cfg/dataset/MVSEC.json CHANGED
@@ -3,7 +3,7 @@
3
  "width": 346,
4
  "height": 260,
5
  "no_ref": false,
6
- "has_gt": true,
7
  "sequences":
8
  {
9
  "indoor_flying1_data":
 
3
  "width": 346,
4
  "height": 260,
5
  "no_ref": false,
6
+ "has_frames": true,
7
  "sequences":
8
  {
9
  "indoor_flying1_data":
cfg/dataset/MVSEC_NIGHT.json CHANGED
@@ -3,7 +3,7 @@
3
  "width": 346,
4
  "height": 260,
5
  "no_ref": true,
6
- "has_gt": true,
7
  "sequences":
8
  {
9
  "outdoor_night1_data": {},
 
3
  "width": 346,
4
  "height": 260,
5
  "no_ref": true,
6
+ "has_frames": false,
7
  "sequences":
8
  {
9
  "outdoor_night1_data": {},
cfg/viz/event_images.json CHANGED
@@ -1,4 +1,5 @@
1
  {
2
  "display_name": "Event Images",
3
- "viz_type": "gt_only"
 
4
  }
 
1
  {
2
  "display_name": "Event Images",
3
+ "viz_type": "gt_only",
4
+ "gt_type": "event"
5
  }
cfg/viz/event_rate.json CHANGED
@@ -1,4 +1,5 @@
1
  {
2
  "display_name": "Event Rate",
3
- "viz_type": "gt_only"
 
4
  }
 
1
  {
2
  "display_name": "Event Rate",
3
+ "viz_type": "gt_only",
4
+ "gt_type": "event"
5
  }
cfg/viz/{gt_frames.json → gt_frames.dnu} RENAMED
File without changes
cfg/viz/histogram.json CHANGED
@@ -1,4 +1,5 @@
1
  {
2
  "display_name": "Histogram",
3
- "viz_type": "both"
 
4
  }
 
1
  {
2
  "display_name": "Histogram",
3
+ "viz_type": "both",
4
+ "gt_type": "frame"
5
  }