Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,23 +1,27 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
|
3 |
#UIApp starts here
|
4 |
-
st.set_page_config(page_title="Python - Face Censoring", page_icon=":
|
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 |
-
|
10 |
|
11 |
-
video_file = open(
|
12 |
video_bytes = video_file.read()
|
13 |
-
|
14 |
st.video(video_bytes)
|
15 |
|
16 |
-
with open(
|
17 |
btn = st.download_button(
|
18 |
label="Download video",
|
19 |
data=file,
|
20 |
-
file_name=
|
21 |
mime="video/mp4"
|
22 |
)
|
|
|
|
|
|
|
|
|
23 |
|
|
|
1 |
import streamlit as st
|
2 |
+
from FaceCensoring import censor_face
|
3 |
|
4 |
#UIApp starts here
|
5 |
+
st.set_page_config(page_title="Python - Face Censoring", page_icon=":face_in_clouds:")
|
6 |
st.header("Python - Face Censoring")
|
7 |
|
8 |
uploaded_file = st.file_uploader("Choose a video (only with 'mp4' extension): ", accept_multiple_files=False, type=['mp4'])
|
9 |
if uploaded_file is not None:
|
10 |
+
output=censor_face(uploaded_file)
|
11 |
|
12 |
+
video_file = open(uploaded_file, 'rb')
|
13 |
video_bytes = video_file.read()
|
|
|
14 |
st.video(video_bytes)
|
15 |
|
16 |
+
with open(output, "rb") as file:
|
17 |
btn = st.download_button(
|
18 |
label="Download video",
|
19 |
data=file,
|
20 |
+
file_name=output,
|
21 |
mime="video/mp4"
|
22 |
)
|
23 |
+
|
24 |
+
video_file = open(output, 'rb')
|
25 |
+
video_bytes = video_file.read()
|
26 |
+
st.video(video_bytes)
|
27 |
|