MrDeepFakes Forums
  • New and improved dark forum theme!
  • Guests can now comment on videos on the tube.
   
StrayNucleusChange JPG Compression Level For Extracted Faces
#1
To maintain the quality of my facesets, I have recently found out how to change the JPG compression level for extracted faces. I don't why it was switched from PNG to JPG in the first place,
but this helps a ton regardless if you care about it.

First go to your DFL folder > _internal > DeepFaceLab > mainscripts

Right click on "Extractor.py", and click 'Open with"

Then select Notepad.

Once notepad is open, next, in the top left corner, select Edit, and then Find.

In the box, type jpeg, and then click find next.

You should be taken to a line that says

Code:
cv2_imwrite(output_file, face_image, [int(cv2.IMWRITE_JPEG_QUALITY), 80] )

Next, just simply change that value to 100.


Code:
cv2_imwrite(output_file, face_image, [int(cv2.IMWRITE_JPEG_QUALITY), 100] )

Now, click find next again.

And repeat the same step for the second line.

And then save the document.

And there! Now, your JPEG won't have a bunch of compression artifacts.
#2
what's the difference between file size?
Download my videos You are not allowed to view links. Register or Login to view.
My BTC: 137LyEKiFNotLk8rcvxgn3XMAdgji3J6sM
You are not allowed to view links. Register or Login to view.: You are not allowed to view links. Register or Login to view.
!nvidia-smi
#3
(08-08-2019, 09:46 PM)tania01 Wrote: You are not allowed to view links. Register or Login to view.what's the difference between file size?

Not sure exactly, but a 3,000 face dataset is about 100 megabytes. I suppose if size is important than you can leave it alone. I just like knowing I am feeding the training algorithm the highest quality I can.

Forum Jump:

Users browsing this thread: 1 Guest(s)