craft-mlt-25k-onnx
This repository contains an optimized ONNX version of the CRAFT (Character Region Awareness for Text) model.
Model Details
- Architecture: CRAFT (VGG16-based)
- Format: ONNX (Single File)
- Opset: 18
- Task: Scene Text Detection
Input Requirements
- Shape:
[batch_size, 3, height, width] - Constraints:
heightandwidthmust be multiples of 32. - Normalization: Scale pixels to
[0, 1](divide by 255).
Usage
import onnxruntime as ort
from huggingface_hub import hf_hub_download
# Download and load model
model_path = hf_hub_download(repo_id="KvaytG/craft-mlt-25k-onnx", filename="craft.onnx")
session = ort.InferenceSession(model_path, providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
# Prepare input (example)
# img_tensor shape: (1, 3, 768, 768)
outputs = session.run(None, {'input': img_tensor})
Credits
Original model by Clova AI Research.
License
Licensed under the MIT license.