https://github.com/lwaif/DFDNet
Note: This branch contains all the restoration results, including 512×512 face region and the final result by putting the enhanced face to the origial input. The former version that can only generate the face result is put in master branch
Overview of our proposed method. It mainly contains two parts: (a) the off-line generation of multi-scale component dictionaries from large amounts of high-quality images, which have diverse poses and expressions. K-means is adopted to generate K clusters for each component (i.e., left/right eyes, nose and mouth) on different feature scales. (b) The restoration process and dictionary feature transfer (DFT) block that are utilized to provide the reference details in a progressive manner. Here, DFT-i block takes the Scale-i component dictionaries for reference in the same feature level.
(a) Offline generation of multi-scale component dictionaries.
(b) Architecture of our DFDNet for dictionary feature transfer.
Downloading from the following url and put them into ./.
The folder structure should be:
.
├── checkpoints
│ ├── facefh_dictionary
│ │ └── latest_net_G.pth
├── weights
│ └── vgg19.pth
├── DictionaryCenter512
│ ├── right_eye_256_center.npy
│ ├── right_eye_128_center.npy
│ ├── right_eye_64_center.npy
│ ├── right_eye_32_center.npy
│ └── ...
└── ...
(Video Installation Tutorial. Thanks for bycloudump's tremendous help.)
cd ./FaceLandmarkDetection
python setup.py install
cd ..
python test_FaceDict.py --test_path ./TestData/TestWhole --results_dir ./Results/TestWholeResults --upscale_factor 4 --gpu_ids 0
--test_path # test image path
--results_dir # save the results path
--upscale_factor # the upsample factor for the final result
--gpu_ids # gpu id. if use cpu, set gpu_ids=-1
Note: our DFDNet can only generate 512×512 face result for any given face image.
# Save the input image.
# Save the crop and align parameters for copying the face result to the original input.
# Save the cropped face images and resize them to 512×512.
# Save the facial landmarks for RoIAlign.
# Save the face restoration result (512×512).
# Save the final restoration result by putting the enhanced face to the original input.
Input | Crop and Align | Restore Face | Final Results (UpScaleWhole=4) |
---|---|---|---|
@InProceedings{Li_2020_ECCV,
author = {Li, Xiaoming and Chen, Chaofeng and Zhou, Shangchen and Lin, Xianhui, Zuo, Wangmeng and Zhang, Lei},
title = {Blind Face Restoration via Deep Multi-scale Component Dictionaries},
booktitle = {ECCV},
year = {2020}
}
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。