ercanburak commited on
Commit
3e36801
1 Parent(s): cebe383

add progress bar for video download

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -73,6 +73,10 @@ selected_visualizations = [viz for viz in visualizations if viz['display_name']
73
  if not st.button('Get Results'):
74
  st.stop()
75
 
 
 
 
 
76
  gt_only_viz = [viz for viz in selected_visualizations if viz['viz_type'] == 'gt_only']
77
  model_only_viz = [viz for viz in selected_visualizations if viz['viz_type'] == 'model_only']
78
  both_viz = [viz for viz in selected_visualizations if viz['viz_type'] == 'both']
@@ -95,6 +99,8 @@ gt_viz.extend([viz for viz in gt_only_viz if viz['gt_type'] == 'event'])
95
  num_gt_rows = len(gt_viz)
96
  num_rows = max(num_model_rows, num_gt_rows)
97
 
 
 
98
  if len(gt_viz) > 0:
99
  selected_models.append(ground_truth)
100
 
@@ -125,6 +131,7 @@ else:
125
  for row_idx in range(num_rows):
126
  for col_idx in range(num_cols):
127
  vid_idx = len(video_paths)
 
128
  cur_model = selected_models[col_idx]
129
  if cur_model['name'] == "gt":
130
  if row_idx < len(gt_viz):
 
73
  if not st.button('Get Results'):
74
  st.stop()
75
 
76
+ st.write("Retrieving results...")
77
+ progress_bar = st.progress(0)
78
+
79
+
80
  gt_only_viz = [viz for viz in selected_visualizations if viz['viz_type'] == 'gt_only']
81
  model_only_viz = [viz for viz in selected_visualizations if viz['viz_type'] == 'model_only']
82
  both_viz = [viz for viz in selected_visualizations if viz['viz_type'] == 'both']
 
99
  num_gt_rows = len(gt_viz)
100
  num_rows = max(num_model_rows, num_gt_rows)
101
 
102
+ total_videos_needed = len(selected_models) * num_model_rows + num_gt_rows
103
+
104
  if len(gt_viz) > 0:
105
  selected_models.append(ground_truth)
106
 
 
131
  for row_idx in range(num_rows):
132
  for col_idx in range(num_cols):
133
  vid_idx = len(video_paths)
134
+ progress_bar.progress(float(vid_idx) / total_videos_needed)
135
  cur_model = selected_models[col_idx]
136
  if cur_model['name'] == "gt":
137
  if row_idx < len(gt_viz):