4xBHI_dat2_real for Core ML (iOS)

A Core ML conversion of 4xBHI_dat2_real by Philip Hofmann. A 4x DAT2 photo restoration model trained on the BHI dataset for input degraded by noise, JPEG, and WebP compression. The weights are unchanged. This repository only adds the export.

Files

File Use
4xBHI_dat2_real_512.mlpackage Source Core ML model program (fp16), loadable with coremltools or Xcode
4xBHI_dat2_real_512_coreml_compiled.zip Pre-compiled .mlmodelc plus model.json, for direct on-device loading with MLModel(contentsOf:)

Model interface

Input image, RGB, 512 x 512
Output upscaled, RGB, 2048 x 2048
Scale 4x
Architecture DAT
Precision fp16 ML Program
Minimum OS iOS 17 / macOS 14
Compute units All (CPU, GPU, Neural Engine)

Larger images are processed as overlapping 512 x 512 tiles that are feathered back together.

Verification

Core ML output matches the PyTorch reference at 58.2 dB PSNR on a 512 test tile (maximum per-channel difference of 3/255). On an M-series Mac the model runs in about 875 ms per tile with all compute units enabled.

Conversion

Exported with coremltools 9.0 from the original checkpoint loaded through spandrel. The model is wrapped so that the input is an RGB image scaled to [0, 1] and the output is clamped and scaled back to [0, 255] as an RGB image, which lets Vision return a VNPixelBufferObservation directly.

Attribution and license

Weights by Philip Hofmann, released under CC-BY-4.0. Original release: https://huggingface.co/Phips/4xBHI_dat2_real. This conversion carries the same license and credit requirement.

Downloads last month
4
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for 333i/4xBHI_dat2_real-coreml-ios

Quantized
(1)
this model