Views
No views yet
1try (CraftTextDetector detector = CraftTextDetector.builder().build()) {
2 List<TextRegion> regions = detector.detect(Path.of("document.jpg"));
3 for (TextRegion r : regions) {
4 System.out.printf("Text at [%.0f, %.0f, %.0f, %.0f] (confidence=%.2f)%n",
5 r.box().x1(), r.box().y1(), r.box().x2(), r.box().y2(),
6 r.confidence());
7 }
8}| 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