Caption Remover models
ONNX models for the browser
2 min readupdated
The repository contains two popular models (LaMa for inpainting masks and CRAFT for text detection), converted to the ONNX format to run directly in the browser via GPU using ONNX Runtime Web and WebGPU. Model weights remain original, but engineers optimized them for browser environment constraints—specifically replacing FFT (Fast Fourier Transform) in LaMa with matrix multiplications. The tool is useful for web developers building client-side text removal or image editing clients.
Key features
- ONNX Runtime Web: models run directly in the browser on the user's graphics card via WebGPU.
- LaMa optimization: rewritten Fourier transform using matrix multiplications to bypass browser GPU runtime limitations.
- Two tasks: integrated models for inpainting (filling in gaps) and text detection in images.
- Original weights: high accuracy of original architectures preserved during conversion.
What you can do
- Embed in a web application: create a browser tool for removing watermarks and captions from photos.
- Client-side inpainting: use
lama-inpaint.onnxto fill in masked areas directly on the user's device. - Text detection: apply
craft-text.onnxto locate text regions in images within a web interface.
Example
The models accept float32 image tensors (RGB, values from 0 to 1) and corresponding masks for inpainting, or normalized data for text detection.
Read more
Details• Format: ONNX
• Base models: advimman/lama, clovaai/CRAFT-pytorch
• License: Apache 2.0 (lama), MIT (craft)
• Notes: lama-inpaint accuracy matches the original within 1e-5










Comments