esrgan_super_resolution

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

esrgan_super_resolution

esrgan_super_resolution

ESRGAN (Enhanced Super-Resolution GAN) aumenta la resolución de la foto del documento ×4, mejorando significativamente la calidad del face match en documentos con fotos de baja resolución o antiguas.
ESRGAN(增强型超分辨率GAN)可将证件照片的分辨率提升4倍,能显著提升低分辨率或老旧证件照片的人脸匹配质量。

When to use

适用场景

Aplicar cuando la foto extraída del documento tenga resolución menor a 100×100 píxeles o calidad BRISQUE > 50.
当从证件中提取的照片分辨率低于100×100像素,或BRISQUE质量得分大于50时使用。

Instructions

使用指南

  1. Instalar Real-ESRGAN:
    pip install realesrgan
    .
  2. Descargar modelo:
    RealESRGAN_x4plus.pth
    https://github.com/xinntao/Real-ESRGAN.
  3. Inicializar:
    upsampler = RealESRGANer(scale=4, model_path='RealESRGAN_x4plus.pth', tile=0, tile_pad=10, pre_pad=0, half=True)
    .
  4. Aplicar:
    output, _ = upsampler.enhance(face_crop, outscale=4)
    .
  5. Redimensionar resultado al tamaño esperado por ArcFace (112×112).
  6. Usar solo cuando sea necesario para no añadir latencia innecesaria.
  1. 安装Real-ESRGAN:
    pip install realesrgan
  2. 下载模型:
    RealESRGAN_x4plus.pth
    https://github.com/xinntao/Real-ESRGAN。
  3. 初始化:
    upsampler = RealESRGANer(scale=4, model_path='RealESRGAN_x4plus.pth', tile=0, tile_pad=10, pre_pad=0, half=True)
  4. 执行处理:
    output, _ = upsampler.enhance(face_crop, outscale=4)
  5. 将处理结果调整为ArcFace要求的尺寸(112×112)。
  6. 仅在必要时使用,避免增加不必要的延迟。

Notes

注意事项

  • Repositorio: https://github.com/xinntao/Real-ESRGAN
  • half=True
    usa FP16 en GPU, reduciendo memoria y aumentando velocidad.
  • Benchmark: mejora el face match score ~0.05-0.15 en fotos de documentos de baja calidad.
  • 代码仓库:https://github.com/xinntao/Real-ESRGAN
  • half=True
    会在GPU上使用FP16精度,可减少显存占用并提升运行速度。
  • 基准测试:针对低质量证件照片,可将人脸匹配得分提升约0.05-0.15。