| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
⭐ If SSDiff is helpful to your paper or project, please consider star this repo or cite our paper. Thanks! 🤗
# git clone this repository git clone https://github.com/PRIS-CV/SSDiff cd SSDiff # create new anaconda env conda create -n SSDiff python=3.8 -y conda activate SSDiff # install python dependencies conda install mpi4py pip3 install -r requirements.txt pip install -e .
Download the pretrained face generation diffusion model iddpm_ffhq512_ema500000.pth from [Google Drive] to models folder, the pretrained face parsing model resnet34.pt from [Google Drive] to models/face_parsing folder, the pretrained style transfer model photo_image.pt from [Google Drive] to CAP_VSTNet/checkpoints folder.
Download the facelib and dlib pretrained models from [Releases | OneDrive] to the weights/facelib folder and weights folder, separately. You can manually download the pretrained models OR download by running the following command:
python scripts/download_pretrained_models.py facelib python scripts/download_pretrained_models.py dlib (only for dlib face detector)
Download the pretrained restore model codeformer.pth and pretrained VQGAN model vqgan_code1024.pth from [Releases | OneDrive] to the models/restorer folder and models/vqgan folder, separately. You can manually download the pretrained models OR download by running the following command:
python scripts/download_pretrained_models.py CodeFormer
Download the real-world old face photo test set that collected from the Internet called VintageFace from [Google Drive], including old face photos with their corresponding processed masks.
You can put the testing images in the inputs/TestWhole folder. If you would like to test on cropped and aligned faces, you can put them in the inputs/cropped_faces folder. You can get the cropped and aligned faces by running the following command:
# you may need to install dlib via: conda install -c conda-forge dlib python extract_faces.py -i [input folder] -o [output folder]
You can download visual results from Google Drive.
🧑🏻 Old-Photo Face Restoration (cropped and aligned face)
# For generating reference pseudo-labelled faces (512x512) python inference_fake_label.py --task old_photo_restoration_pseudo --in_dir [input_image_path] --mask_dir [mask_path] --out_dir [output_image_path] --guidance_scale 0.001 --seed 4321
# For breakage, fading, and blur faces (512x512) # --self_dir refers to the path of the pseudo-labelled faces generated in the previous stage. python inference_final.py --task old_photo_restoration --in_dir [input_image_path] --mask_dir [mask_path] --out_dir [output_image_path] --guidance_scale 0.0035 --self_dir [pseudo_labelled_faces_path] --seed 4321
🧑🏻 Face Restoration (cropped and aligned face)
# For only blur faces (512x512), You may choose not to use pseudo-labelled faces. python inference_final.py --task restoration --in_dir [input_image_path] --out_dir [output_image_path] --guidance_scale 0.05
If our work is useful for your research, please consider citing:
@inproceedings{li2025self,
title={Self-Supervised Selective-Guided Diffusion Model for Old-Photo Face Restoration},
author={Li, Wenjie and Wang, Xiangyi and Guo, Heng and Gao, Guangwei and Ma, Zhanyu},
booktitle={NeurIPs},
year={2025}
}
If you have any questions, please feel free to reach me out at lewj2408@gmail.com.
| Back | FazBrowse Home | New Git URL |