Downloads · 30 days
138
18% of all-time downloads
cstr/surya-det-GGUF
surya-det-GGUF is a machine learning model from cstr. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as other.
GGUF conversion of the surya-ocr-2 text detector for use with CrispEmbed.
Downloads · 30 days
138
18% of all-time downloads
All-time downloads
770
Public
Repo size
297 MB
Likes
1
Public
Click a slice to open those files.
.gguf297 MB · 100%
From the Hugging Face model README
GGUF conversion of the surya-ocr-2 text detector for use with CrispEmbed.
EfficientViT-Large segformer (38M params):
| File | Type | Size | Notes |
|---|---|---|---|
surya-det-f32.gguf | F32 | 147 MB | Full precision |
surya-det-f16.gguf | F16 | 74 MB | Recommended |
surya-det-q8_0.gguf | Q8_0 | 41 MB | 3.6x compression |
surya-det-q4_k.gguf | Q4_K | 23 MB | 6.5x compression |
All BatchNorm layers are folded into preceding Conv2d weights.
91 languages including English, German (89.7%), Chinese, Arabic, Japanese, Korean. See surya-ocr-2 for the full list.
#include "surya_det.h"
surya_det_context* ctx = surya_det_init("surya-det-f16.gguf", 4);
int hm_h, hm_w;
const float* heatmap = surya_det_detect(ctx, pixels, width, height, 3, &hm_h, &hm_w);
int n_boxes;
const surya_det_bbox* boxes = surya_det_get_boxes(ctx, width, height, 0.6f, 0.35f, &n_boxes);
for (int i = 0; i < n_boxes; i++) {
printf("Text at (%.0f,%.0f)-(%.0f,%.0f) conf=%.2f\n",
boxes[i].x0, boxes[i].y0, boxes[i].x1, boxes[i].y1, boxes[i].confidence);
}
surya_det_free(ctx);
from crispembed import CrispTextDetect
det = CrispTextDetect("surya-det-f16.gguf")
boxes = det.detect("document.png")
for b in boxes:
print(f"({b['x0']:.0f},{b['y0']:.0f})-({b['x1']:.0f},{b['y1']:.0f}) conf={b['confidence']:.3f}")
Verified against Python reference (identical preprocessed input):
OpenRail-M — free for organizations under $5M revenue/funding. See LICENSE.
Converted from datalab-to/surya-ocr-2 (surya.detection.model.encoderdecoder.EfficientViTForSemanticSegmentation).