aashwinik commited on
Commit
8dc0a71
1 Parent(s): 61ea98b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
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=":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
 
 
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