File size: 941 Bytes
d341b17
21f5137
 
 
 
d341b17
 
21f5137
d341b17
 
 
 
 
21f5137
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
title: MathSnap Deblur
emoji: 🔍
colorFrom: green
colorTo: gray
sdk: gradio
sdk_version: 6.31.0
python_version: "3.12"
app_file: app.py
pinned: false
license: mit
---

# MathSnap Deblur

Sharpens blurry photos of printed math pages for the MathSnap app's preview. It runs NAFNet
(GoPro motion-deblur, width 64) on free ZeroGPU hardware, in 384×384 tiles with feathered seams.

- Endpoint: Gradio API `/deblur` taking `[jpeg_base64, key]`. It returns a base64 JPEG of at most 2048 px.
- Only the MathSnap Supabase function knows the key. Set it as the Space secret `DEBLUR_KEY` (32+ characters).
- Images are processed in memory and are never logged or stored.

Model: [NAFNet](https://github.com/megvii-research/NAFNet) by megvii-research (MIT). Weights:
[mlx-community/NAFNet-GoPro-width64](https://huggingface.co/mlx-community/NAFNet-GoPro-width64) (MIT),
pinned to revision `09d01a2c` and checked against their SHA-256 at startup.