Old-photo scratch detection — ONNX for the browser
ONNX export of the scratch detection network from Microsoft's
Bringing Old Photos Back to Life
(Global/checkpoints/detection/FT_Epoch_latest.pt), for running in the browser with
onnxruntime-web.
Used by the free Doetra Photo Restorer to find scratches, cracks and dust automatically before they are repaired.
What changed vs. the original
- Exported to ONNX (opset 17) with dynamic height/width and the sigmoid included in the graph.
- Weights stored as fp16 and cast to fp32 inside the graph (≈75 MB instead of ≈150 MB, 99.999% identical masks).
Input / output
| Name | Shape | Notes | |
|---|---|---|---|
| Input | input | [1, 1, H, W] float32 grayscale | (gray/255 − 0.5) / 0.5; H and W multiples of 16 |
| Output | prob | [1, 1, H, W] float32 | scratch probability; the original uses ≥ 0.4 |
Credits & license
- Bringing Old Photos Back to Life, Ziyu Wan et al., CVPR 2020 — © Microsoft Corporation, MIT License.
- This export is redistributed under the same MIT license.