Sunil Sarolkar commited on
Commit ·
9c9d73e
1
Parent(s): 6dd4ed2
handled error with file
Browse files
app.py
CHANGED
|
@@ -644,11 +644,14 @@ elif app_mode =='Run on Test Videos':
|
|
| 644 |
|
| 645 |
# st.text('Video Processed')
|
| 646 |
with view.container():
|
| 647 |
-
writer
|
| 648 |
-
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
|
|
|
|
|
|
|
|
|
| 652 |
# out.release()
|
| 653 |
|
| 654 |
print(f'Output file - {output_file}')
|
|
|
|
| 644 |
|
| 645 |
# st.text('Video Processed')
|
| 646 |
with view.container():
|
| 647 |
+
if writer is not None: # ✅ safeguard
|
| 648 |
+
writer.close()
|
| 649 |
+
output_video = open(output_file,'rb')
|
| 650 |
+
out_bytes = output_video.read()
|
| 651 |
+
st.video(out_bytes)
|
| 652 |
+
print(f'Output file - {output_file}')
|
| 653 |
+
else:
|
| 654 |
+
st.warning("No video was processed, writer is empty.")
|
| 655 |
# out.release()
|
| 656 |
|
| 657 |
print(f'Output file - {output_file}')
|