Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,9 +4,20 @@ import streamlit as st
|
|
| 4 |
st.set_page_config(page_title="Python - Face Censoring", page_icon=":robot:")
|
| 5 |
st.header("Python - Face Censoring")
|
| 6 |
|
| 7 |
-
|
| 8 |
-
if
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
st.set_page_config(page_title="Python - Face Censoring", page_icon=":robot:")
|
| 5 |
st.header("Python - Face Censoring")
|
| 6 |
|
| 7 |
+
uploaded_file = st.file_uploader("Choose a video (only with 'mp4' extension): ", accept_multiple_files=False, type=['mp4'])
|
| 8 |
+
if uploaded_file is not None:
|
| 9 |
+
#call python function
|
| 10 |
+
|
| 11 |
+
video_file = open('myvideo.mp4', 'rb')
|
| 12 |
+
video_bytes = video_file.read()
|
| 13 |
+
|
| 14 |
+
st.video(video_bytes)
|
| 15 |
|
| 16 |
+
with open("censored_myvideo.mp4", "rb") as file:
|
| 17 |
+
btn = st.download_button(
|
| 18 |
+
label="Download video",
|
| 19 |
+
data=file,
|
| 20 |
+
file_name="myvideo.mp4",
|
| 21 |
+
mime="video/mp4"
|
| 22 |
+
)
|
| 23 |
+
|