Pedestrian detection
This test program will pull camera data, add pedestrian detection 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
Refer to https://github.com/milkv-duo/duo-tdl-examples/blob/master/README-zh.md
to compile the example program.
Upload the test program and model files to Duo
- Refer to the method in the Run Duo section to install the system
To download the v2 version, please visit: https://github.com/milkv-duo/duo-buildroot-sdk-v2/releases/tag/v2.0.0
- 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 pedestrian detection:
https://github.com/sophgo/tdl_models/blob/main/cv181x/mobiledetv2-pedestrian-d0-ls-448.cvimodel
Use scp to upload cvimodel to Duo development board.
Run the example
Log in to Duo's 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 mobiledetv2-pedestrian mobiledetv2-pedestrian-d0-ls-448.cvimodel
The Duo terminal will display information similar to the following:
[root@milkv-duo]~# ./sample_vi_od mobiledetv2-pedestrian mobiledetv2-pedestrian-
d0-ls-448.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 pedestrians, and the Duo terminal will print the number of pedestrians detected by the camera in real time:
obj count: 1, take 17.03,width:1920 ms
obj count: 1, take 17.55,width:1920 ms
obj count: 0, take 17.30,width:1920 ms