Blind face restoration is a highly ill-posed problem that often requires auxiliary guidance to 1) improve the mapping from degraded inputs to desired outputs, or 2) complement high-quality details lost in the inputs. In this paper, we demonstrate that a learned discrete codebook prior in a small proxy space largely reduces the uncertainty and ambiguity of restoration mapping by casting blind face restoration as a code prediction task, while providing rich visual atoms for generating high-quality faces. Under this paradigm, we propose a Transformer-based prediction network, named CodeFormer, to model global composition and context of the low-quality faces for code prediction, enabling the discovery of natural faces that closely approximate the target faces even when the inputs are severely degraded. To enhance the adaptiveness for different degradation, we also propose a controllable feature transformation module that allows a flexible trade-off between fidelity and quality. Thanks to the expressive codebook prior and global modeling, CodeFormer outperforms state of the arts in both quality and fidelity, showing superior robustness to degradation. Extensive experimental results on synthetic and real-world datasets verify the effectiveness of our method.
翻译:失明面部恢复是一个非常糟糕的问题,往往需要辅助性指导,以便(1) 改进从退化的投入到预期产出的映射,或者(2) 补充投入中丢失的高质量细节。在本文件中,我们证明,在小型代用空间之前,一个学习到的离散代码本,作为代码预测任务,在提供丰富的视觉原子以生成高质量面部的同时,可以减少失明面部恢复绘图的不确定性和模糊性,同时提供丰富的视觉原子以生成高质量的面部。在这个模式下,我们提议建立一个以变异器为基础的预测网络,名为代码Former,以模拟低质量面部的全球构成和背景,以进行代码预测,从而能够发现即使在投入严重退化时仍然接近目标面部的自然面部。为了增强不同退化的适应性,我们还提议了一个可控特性转换模块,允许在真实性和质量之间进行灵活的交易。由于事先和全球模型的直观代码,代码超越了艺术在质量和真实性两方面的状态,显示高度的退化性。关于合成和真实性数据集的大规模实验结果可以验证我们的方法的有效性。