--- license: mit tags: - mlx - image-to-image - scratch-detection - photo-restoration library_name: mlx --- # BOPBTL-scratch-detection-fp32-mlx The scratch/defect **detector** from Microsoft's *Bringing Old Photos Back to Life* ([microsoft/Bringing-Old-Photos-Back-to-Life](https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life)), converted for MLX: grayscale photo in → per-pixel damage probability out. - `UNet(in=1, out=1, depth=4, conv_num=2, wf=6, batch_norm, up_mode="upsample", antialiasing=True)`, 37,626,177 params, fp32 (150.6 MB — the released 1.90 GiB checkpoint minus its Adam state). - Keys are the original torch `state_dict` names (NCHW conv layout), including BatchNorm running stats and the BlurPool `filt` buffers — consumers transpose per their framework's convention. - Reference behaviour: short-side-256 (/16-aligned) BICUBIC resize, grayscale, Normalize([.5],[.5]); `sigmoid(out) ≥ 0.4` is upstream's mask threshold. **Swift consumer:** [`xocialize/mlx-bopbtl-swift`](https://github.com/xocialize/mlx-bopbtl-swift) — parity-locked at **119.8 dB worst** vs fp32 PyTorch (and the reason its forward runs on the CPU stream is documented there: a measured Metal fp32 conv2d divergence window, not a preference). ## License MIT — the upstream LICENSE file, all source headers, and README §License (which extends MIT to "the codes and the pretrained model" verbatim). The training dataset was never released; the model cannot be retrained or audited.