--- license: mit library_name: pytorch pipeline_tag: image-to-image tags: - super-resolution - onnx - pytorch - npu - game-video - minecraft - wuthering-waves --- # LunaSR General MC65-WW35 x2 Tiny x2 luminance super-resolution model specialized for captured game footage. The training patch mixture used approximately 65% Minecraft frames and 35% Wuthering Waves frames. contains no source videos, extracted frames, faces, or training dataset. ## Model - Architecture: Dense8-B6 - Parameters: 3,876 - Scale: x2 - Signal: gamma-encoded BT.709 luma - Output: luma residual, not complete RGB - PyTorch checkpoint: `pytorch_model.pt` - Fixed-shape ONNX: `model.onnx` The ONNX graph accepts `[1, 1, 540, 960]` float32 luma and returns `[1, 1, 1080, 1920]` float32 residual. Compose the final image as: ```text rgb_hr = clamp(bilinear_x2(rgb_lr) + luma_residual, 0, 1) ``` The same residual is added to R, G, and B to preserve the bilinearly upscaled chroma. ## Quick start ```powershell python -m pip install -r requirements.txt python -m scripts.upscale_images ` --input "input.png" ` --output "output" ` --checkpoint pytorch_model.pt ` --device cuda ` --save-bilinear ``` Video upscaling requires FFmpeg and FFprobe on PATH: ```powershell python scripts/upscale_video.py ` --input "input.mp4" ` --output "output.mp4" ` --checkpoint pytorch_model.pt ` --device cuda ` --batch-size 16 ``` If the source container reports incorrect FPS metadata, normalize the input timestamps first or correct the output timestamps afterward. ## External holdout results BT.709 luma PSNR improvement over bilinear x2: | Domain | Baseline | Model | Delta | |---|---:|---:|---:| | Minecraft | 40.369 dB | 42.566 dB | +2.197 dB | | Wuthering Waves | 46.005 dB | 47.874 dB | +1.869 dB | The 65:35 weighted delta was `+2.082 dB`. See `metrics/model_domain_eval_matrix.json` for the reproducible evaluation record. ## Validation - ONNX checker: passed - ONNX Runtime CPU execution: passed - PyTorch vs ONNX maximum absolute error: `3.8743019104e-7` - ONNX operators: `Add`, `Conv`, `DepthToSpace`, `Relu` - Actual Intel NPU/OpenVINO runtime: not tested RTX 4060 Ti FP32 measurements for the CUDA-resident RGB composition path: | Input -> output | Batch 1 throughput | |---|---:| | 256x256 -> 512x512 | about 1,148 fps | | 512x512 -> 1024x1024 | about 534 fps | These are implementation-specific local measurements, not guaranteed device performance. ## Limitations - Single-frame model; no explicit temporal loss or recurrent state. - Trained primarily on two game domains and may oversharpen unrelated animation, text, faces, or photographic content. - The provided ONNX uses a fixed input shape for current NPU compiler compatibility. - RGB reconstruction preserves bilinear chroma and only predicts shared luma detail. ## Files - `model.onnx`: fixed 960x540 residual-only ONNX - `model.json`: deployment contract - `model.verification.json`: numerical verification - `pytorch_model.pt`: original training checkpoint - `lunasr/model.py`: architecture definition - `scripts/`: image, video, export, and CUDA benchmark utilities - `SHA256SUMS.txt`: file integrity manifest