Face Detection
The test program will pull the camera data, add the face detection algorithm, and use tools such as VLC to pull the stream in real time to view the effect.
Compilation
Face detection program source code location:
-
Duo:sample_vi_fd.c
-
Duo256M and DuoS:sample_vi_fd.c
Refer to the method in the previous chapter Introduction to compile the sample program.
Send test program and model files to Duo
-
Refer to the method in the Boot the Duo chapter to install the system
-
Refer to the method in the Camera chapter to power on the Duo after connecting the camera
Send the compiled sample_vi_fd
to the Duo board through the scp
command on your PC:
scp sample_vi_fd [email protected]:/root/
Also use scp to send the model file used for face detection in the cvimodel
directory to the Duo board:
Duo:
scrfd_480_270_int8.cvimodel
Duo256M and DuoS:
scrfd_768_432_int8_1x.cvimodel
Run the example
Log in to the Duo terminal through the serial port or ssh.
Add executable permissions to the test program in Duo's terminal
chmod +x sample_vi_fd
Execute the test program in Duo's terminal:
Duo:
./sample_vi_fd scrfd_480_270_int8.cvimodel
Duo256M and DuoS:
./sample_vi_fd scrfd_768_432_int8_1x.cvimodel
The following information will be displayed in the Duo terminal:
Initialize RTSP
rtsp://127.0.1.1/h264
prio:0
version: 1.4.0
scrfd768432 Build at 2023-12-25 01:21:44 For platform cv181x
Max SharedMem size:1658880
At this time, point the camera at the face, and the Duo terminal will print the number of faces detected by the camera in real time:
face count: 5
face count: 6
face count: 5
face count: 4
face count: 0
face count: 1
face count: 0