Spaces:
Sleeping
Sleeping
Update Face_Censoring.py
Browse files- Face_Censoring.py +5 -4
Face_Censoring.py
CHANGED
@@ -2,16 +2,17 @@ import cv2
|
|
2 |
import streamlit as st
|
3 |
|
4 |
def censor_face(filePath):
|
5 |
-
|
6 |
-
output_file = 'censored_' + str(filePath.name)
|
7 |
-
|
|
|
8 |
success, frame = video.read()
|
9 |
|
10 |
height = frame.shape[0]
|
11 |
width = frame.shape[1]
|
12 |
|
13 |
face_cascade=cv2.CascadeClassifier('XML\faces.xml')
|
14 |
-
output=cv2.VideoWriter(
|
15 |
|
16 |
while success:
|
17 |
faces = face_cascade.detectMultiScale(frame, 1.1, 4)
|
|
|
2 |
import streamlit as st
|
3 |
|
4 |
def censor_face(filePath):
|
5 |
+
|
6 |
+
output_file = 'Output\censored_' + str(filePath.name)
|
7 |
+
|
8 |
+
video=cv2.VideoCapture(filePath.name + ".mp4")
|
9 |
success, frame = video.read()
|
10 |
|
11 |
height = frame.shape[0]
|
12 |
width = frame.shape[1]
|
13 |
|
14 |
face_cascade=cv2.CascadeClassifier('XML\faces.xml')
|
15 |
+
output=cv2.VideoWriter(output_file, cv2.VideoWriter_fourcc(*'mp4v'), 30, (width, height))
|
16 |
|
17 |
while success:
|
18 |
faces = face_cascade.detectMultiScale(frame, 1.1, 4)
|