Suggestion: Change default values of variables in Convert_Masked
self.erosion_kernel = None
self.blurSize = 8 # Default: 2
self.seamlessClone = True # Default: False
self.maskType = 'FaceHullAndRect' # Default: Rect
In my testing, this produces far better results than the default values in almost every case, and would help prevent confusion for less technically inclined users were they made the default. Thoughts?
Or atleast add optional command line parameters to tweak these
Thanks for your feedback! I'd be happy if we had some command line params for that but, unfortunately, no one seems to be available for that now. If you have skills you can do a pull request, it will certainly be accepted
I'll give it a shot :)
@Irastris @Clorr ,i think seamlessclone and masktype can be abjust but not sure the erosion kernel can be adjust or not. default will be "none" , if want to change, what will be the command?
i suggest we can put at USAGE.md , the command to change. refer to this
https://www.reddit.com/r/deepfakes/comments/7mbzu2/patched_face_alignment_and_merge_scripts_with/
[–]depfakacc[S] 2 points 1 month ago These need to be used together as the new align_images_masked.py also saves the face points detected to the json file along with the filenames and transforms.
A few interresting options to pass merge_faces_masked.py:
--seamlessClone=yes will attempt to use opencv seamless clone on the faces, otherwise alpha blending is used.
--blurSize=2 will blur the borders of the mask to give a smooth transition between faces and head.
--erosionKernelSize=2 will nibble at the borders of the face mask, making the face area used smaller before the merge is performed.
--maskType=FaceHullAndRect takes three possible options:
Rect - The standard transformed square edges. FaceHull - Create an outline from the detected face points and mask with these. FaceHullAndRect - a AND of the two keeping portions of the face that are both within the detected face points and the face rect.
align_images_masked.py also has new options for --startFrame and --maxFrames which control the image number to start conversion at, and the maximum number of images to convert.
Welp, I actually have no idea how, my Python knowledge is very lacking. I can't figure out how to pass the args from the ConvertImage class in convert.py to the Convert class in Convert_Masked.py.
If you feel more comfortable with it, try to do it in a config file
@ruah1984 @Irastris I just merged some commits that add most of the options that you want.
no --startFrame and --maxFrames though.
I'm trying to add a feature right now that will allow you to specify frame ranges like ./faceswap.py convert -fr 10-20 50-60 to apply conversion to those frames, while still writing the other frames out
I think this has gone beyond resolved now.
if i want to use seamless clone, what i should type in cmd.