Views
No views yet
| 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 |
1#include "surya_det.h"
2
3surya_det_context* ctx = surya_det_init("surya-det-f16.gguf", 4);
4int hm_h, hm_w;
5const float* heatmap = surya_det_detect(ctx, pixels, width, height, 3, &hm_h, &hm_w);
6
7int n_boxes;
8const surya_det_bbox* boxes = surya_det_get_boxes(ctx, width, height, 0.6f, 0.35f, &n_boxes);
9for (int i = 0; i < n_boxes; i++) {
10 printf("Text at (%.0f,%.0f)-(%.0f,%.0f) conf=%.2f\n",
11 boxes[i].x0, boxes[i].y0, boxes[i].x1, boxes[i].y1, boxes[i].confidence);
12}
13surya_det_free(ctx);1from crispembed import CrispTextDetect
2
3det = CrispTextDetect("surya-det-f16.gguf")
4boxes = det.detect("document.png")
5for b in boxes:
6 print(f"({b['x0']:.0f},{b['y0']:.0f})-({b['x1']:.0f},{b['y1']:.0f}) conf={b['confidence']:.3f}")