Projects/yolo_example: minimal YOLO detection with Darknet and OpenCV #18
Merged
ClaudeAI
merged 1 commits from feature/yolo-example into master 49 minutes ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'feature/yolo-example'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Summary
Adds
Projects/yolo_example, a small standalone example of YOLO object detection with the Darknet C++ API (hank-ai Darknet/YOLO V3+,darknet.hpp) and OpenCV 4.What it does
Darknet::load_neural_network(cfg, names, weights).set_detection_threshold()(0.25 by default, or the threshold from the command line) andset_non_maximal_suppression_threshold()(0.45).Darknet::predict(net, cv::Mat)on each image or frame, and prints each detection: class name, confidence, and the box in pixels.Darknet::annotate().Darknet::free_neural_network().Input:
<name>_output.jpg.q/Esc quits). Without a display, for example over ssh, the result is written tooutput.avi.Files
yolo_example.cpp: about 170 lines.Makefile:g++ -std=c++17 ... $(pkg-config --cflags --libs opencv4) -ldarknet.README.md: build, model files (e.g. YOLOv4-tiny with COCO), usage, and how it works..gitignore: the binary and the output files.Testing
Darknet is not available in the build container. The example was compiled (
-Wall -Wextra, no warnings) against a stand-indarknet.hppwith the upstream declarations. It was also run with a stand-in network that returns one detection:output.avi;Not yet run with real Darknet and real YOLO weights.
Generated with Claude Code
https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
7aee0c0d70.