zllrunning/face-parsing.PyTorch

Using modified BiSeNet for face parsing in PyTorch

2,587

stars

11

commits

Python

primary language

May 21, 2023

updated

bisenet
celeba-hq-dataset
face-parsing
face-segmentation
pytorch
semantic-segmentation

README

face-parsing.PyTorch

Contents

Training

  1. Prepare training data: -- download CelebAMask-HQ dataset

    -- change file path in the prepropess_data.py and run

python prepropess_data.py
  1. Train the model using CelebAMask-HQ dataset: Just run the train script:
    $ CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=2 train.py

If you do not wish to train the model, you can download our pre-trained model and save it in res/cp.

Demo

  1. Evaluate the trained model using:
# evaluate using GPU
python test.py

Face makeup using parsing maps

face-makeup.PyTorch

 HairLip
Original InputOriginal InputOriginal Input
ColorColorColor

References

Contributors

zllrunning

11 commits

zllrunning/face-parsing.PyTorch

Using modified BiSeNet for face parsing in PyTorch

2,587

stars

11

commits

Python

primary language

May 21, 2023

updated

bisenet
celeba-hq-dataset
face-parsing
face-segmentation
pytorch
semantic-segmentation

README

face-parsing.PyTorch

Contents

Training

  1. Prepare training data: -- download CelebAMask-HQ dataset

    -- change file path in the prepropess_data.py and run

python prepropess_data.py
  1. Train the model using CelebAMask-HQ dataset: Just run the train script:
    $ CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=2 train.py

If you do not wish to train the model, you can download our pre-trained model and save it in res/cp.

Demo

  1. Evaluate the trained model using:
# evaluate using GPU
python test.py

Face makeup using parsing maps

face-makeup.PyTorch

 HairLip
Original InputOriginal InputOriginal Input
ColorColorColor

References

Contributors

zllrunning

11 commits

Languages

Python

66.6%

Cuda

20.8%

C++

11.5%

C

1.1%