Implementation:Ggml org Ggml Yolo detect
Appearance
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_yoloatL193-205: applies sigmoid activation, anchor decodingget_yolo_detectionsatL235-265: extracts detections above thresholddo_nms_sortatL299-327: Non-Maximum Suppressiondraw_detectionsatL340-386: draws bounding boxes and labels on imagesave_imageatexamples/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