Character Region Awareness for Text Detection
Paper
β’
1904.01941
β’
Published
ONNX export of CRAFT (Character Region Awareness for Text Detection) trained on SynthText + IC13/IC17 (MLT 25K variant).
Converted for use with inference4j, an inference-only AI library for Java.
try (CraftTextDetector detector = CraftTextDetector.builder().build()) {
List<TextRegion> regions = detector.detect(Path.of("document.jpg"));
for (TextRegion r : regions) {
System.out.printf("Text at [%.0f, %.0f, %.0f, %.0f] (confidence=%.2f)%n",
r.box().x1(), r.box().y1(), r.box().x2(), r.box().y2(),
r.confidence());
}
}
| Property | Value |
|---|---|
| Architecture | VGG16-BN backbone + U-Net decoder |
| Task | Text detection (character-level region + affinity maps) |
| Training data | SynthText + ICDAR 2013/2017 (MLT) |
| Weights | craft_mlt_25k.pth from clovaai/CRAFT-pytorch |
| ONNX opset | 17 |
| Input | [batch, 3, height, width] β RGB, ImageNet-normalized, dimensions must be multiples of 32 |
| Output: score_map | [batch, height/2, width/2, 2] β channel 0: region score, channel 1: affinity score |
| Output: feature_map | [batch, 32, height/2, width/2] β intermediate features (optional, for refinement) |
| Dynamic axes | Batch, height, and width are dynamic |
(pixel / 255 - mean) / std[0.485, 0.456, 0.406][0.229, 0.224, 0.225][1, 3, H, W]clip(region_score + affinity_score, 0, 1)low_text_threshold (default 0.4)text_threshold (default 0.7)Baek, Y., Lee, B., Han, D., Yun, S., & Lee, H. (2019). Character Region Awareness for Text Detection. CVPR 2019. arXiv:1904.01941
The original CRAFT model weights are released under the MIT License by Clova AI Research (NAVER Corp).