Views
No views yet
dbnet_resnet18_fpnc_1200e_icdar2015
(Apache 2.0). This is the ICDAR 2015 Incidental Scene Text / Challenge 4
detector benchmark, not the separate ICDAR2015-TextSR dataset. Reported
benchmark scores are P=0.885, R=0.758, H=0.817.| Variant | Size | Cosine vs F32 | max_abs | Detection quality |
|---|---|---|---|---|
| F32 | 47 MB | baseline | — | reference |
| F16 | 24 MB | 1.000000 | 2.4e-3 | identical |
| Q8_0 | 13 MB | 1.000000 | 1.9e-2 | identical (21/21 regions) |
| Q4_K | 7 MB | 1.000000 | 2.9e-1 | identical (21/21 regions) |
1# Full OCR pipeline (detect + recognize)
2crispembed --det dbnet-ic15-q8_0.gguf \
3 -m trocr-small-printed-q8_0.gguf \
4 --ocr document.png
5
6# JSON output
7crispembed --det dbnet-ic15-q8_0.gguf \
8 -m trocr-small-printed-q8_0.gguf \
9 --ocr document.png --json1#include "crispembed.h"
2
3void *ctx = crispembed_ocr_init("dbnet-ic15-q8_0.gguf",
4 "trocr-small-printed-q8_0.gguf", 4);
5int n;
6const crispembed_ocr_result *r = crispembed_ocr(ctx, "image.png", &n);
7for (int i = 0; i < n; i++)
8 printf("(%g,%g): %s\n", r[i].x, r[i].y, r[i].text);
9crispembed_ocr_free(ctx);Input image (resized, padded to 32x)
|
+-> ResNet-18 backbone (stem + 4 stages x 2 BasicBlocks)
| Stage 0: 64ch, stride 4 Stage 1: 128ch, stride 8
| Stage 2: 256ch, stride 16 Stage 3: 512ch, stride 32
|
+-> FPNC neck (FPN-Cat variant)
| 4x lateral 1x1 conv -> top-down upsample+add
| 4x smooth 3x3 conv (256->64) -> concat 4x64=256ch
|
+-> DBHead probability branch
3x3 conv (256->64) + ReLU
ConvTranspose2d (64->64, k=2, s=2) + ReLU
ConvTranspose2d (64->1, k=2, s=2) + sigmoid1pip install gguf numpy torch mmengine
2
3# Download MMOCR checkpoint
4wget -q "https://download.openmmlab.com/mmocr/textdet/dbnet/dbnet_resnet18_fpnc_1200e_icdar2015/dbnet_resnet18_fpnc_1200e_icdar2015_20220825_221614-7c0e94f2.pth"
5
6# Convert
7python models/convert-dbnet-to-gguf.py \
8 --checkpoint dbnet_resnet18_fpnc_1200e_icdar2015_20220825_221614-7c0e94f2.pth \
9 --output dbnet-ic15-f32.gguf
10
11# Quantize
12crispembed-quantize dbnet-ic15-f32.gguf dbnet-ic15-q8_0.gguf q8_0
13crispembed-quantize dbnet-ic15-f32.gguf dbnet-ic15-q4_k.gguf q4_kapache-2.0. This repository redistributes under the same terms; it grants no rights the upstream licence does not.