Low Quality Faces (blurry) after detecting and warpalign faces using Facexlib #375

Open
opened 2026-01-29 21:47:19 +00:00 by claunia · 1 comment
Owner

Originally created by @humayun on GitHub (Jul 13, 2023).

0

I am using Facexlib library to detect, crop (warpalign) and resize (512x512) the faces from photographic images (high resolutions 4K or above). In some cases, the output images are low quality even though faces is bigger in size more than 1Kx1K resolutions. Here is code in Facexlib library for detecting and warpalign the faces:

self.face_helper.read_image(img)
# get face landmarks for each face
self.face_helper.get_face_landmarks_5(only_center_face=only_center_face, eye_dist_threshold=5)
# eye_dist_threshold=5: skip faces whose eye distance is smaller than 5 pixels
# align and warp each face
self.face_helper.align_warp_face()

here is link for these function: Face Detection using Facexlib

Below is Detected Image. (https://i.stack.imgur.com/VNNky.png)

Original Image is here (can not upload here as size is bigger)

How can I detect and crop (warp and align) faces from high resolution images ? I tried different interpolation method, but there is no difference in image quality. I tried following interpolation methods: cv2.INTER_NEAREST cv2.INTER_LINEAR cv2.INTER_AREA cv2.INTER_CUBIC cv2.INTER_LANCZOS4

I tried multiple interpolation techniques in warpalign method as flags, but no difference in image quality.

In my opinion, if face size is too big (more than 1000 pixels either row or column) or too small (less than 300 pixel either row or columns), in that case, it performed resize (downsize or upsize), which reduce image quality and add blurriness in the face (specially eyes and mouth). Is there any way to get high quality faces with either size (512 or bigger).

Originally created by @humayun on GitHub (Jul 13, 2023). 0 I am using Facexlib library to detect, crop (warpalign) and resize (512x512) the faces from photographic images (high resolutions 4K or above). In some cases, the output images are low quality even though faces is bigger in size more than 1Kx1K resolutions. Here is code in Facexlib library for detecting and warpalign the faces: ``` self.face_helper.read_image(img) # get face landmarks for each face self.face_helper.get_face_landmarks_5(only_center_face=only_center_face, eye_dist_threshold=5) # eye_dist_threshold=5: skip faces whose eye distance is smaller than 5 pixels # align and warp each face self.face_helper.align_warp_face() ``` here is link for these function: [Face Detection using Facexlib](https://github.com/xinntao/facexlib/blob/master/facexlib/utils/face_restoration_helper.py#L234C14-L234C14) Below is Detected Image. (https://i.stack.imgur.com/VNNky.png) [Original Image is here](https://snapshots-ml-public.s3.amazonaws.com/081A3581.png) (can not upload here as size is bigger) How can I detect and crop (warp and align) faces from high resolution images ? I tried different interpolation method, but there is no difference in image quality. I tried following interpolation methods: cv2.INTER_NEAREST cv2.INTER_LINEAR cv2.INTER_AREA cv2.INTER_CUBIC cv2.INTER_LANCZOS4 I tried multiple interpolation techniques in warpalign method as flags, but no difference in image quality. In my opinion, if face size is too big (more than 1000 pixels either row or column) or too small (less than 300 pixel either row or columns), in that case, it performed resize (downsize or upsize), which reduce image quality and add blurriness in the face (specially eyes and mouth). Is there any way to get high quality faces with either size (512 or bigger).
Author
Owner

@komilaria commented on GitHub (Sep 7, 2023):

+++++
the same issue

@komilaria commented on GitHub (Sep 7, 2023): +++++ the same issue
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TencentARC/GFPGAN#375