Norod78 commited on
Commit
1c80236
1 Parent(s): c5e9b13

Image.Resampling.LANCZOS

Browse files
Files changed (1) hide show
  1. face_detection.py +2 -2
face_detection.py CHANGED
@@ -98,7 +98,7 @@ def image_align(src_img, face_landmarks, output_size=512, transform_size=2048, e
98
  shrink = int(np.floor(qsize / output_size * 0.5))
99
  if shrink > 1:
100
  rsize = (int(np.rint(float(img.size[0]) / shrink)), int(np.rint(float(img.size[1]) / shrink)))
101
- img = img.resize(rsize, Image.ANTIALIAS)
102
  quad /= shrink
103
  qsize /= shrink
104
 
@@ -135,6 +135,6 @@ def image_align(src_img, face_landmarks, output_size=512, transform_size=2048, e
135
  # Transform.
136
  img = img.transform((transform_size, transform_size), Image.QUAD, (quad + 0.5).flatten(), Image.BILINEAR)
137
  if output_size < transform_size:
138
- img = img.resize((output_size, output_size), Image.ANTIALIAS)
139
 
140
  return img, quad_orig
 
98
  shrink = int(np.floor(qsize / output_size * 0.5))
99
  if shrink > 1:
100
  rsize = (int(np.rint(float(img.size[0]) / shrink)), int(np.rint(float(img.size[1]) / shrink)))
101
+ img = img.resize(rsize, Image.Resampling.LANCZOS)
102
  quad /= shrink
103
  qsize /= shrink
104
 
 
135
  # Transform.
136
  img = img.transform((transform_size, transform_size), Image.QUAD, (quad + 0.5).flatten(), Image.BILINEAR)
137
  if output_size < transform_size:
138
+ img = img.resize((output_size, output_size), Image.Resampling.LANCZOS)
139
 
140
  return img, quad_orig