Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
from Face_Censoring import censor_face
|
|
|
3 |
|
4 |
#UIApp starts here
|
5 |
st.set_page_config(page_title="Python - Face Censoring", page_icon=":face_in_clouds:")
|
@@ -7,8 +8,11 @@ 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 |
-
|
11 |
-
|
|
|
|
|
|
|
12 |
video_file = open(uploaded_file, 'rb')
|
13 |
video_bytes = video_file.read()
|
14 |
st.video(video_bytes)
|
|
|
1 |
import streamlit as st
|
2 |
from Face_Censoring import censor_face
|
3 |
+
import tempfile
|
4 |
|
5 |
#UIApp starts here
|
6 |
st.set_page_config(page_title="Python - Face Censoring", page_icon=":face_in_clouds:")
|
|
|
8 |
|
9 |
uploaded_file = st.file_uploader("Choose a video (only with 'mp4' extension): ", accept_multiple_files=False, type=['mp4'])
|
10 |
if uploaded_file is not None:
|
11 |
+
tfile = tempfile.NamedTemporaryFile(delete=False)
|
12 |
+
tfile.write(uploaded_file.read())
|
13 |
+
|
14 |
+
output=censor_face(tfile)
|
15 |
+
|
16 |
video_file = open(uploaded_file, 'rb')
|
17 |
video_bytes = video_file.read()
|
18 |
st.video(video_bytes)
|