This commit is contained in:
NathanUA 2020-11-22 17:34:28 -07:00
parent 680f940285
commit 34c7c7dc0d
11 changed files with 18 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -39,26 +39,34 @@ def crop_face(img, face):
# crop the face with a bigger bbox
hmw = h - w
hpad = int(h/2)+1
wpad = int(w/2)+1
# hpad = int(h/2)+1
# wpad = int(w/2)+1
l,r,t,b = 0,0,0,0
left = x-wpad
lpad = int(float(w)*0.4)
left = x-lpad
if(left<0):
l = lpad-x
left = 0
l = wpad-x
right = x+w+wpad
rpad = int(float(w)*0.4)
right = x+w+rpad
if(right>width):
right = width
r = right-width
top = y - hpad
right = width
tpad = int(float(h)*0.6)
top = y - tpad
if(top<0):
t = tpad-y
top = 0
t = hpad-y
bottom = y+h+int(hpad*0.5)
bpad = int(float(h)*0.2)
bottom = y+h+bpad
if(bottom>height):
bottom = height
b = bottom-height
bottom = height
im_face = img[top:bottom,left:right]
if(len(im_face.shape)==2):