Skip to main content

Module sr

Module sr 

Source
Expand description

Super-resolution — specialized_libs::computer_vision::sr.

Modules§

cnn_light_session
Tier: CnnLight — lightweight learned SR (FSRCNN / ESPCN).
device_policy
B2 — SR device policy (classical path honesty before WGSL land).
esrgan_session
Tier: EsrganEdge — compact Real-ESRGAN generative SR.
onnx_sr_session
Shared ONNX Runtime session helper for learned super-resolution tiers (feature vision-onnx).
super_resolve
Unified classical super-resolution entry (Track B0 / SR0).
super_resolve_tiled
SR1 — tiled classical super-resolution (plan → extract → SR tile → blend).
swin_session
Tier: SwinRestore — SwinIR transformer SR (heavy, tiled for large stills).
tile_blend
SR1 — feather-blend an upscaled tile into a full-frame output.
tile_extract
SR1 — extract an input tile (RGB8 packed) into a caller buffer.
tile_plan
SR1 — plan overlapping tiles for bounded SR (VRAM/RAM-aware).

Structs§

SrReport
Report returned after a successful enhance.
SrRequest
Caller request for super_resolve.
SrSessionInfo
Metadata after a session probe (always available for tests, feature or not).
TilePolicy
Tiling policy for classical and learned SR backends.
TileRect
Axis-aligned tile on the input image (pre-scale).

Enums§

ClassicalKernel
Classical resampling kernel.
EnhancementMode
Enhancement honesty mode. Medical/forensic paths use Sharpen.
SrBackend
Super-resolution backend. Only classical for B0; more variants later.
SrSessionError
Errors for the learned SR session layer. Mirrors vision’s OnnxSessionError with an added InvalidParameter for bad request geometry.

Constants§

DEFAULT_OVERLAP
Default overlap (pixels on input side).
DEFAULT_TILE
Default edge-friendly tile size (pixels on input side).

Functions§

blend_tile_into_accum
Blend one already scaled tile into float accumulators.
cnn_light_super_resolve
Super-resolve rgb by scale using a CnnLight (FSRCNN/ESPCN) ONNX weight.
esrgan_super_resolve
Super-resolve rgb by scale using a Real-ESRGAN-compact ONNX weight.
estimate_tile_count
How many tiles would be planned.
extract_tile_rgb8
Copy rect from full-frame RGB8 (src_w × src_h × 3) into out (at least rect.w*rect.h*3).
finalize_blend
Divide accum by weight into out RGB8.
plan_tiles
Plan a grid of overlapping tiles covering [0,width) × [0,height).
probe_sr_asset
Probe an SR weight file for a tier.
super_resolve
Super-resolve RGB8 into caller buffer (out ≥ w*scale * h*scale * 3).
super_resolve_tiled
Super-resolve using overlapping tiles and feather blend.
super_resolve_tiled_default
Convenience: tiled with default policy.
super_resolve_tiled_with_policy
Tiled classical with the same device honesty.
super_resolve_with_policy
Super-resolve with explicit thermal + VRAM policy (B2 surface).
swin_super_resolve
Super-resolve rgb by scale using a SwinIR (restoration) ONNX weight.