Skip to content

Commit 9113b91

Browse files
committed
Save images to dest event if no face is found. Fix typo in readme. Added optimize-image plugin for post-blur minification. Make blur more blurry.
1 parent 73a2686 commit 9113b91

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

faceblur.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def face_blur(src_img, dest_img, zoom_in=1):
2626
print("%s:There are %s faces at " % (src_img, len(face_locations)), face_locations)
2727
else:
2828
print('%s:There are no any face.' % (src_img))
29+
cv2.imwrite(dest_img, cv2.imread(src_img))
2930
return False
3031

3132
#Blur all face
@@ -41,7 +42,7 @@ def face_blur(src_img, dest_img, zoom_in=1):
4142
face_image = photo[top:bottom, left:right]
4243

4344
# Blur the face image
44-
face_image = cv2.GaussianBlur(face_image, (21, 21), 0)
45+
face_image = cv2.GaussianBlur(face_image, (31, 31), 0)
4546

4647
# Put the blurred face region back into the frame image
4748
photo[top:bottom, left:right] = face_image

requirements.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ google-pasta==0.2.0
1414
grpcio==1.28.1
1515
h5py==2.10.0
1616
idna==2.9
17+
joblib==0.14.1
1718
Keras-Applications==1.0.8
1819
Keras-Preprocessing==1.1.0
1920
Markdown==3.2.1
2021
numpy==1.18.2
2122
oauthlib==3.1.0
2223
opencv-python==4.2.0.34
2324
opt-einsum==3.2.0
24-
Pillow==7.1.1
25+
optimize-images==1.3.4
26+
piexif==1.1.3
27+
Pillow==5.0.0
2528
protobuf==3.11.3
2629
pyasn1==0.4.8
2730
pyasn1-modules==0.2.8

0 commit comments

Comments
 (0)