ICTMCG / Make-Your-Anchor

[CVPR 2024] Make-Your-Anchor: A Diffusion-based 2D Avatar Generation Framework.
327 stars 20 forks source link

what facial segment model have you used for inpainting mask? #17

Closed YuGuilliman closed 1 month ago

YuGuilliman commented 1 month ago

Hi, I am now trying to build my dataset for fine-tuning and generation. However, I do not know how to create the inpainting mask, and it seems that you haven't specified which facial segmentation model you used for it. Could you please let me know the method you used?

image

bone-11 commented 1 month ago

Face parsing model is borrowed from https://github.com/zllrunning/face-parsing.PyTorch and can be found in inference directory with get_mask.py and /res/cp/79999_iter.pt. You can process the faces with the code in inference.sh, where the pathes should be modified.

# face alignment
python face_alignment.py \
    --imgdir_pth $body_input_dir \
    --raw_imgdir_pth $body_save_dir \
    --results_dir $body_headcrop_root \
    --crop_size 512

# get face mask
python get_mask.py \
    --input_pth $head_dir \
    --mask_pth $head_mask_dir
YuGuilliman commented 1 month ago

thank you for your quick response!