TheKnight115 commited on
Commit
92dd333
·
verified ·
1 Parent(s): d69ce69

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -74,6 +74,10 @@ def process_video_and_save(uploaded_file):
74
  current_frame = 0
75
  start_time = time.time() # Start the timer
76
 
 
 
 
 
77
  while True:
78
  ret, frame = video.read()
79
  if not ret:
@@ -91,6 +95,11 @@ def process_video_and_save(uploaded_file):
91
 
92
  current_frame += 1
93
 
 
 
 
 
 
94
  video.release()
95
 
96
  # Create a video writer to save the processed frames
 
74
  current_frame = 0
75
  start_time = time.time() # Start the timer
76
 
77
+ # Initialize the progress bar in Streamlit
78
+ progress_bar = st.progress(0)
79
+ progress_text = st.empty()
80
+
81
  while True:
82
  ret, frame = video.read()
83
  if not ret:
 
95
 
96
  current_frame += 1
97
 
98
+ # Update progress bar and percentage text
99
+ progress_percentage = int((current_frame / total_frames) * 100)
100
+ progress_bar.progress(progress_percentage)
101
+ progress_text.text(f"Processing frame {current_frame}/{total_frames} ({progress_percentage}%)")
102
+
103
  video.release()
104
 
105
  # Create a video writer to save the processed frames