Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Ggml org Ggml Yolo detect

From Leeroopedia


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