Skip to main content

Module swin_session

Module swin_session 

Source
Expand description

Tier: SwinRestore — SwinIR transformer SR (heavy, tiled for large stills).

Permissive weight source (gated ①, see docs/plans/gated-av-jobs-2026.md §2, row “SR SwinIR-heavy”): SwinIR (MIT/Apache), converted to ONNX, dropped into vendor/vision/sr/swinir/. Large stills are processed tiled by the existing SR tiling runtime; this adapter runs one tile/frame per call.

Pipeline: SwinIR is a full RGB restorer. We normalise RGB8 → [0,1] planar 1×3×H×W, run the ONNX model, and denormalise the 1×3×(H·s)×(W·s) output to RGB8 into out.

This adapter targets the restoration / Sharpen SwinIR variants and is therefore reported non-generative (generative = false): it reconstructs detail without hallucinating texture, keeping it usable for the honest (medical/forensic) path. (SwinIR also has GAN “real-world” variants — those would be wired as a distinct generative tier, not here.)

  • #[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§

swin_super_resolve
Super-resolve rgb by scale using a SwinIR (restoration) ONNX weight.