ORB-HD / deface

Video anonymization by face detection
MIT License
638 stars 89 forks source link

image quality degradation #31

Closed kimjh069 closed 1 year ago

kimjh069 commented 1 year ago

Hi, Thanks for sharing such a good work.

While testing deface, I found degradation of image quality in the output images (even without any face). (For example, input_image.png 917.3kB => input_image_anonymized.png 758.4kB) Is there an optional argument or something to let the image quality same in the output image?

Thank you.

kimjh069 commented 1 year ago

I found that it is "imageio" that causes quality loss when writing image by "imageio.imsave(opath, frame)". The quality could be preserved when an image is read with imageio and saved with cv2 like:

frame = imageio.imread(ipath)
cv2.imwrite(opath, frame[:,  :,  ::-1])