Skip to main content

Module esrgan_session

Module esrgan_session 

Source
Expand description

Tier: EsrganEdge — compact Real-ESRGAN generative SR.

Permissive weight source (gated ①, see docs/plans/gated-av-jobs-2026.md §2, row “SR ESRGAN-edge”): Real-ESRGAN compact MIT community builds, converted to ONNX + a DiligenceNote, dropped into vendor/vision/sr/esrgan/.

Pipeline: Real-ESRGAN is a full RGB generator. We normalise RGB8 → [0,1] planar 1×3×H×W (channel-first), run the ONNX model, and denormalise the 1×3×(H·s)×(W·s) output back to RGB8 into out.

This tier is generative (generative = true): it synthesises plausible texture and MUST NOT be used where fabricated detail is unacceptable (medical/forensic) — those callers use the CnnLight / SwinRestore Sharpen tiers.

  • #[cfg(not(feature = "vision-onnx"))] → fail closed (FeatureDisabled).
  • #[cfg(feature = "vision-onnx")] → real ort inference.

No unwrap() outside #[cfg(test)].

Constants§

BACKEND_ID
Backend id reported for this tier.

Functions§

esrgan_super_resolve
Super-resolve rgb by scale using a Real-ESRGAN-compact ONNX weight.