General Object Recognition based on YOLO-V3 Model
Execute the following steps to recognize general objects based on YOLO-V3 Model:
Step:
To run C++ application:
example_dnn_object_detection --config=/usr/share/opencv4/yolo-v3/yolov3-tiny.cfg \ --model=/usr/share/opencv4/yolo-v3/yolov3-tiny.weights \ --classes=/usr/share/opencv4/yolo-v3/classes.txt \ --width=416 --height=416 --scale=0.00392 --rgb --target=1 --device=4
Perform the following step under the user path on VisionFive 2 Debian to run YOLO-V3 general object recognition demo:
Tip: Parameter Information:
- Parameter device is added to the
OpenCV object_detection.cpp application to set the
video device number for capturing a video stream. Normally,
/dev/video1
represents the camera connected to MIPI CSI, and/dev/video4
represents the USB camera. target=1
represents that OpenCL uses GPU to accelerate the recognition, which will greatly increase the speed compared with usingtarget=0
. Strongly recommends that you keep this parameter in the command.- Other parameters can be checked by executing
example_dnn_object_detection --help
.
Result:
- HDMI monitor displays the real-time video stream from a webcam;
- HDMI monitor displays real-time drawings of bounding boxes, labeling the objects recognized by the model, and displaying their names and confidence level;
- The upper left corner displays the inference time per frame, which translates to an approximate inference frame rate of 1 - 1.5 fps;
