Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Ggml org Ggml Yolo detect

From Leeroopedia
Revision as of 15:02, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Ggml_org_Ggml_Yolo_detect.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Template:ImplementationCard

Summary

Primary API for YOLO object detection post-processing in the GGML framework. Converts raw neural network outputs into drawn bounding boxes with class labels on the input image.

Primary API

void detect(yolo_image & img, ggml_cgraph * gf, const yolo_model & model, float thresh, const vector<string> & labels, const vector<yolo_image> & alphabet)

Source: examples/yolo/yolov3-tiny.cpp:L455-479

Repository: https://github.com/ggml-org/ggml

Parameters

Parameter Description
img Input image for drawing
gf Computed graph
model YOLO model with anchors
thresh Objectness threshold
labels 80 COCO class names
alphabet Font images for labels

Related Functions

  • apply_yolo at L193-205: applies sigmoid activation, anchor decoding
  • get_yolo_detections at L235-265: extracts detections above threshold
  • do_nms_sort at L299-327: Non-Maximum Suppression
  • draw_detections at L340-386: draws bounding boxes and labels on image
  • save_image at examples/yolo/yolo-image.cpp:L49-64: saves result as JPEG

Outputs

  • JPEG image with drawn bounding boxes and class labels
  • Detection info printed to stdout

Configuration

  • NMS IoU threshold: 0.45
  • Classes: 80 COCO classes
  • Anchors: anchor sizes defined per scale

Dependencies

  • stb_image_write.h (for JPEG output)

Related

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment