aashwinik commited on
Commit
0032752
1 Parent(s): 30cc99d

Update Face_Censoring.py

Browse files
Files changed (1) hide show
  1. Face_Censoring.py +3 -3
Face_Censoring.py CHANGED
@@ -9,7 +9,7 @@ except Exception:
9
 
10
  def censor_face(filePath):
11
 
12
- output_file = 'Output/censored_' + str(filePath.name) + '.mp4'
13
 
14
  video=cv2.VideoCapture(filePath.name)
15
  success, frame = video.read()
@@ -22,7 +22,7 @@ def censor_face(filePath):
22
  #gray=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
23
  #st.write("Frame: " + str(frame))
24
 
25
- output=cv2.VideoWriter(output_file, cv2.VideoWriter_fourcc(*'mp4v'), 30, (width, height))
26
 
27
  while success:
28
  faces = face_cascade.detectMultiScale(frame, 1.1, 4)
@@ -34,5 +34,5 @@ def censor_face(filePath):
34
  output.release()
35
 
36
  tfile2 = tempfile.NamedTemporaryFile(delete=False)
37
- tfile2.write(output.read())
38
  return tfile2
 
9
 
10
  def censor_face(filePath):
11
 
12
+ #output_file = 'Output/censored_' + str(filePath.name) + '.mp4'
13
 
14
  video=cv2.VideoCapture(filePath.name)
15
  success, frame = video.read()
 
22
  #gray=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
23
  #st.write("Frame: " + str(frame))
24
 
25
+ output=cv2.VideoWriter("Censored.mp4", cv2.VideoWriter_fourcc(*'mp4v'), 30, (width, height))
26
 
27
  while success:
28
  faces = face_cascade.detectMultiScale(frame, 1.1, 4)
 
34
  output.release()
35
 
36
  tfile2 = tempfile.NamedTemporaryFile(delete=False)
37
+ tfile2.write("Censored.mp4")
38
  return tfile2