/ Модель

Характеристики

Лицензия
Своя лицензия
Библиотека
onnxruntime
Опубликована
15 окт 2026

real-esrgan-gfpgan-onnx

Преобразование изображенийИзображение, текст → изображение
0скачиваний за 30 дней0лайковвеса обновлены15 окт 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Набор ONNX-моделей увеличивает разрешение изображений и восстанавливает лица, удаляя шум, размытие и JPEG-артефакты.

Это набор моделей Real-ESRGAN, GFPGAN, RetinaFace и ParseNet, подготовленных smile-forge в формате ONNX для запуска через ONNX Runtime на CPU или CUDA. Он предназначен для увеличения разрешения изображений в 2 или 4 раза, удаления JPEG-артефактов, шума и размытия, а также обнаружения и восстановления лиц с последующей вставкой результата обратно в изображение. Графы экспортированы из исходных моделей и проверены сравнением с их авторскими конвейерами; для восстановления лиц используются также детектор и сегментационная маска.

Набор подходит для интеграции в приложения обработки изображений, в том числе через C#; заявлена совместимость с ONNX Runtime 1.30 и новее. Обработка может выполняться по тайлам, а для повышения качества лица выравниваются и обрабатываются отдельно. Репозиторий содержит ONNX-графы; лицензия указана как other, поэтому конкретные условия использования следует сверить с файлами лицензии и условиями исходных проектов.

Сценарии применения

  • увеличение изображений в 2 или 4 раза
  • восстановление лиц на старых или повреждённых фотографиях
  • удаление шума и JPEG-артефактов с изображений
  • повышение чёткости размытых изображений
  • интеграция восстановления фотографий в приложения на ONNX Runtime

Ограничения

Для восстановления лиц требуются отдельные этапы обнаружения, выравнивания и вставки маски; графы детектора возвращают сырые выходы, которые вызывающий код должен декодировать и фильтровать. Для альфа-канала README описывает обработку как оттенков серого, а конкретная лицензия в метаданных обозначена только как other.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Real-ESRGAN, GFPGAN, RetinaFace and ParseNet for ONNX Runtime

The models behind Real-ESRGAN's upscaling and GFPGAN's face restoration, as ONNX graphs for ONNX Runtime on CPU or CUDA: a picture made twice or four times its size — or kept at its size and cleaned — its JPEG blocks, noise and softness taken out, and each face in it found, remade and pasted back. Built for Nexaflow, whose AI host runs them from C# for its picture tools; usable by anything that runs ONNX Runtime 1.30 or later.

FolderWhatFromSize
upscaler-x4/Real-ESRGAN x4plus: a picture four times the sizexinntao/Real-ESRGAN v0.1.069 MB
upscaler-x2/Real-ESRGAN x2plus: twice the sizeReal-ESRGAN v0.2.169 MB
face-detector/RetinaFace, ResNet-50: faces and five points on eachxinntao/facexlib v0.1.0110 MB
face-restorer/GFPGAN v1.4: a face remadeTencentARC/GFPGAN v1.3.0341 MB
face-parser/ParseNet: which of a remade face is pasted backfacexlib v0.2.285 MB

Every graph is fp32 — fast enough on a GPU (a 512-pixel tile through the 2x upscaler in 47 ms on an RTX PRO 6000, GFPGAN in 13 ms) that half precision is not worth a second build — and takes the same thing: planar RGB from 0 to 1, rgb [1, 3, height, width]. Each does its model's own normalisation inside.

How it was built

upstream.py fetches Real-ESRGAN, GFPGAN, facexlib and BasicSR at pinned commits; Build-PictureTools.ps1 downloads the weights from their makers' releases and checks each against its hash; build_picture_tools.py traces each model with torch.onnx.export and holds the graph to the original in fp32, on CPU and on CUDA: the upscalers and GFPGAN agree to 2×10⁻⁵ of their largest output, RetinaFace to 2.4×10⁻⁴, and ParseNet chooses every pixel's class as the original does. The graphs differ from the originals only where they had to:

  • GFPGAN with the noise it was trained with. StyleGAN2, GFPGAN's decoder, adds fresh noise at each layer on every call by default. The weights carry the noise they were trained with, and the graph uses it, so a face is remade the same way every time — as GFPGAN's own code does with randomize_noise=False. Its encoder's last feature map is flattened with reshape where GFPGAN views it, which the exporter cannot trace.
  • The detector's outputs are raw. RetinaFace gives, for each of its priors, the regressions of a box and five points against the prior, and the face score alone of its two classes; decoding them against the priors, thresholding and suppressing overlaps are the caller's, as in facexlib.
  • The parser's output is the mask. ParseNet's 19 classes are reduced to the mask GFPGAN pastes through — 1 over the face's own parts (skin, brows, eyes, glasses, ears, nose, lips), 0 over background, neck, clothes, hair and hat — before the blur the caller gives it.

picture_reference.py runs the makers' own pipelines — RealESRGANer and GFPGANer — on their own sample pictures, which is what a port is held to. Nexaflow's C# pipeline, through these graphs, makes the same pictures as those pipelines to within 54–66 dB PSNR at every scale, faces repaired or not, and finds the same faces.

Using it

Upscaling, as RealESRGANer.enhance: pad the picture by reflection at the right and bottom to even sides for the 2x model; cut it into tiles, each reading a margin of its neighbours (Nexaflow: 512 pixels through the 2x model, 256 through the 4x — which works at the tile's full size and peaks near 8 GB at 512 — each with a 24-pixel margin), and keep each tile's own square of what comes back; round each value to 8 bits. An alpha channel goes through the model as grey. To keep the picture at its size, make it twice the size with the 2x model and bring it back with Lanczos.

Faces, as GFPGANer.enhance with facexlib's FaceRestoreHelper: run face-detector.onnx on the picture; decode each prior's regressions with variances 0.1 and 0.2 against priors of sizes 16 and 32, 64 and 128, 256 and 512 over steps of 8, 16 and 32 pixels; keep scores over 0.97, drop boxes overlapping a surer one by more than 0.4, and faces whose eyes are under 5 pixels apart. Align each face to the template (192.98, 239.95) (318.90, 240.19) (256.63, 314.02) (201.26, 371.41) (313.09, 371.15) with a similarity fit and warp it into a 512-pixel crop (border RGB 132, 133, 135); remake it with face-restorer.onnx; take face-parser.onnx's mask of the remade face, blur it twice with a 101-pixel Gaussian of sigma 11, clear its outer 10 pixels, and paste the face back through it with the inverse warp — scaled to the upscaled picture, moved by half a scaled pixel.

Licences

The graphs are conversions of their makers' weights, under their makers' licences; the recipe here is Apache-2.0.

ModelCode and weights
Real-ESRGAN x4plus, x2plusBSD-3-Clause
GFPGAN v1.4Apache-2.0 (the clean architecture: no NVIDIA StyleGAN2 CUDA ops)
RetinaFace (facexlib)MIT
ParseNet (facexlib)MIT

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · onnxruntime

Нельзя запустить

Модель выложена только в формате ONNX, рантайм загружает PyTorch-веса.

Ревизия весов
f19c614

0 моделей