yolov8 person-pets detection
This test program will pull camera data, add yolov8 algorithm, and use VLC and other tools to pull the stream in real time to view the effect.
Compile
Pedestrian detection program source code location:
Duo256M and DuoS: sample_vi_od.c
Reference: https://github.com/milkv-duo/duo-tdl-examples/blob/master/README.md method to compile the sample program.
Upload the test program and model files to Duos
- Refer to the method in the Run Duo section to install the system
Download the v2 version of the image: https://github.com/milkv-duo/duo-buildroot-sdk-v2/releases
- Refer to the method in the Camera section to connect the camera and power on
Upload the compiled sample_vi_od
to the Duo development board through the scp
command on the computer:
scp sample_vi_od [email protected]:/root/
Download cvimodel for human and cat and dog detection :
https://github.com/sophgo/tdl_models/blob/main/cv181x/pet_det_640x384.cvimodel
Use scp
to upload cvimodel to the Duo development board.
Run the example
Log in to the Duo terminal via the serial port or ssh.
Add executable permissions to the test program in Duo's terminal
chmod +x sample_vi_od
Execute the test program in Duo's terminal:
Duo256M and DuoS:
./sample_vi_od yolov8-person-pets pet_det_640x384.cvimodel
The Duo terminal will display information similar to the following:
[root@milkv-duo]~# ./sample_vi_od yolov8-person-pets pet_det_640x384.cvimodel
[SAMPLE_COMM_SNS_ParseIni]-1950: Parse /mnt/data/sensor_cfg.ini
[parse_source_devnum]-1605: devNum = 1
[parse_sensor_name]-1686: sensor = GCORE_GC2083_MIPI_2M_30FPS_10BIT
[parse_sensor_busid]-1714: bus_id = 3
...
1 R:1464 B:2327 CT:3937
2 R:1974 B:1613 CT:7225
Golden 1464 1024 2327
wdrLEOnly:1
At this time, point the camera at people, cats, dogs, and the Duo terminal will print the coordinates, classification, and source of the four points detected by the camera in real time:
1120.35 451.70 1917.16 1067.80 2 0.68
1127.75 429.42 1916.98 1068.79 2 0.50
1198.89 319.74 1919.00 1067.76 2 0.68
1163.29 290.17 1917.01 1068.71 2 0.59
911.80 151.14 1919.00 1068.79 2 0.87
Use VLC to pull the stream on the PC to view the effect
Open VLC media player
, click Media
in the upper left corner, select Open Network Stream
, and enter the URL.
If you are using USB Net (USB-NCM), the address is:
rtsp://192.168.42.1/h264
If you are using the network port on the baseboard IO-Board, or the network port integrated on DuoS, the IP address in the URL needs to be replaced with the IP of the network port (you can use the ifconfig
command in the Duo terminal to view it).
Click the Show more options
option in the lower left corner, and you can set the Caching
option to adjust the delay. The default is 1000 milliseconds, which is 1 second. When the network environment is good, such as in a local area network, you can lower it to reduce the delay. It can be set to 100 to 300. If the network environment is poor or the picture is stuck, you can try to increase it.
After configuration, click Play
to view the camera's detection effect.
Effect picture below: