Navigate:
All ReposCodeFormer
~$CODEFO0.0%

CodeFormer: Blind face restoration with transformer codebook lookup

Transformer-based face restoration using vector-quantized codebook lookup.

LIVE RANKINGS • 06:52 AM • STEADY
OVERALL
#235
10
AI & ML
#82
30 DAY RANKING TREND
ovr#235
·AI#82
STARS
17.7K
FORKS
3.7K
DOWNLOADS
7D STARS
+4
7D FORKS
+2
Tags:
See Repo:
Share:

Learn more about CodeFormer

from basicsr.archs.codeformer_arch import CodeFormer\nnet = CodeFormer().cuda()\noutput = net(input_image, w=0.5, fidelity_weight=0.5)

CodeFormer

1

Codebook-based restoration

Uses vector quantized codebook lookup to map degraded facial regions to learned high-quality representations, rather than direct pixel-level regression. This approach constrains outputs to realistic face distributions learned during training.

2

Blind restoration capability

Operates without explicit knowledge of degradation type or severity, handling mixed degradation scenarios including compression artifacts, noise, blur, and missing regions. The model generalizes across different degradation patterns without task-specific fine-tuning.

3

Multi-task framework

Supports face restoration, inpainting, and colorization through a unified architecture with task-specific checkpoints. Includes video processing support for temporal consistency and integration with multiple face detection backends including dlib and RetinaFace.


from basicsr.archs.codeformer_arch import CodeFormer
import torch

net = CodeFormer().cuda()
net.eval()

with torch.no_grad():
    restored_face = net(input_face_tensor, w=0.5, fidelity_weight=0.5)
    
result = restored_face[0].cpu().clamp(0, 1)

vv0.1.0

Initial release provides pre-trained models; release notes do not specify breaking changes, requirements, or setup steps.

  • Download pre-trained models from this release for CodeFormer inference.
  • Release notes lack migration details, dependency versions, and configuration requirements.


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers