| ~/work/work/rockchip$ tree -L 1 . ├── luckfox-pico ├── luckfox_pico_rknn_example └── rknn-toolkit2 $ export LUCKFOX_SDK_PATH=/home/minimonk/work/work/rockchip/luckfox-pico $ cd luckfox_pico_rknn_example/ $ ./build.sh 1) uclibc 2) glibc Enter your choice [1-2]: 1 You selected: uclibc 你选择了: uclibc 1) luckfox_pico_retinaface_facenet 3) luckfox_pico_yolov5 2) luckfox_pico_retinaface_facenet_spidev Enter your choice [1-3]: 2 You selected: luckfox_pico_retinaface_facenet_spidev 你选择了: luckfox_pico_retinaface_facenet_spidev 1) LUCKFOX_PICO_PLUS 2) LUCKFOX_PICO_PRO_MAX Enter your choice [1-2]: 1 ~/work/work/rockchip/luckfox_pico_rknn_example$ find ./ -name model ./scripts/luckfox_onnx_to_rknn/model ./example/luckfox_pico_yolov5/model ./example/luckfox_pico_retinaface_facenet_spidev/model ./example/luckfox_pico_retinaface_facenet/model ./install/uclibc/luckfox_pico_retinaface_facenet_demo/model ./install/uclibc/luckfox_pico_retinaface_facenet_spidev_plus_demo/model ./install/uclibc/luckfox_pico_yolov5_demo/model ./install/uclibc/luckfox_pico_retinaface_facenet_spidev_pro_max_demo/model ./install/glibc/luckfox_pico_retinaface_facenet_demo/model ./install/glibc/luckfox_pico_retinaface_facenet_spidev_plus_demo/model ./install/glibc/luckfox_pico_yolov5_demo/model ./install/glibc/luckfox_pico_retinaface_facenet_spidev_pro_max_demo/model ~/work/work/rockchip/luckfox_pico_rknn_example/example/luckfox_pico_retinaface_facenet_spidev/model$ ls -al 합계 4128 drwxrwxr-x 2 minimonk minimonk 4096 4월 27 16:43 . drwxrwxr-x 5 minimonk minimonk 4096 4월 27 16:43 .. -rwxrwxr-x 1 minimonk minimonk 651491 4월 27 16:43 RetinaFace.rknn -rwxrwxr-x 1 minimonk minimonk 3557710 4월 27 16:43 mobilefacenet.rknn -rwxrwxr-x 1 minimonk minimonk 2143 4월 27 16:43 test.jpg |
빌드해서 넣으면 인자로 여러가지 파일들을 넣으라는데, 위의 model 경로에서 복사하면 된다.
| [root@luckfox root]# ./luckfox_pico_retinaface_facenet_spidev opencv-mobile MIPI CSI camera with v4l2 rkaiq opencv-mobile HW JPG encoder with rk mpp ./luckfox_pico_retinaface_facenet_spidev <retinaface model_path> <facenet model_path> <reference pic_path> |
LCD가 없으니 확인을 못하겠다 -_-
| [root@luckfox root]# ./luckfox_pico_retinaface_facenet_spidev RetinaFace.rknn mobilefacenet.rknn test.jpg opencv-mobile MIPI CSI camera with v4l2 rkaiq opencv-mobile HW JPG encoder with rk mpp Stop Application ... killall: rkipc: no process killed rkipc exit ls: /oem/usr/etc/init.d/S??*: No such file or directory Screen OFF! init retinaface init facenet Retinaface Info model input num: 1, output num: 3 input tensors: index=0, name=input.1, n_dims=4, dims=[1, 640, 640, 3], n_elems=1228800, size=1228800, fmt=NHWC, type=INT8,0 [ 285.380267] venc_release 51 output tensors: [ 2605.777774] stream_cif_mipi_id0: s_power 1, entity use_count 1 index=0, name=515, n_dims=3, dims=[1, 16800, 4, 0], n_elems=67200, size=67200, fmt=UNDEFINED, type=INT8, qn1 index=1, name=553, n_dims=3, dims=[1, 16800, 2, 0], n_elems=33600, size=33600, fmt=UNDEFINED, type=INT8, qn6 index=2, name=592, n_dims=3, dims=[1, 16800, 10, 0], n_elems=168000, size=168000, fmt=UNDEFINED, type=INT8,4 input_attrs[0].size_with_stride=1228800 output mem [0] = 67200 output mem [1] = 33600 output mem [2] = 168000 model is NHWC input fmt Facenet Info model input num: 1, output num: 1 input tensors: index=0, name=input.1, n_dims=4, dims=[1, 160, 160, 3], n_elems=76800, size=76800, fmt=NHWC, type=INT8, qnt2 output tensors: index=0, name=313, n_dims=2, dims=[1, 128, 0, 0], n_elems=128, size=128, fmt=UNDEFINED, type=INT8, qnt_type5 input_attrs[0].size_with_stride=76800 output mem [0] = 128 Init success devpath = /dev/video11 driver = rkisp_v7 card = rkisp_mainpath bus_info = platform:rkisp-vir0 version = 20500 capabilities = 84201000 device_caps = 4201000 fmt = UYVY 4:2:2 59565955 fmt = Y/CbCr 4:2:2 3631564e fmt = Y/CrCb 4:2:2 3136564e fmt = Y/CrCb 4:2:0 3132564e size = 32 x 32 ~ 2304 x 1296 (+8 +8) [ 2605.912726] stream_cif_mipi_id0: open video, entity use_countt 2 fmt = Y/CbCr 4:2:0 3231564e [ 2605.912833] stream_cif_mipi_id1: open video, entity use_countt 1 fmt = Y/CrCb 4:2:0 (N-C) 31324d4e [ 2605.919858] rkisp rkisp-vir0: first params buf queue fmt = Y/CbCr 4:2:0 (N-C) 32314d4e [ 2605.922766] rkisp_hw ffa00000.rkisp: set isp clk = 198000000Hz rkaiq log level ff1 [ 2605.924587] rkcif-mipi-lvds: stream[0] start streaming XCORE:K:rk_aiq_init_lib, ISP HW ver: 32 [ 2605.924712] rockchip-mipi-csi2 mipi0-csi2: stream on, src_sd: ec2bbf4f, sd_name:rockchip-csi2-dphy0 XCORE:K: [ 2605.924726] rockchip-mipi-csi2 mipi0-csi2: stream ON ************************** VERSION INFOS ************************** [ 2605.924777] rockchip-csi2-dphy0: dphy0, data_rate_mbps 510 version release date: 2024-2-18 [ 2605.924811] rockchip-csi2-dphy csi2-dphy0: csi2_dphy_s_stream stream on:1, dphy0, ret 0 AIQ: AIQ v5.0x5.0 git logs: 25bd14e RV1106: smart_door: release rga/isp/mpp for V1.3.0 99d080a RV1106/RV1103: Battery/Doorbell: release kmpp/rockit-ko for V1.3.2 6458e2a RV1106/RV1103: Battery/Doorbell: release kmpp/rockit-ko for V1.3.1 e8dab39 RV1106: CVR: release rga/isp/mpp for V1.1.0 a021b32 RV1106/RV1103: Battery/Doorbell: release kmpp/rockit-ko for V1.3.0 ************************ VERSION INFOS END ************************ XCORE:K:rk_aiq_uapi_sysctl_preInit_scene: main_scene: normal, sub_scene: day XCORE:E:invalid main scene len! IPCSERVER:K:cid[0] Process path:/tmp/UNIX.domain0, sockfd:26 XCORE:K:cid[0] rk_aiq_uapi_sysctl_init success. iq:/oem/usr/share/iqfiles/sc3336_CMK-OT2119-PC1_30IRC-F16.json XCORE:K:cid[0] rk_aiq_uapi_sysctl_prepare success. mode:0 /dev/video11 does not support changing fps rga_api version 1.10.1_[0] CAMHW:K:cid[0] start success. isGroup:0, isOnline:1, isMultiIsp:0, init_ens:0x1bfc0ffc4739 XCORE:K:cid[0] rk_aiq_uapi_sysctl_start success. CAMHW:K:camId:0, notify_isp_stream_status on |
[링크 : https://github.com/LuckfoxTECH/luckfox_pico_rknn_example.git]
[링크 : https://wiki.luckfox.com/Luckfox-Pico-Ultra/RKNN]
[링크 : https://github.com/LuckfoxTECH/luckfox-pico]
rtsp로 전송
| ~/work/work/rockchip/luckfox_pico_rkmpi_example$ ./build.sh 1) uclibc 2) glibc Enter your choice [1-2]: 1 You selected: uclibc 你选择了: uclibc 1) luckfox_pico_rtsp_opencv 4) luckfox_pico_rtsp_retinaface_osd 2) luckfox_pico_rtsp_opencv_capture 5) luckfox_pico_rtsp_yolov5 3) luckfox_pico_rtsp_retinaface Enter your choice [1-5]: 3 |
아놔.. 파일명도 달라지고 경로는 고정이고! 너무하네!
| [root@luckfox root]# ./luckfox_pico_rtsp_retinaface Stop Application ... killall: rkipc: no process killed killall: udhcpc: no process killed rkipc exit ls: /oem/usr/etc/init.d/S??*: No such file or directory E RKNN: failed to open model: ./model/retinaface.rknn rknn_init fail! ret=-1 |
아무튼 실행하면 vlc 통해서 300msec 정도 버퍼링은 해주어야 정상적으로 나온다.
100msec 하면 첫 프레임만 뜨고 그 이후로 멈춰버리는 듯.
| [root@luckfox root]# ./luckfox_pico_rtsp_retinaface Stop Application ... killall: rkipc: no process killed killall: udhcpc: no process killed rkipc exit ls: /oem/usr/etc/init.d/S??*: No such file or directory model input num: 1, output num: 3 input tensors: index=0, name=input.1, n_dims=4, dims=[1, 640, 640, 3], n_elems=1228800, size=1228800, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=1.000000 output tensors: index=0, name=515, n_dims=3, dims=[1, 16800, 4, 0], n_elems=67200, size=67200, fmt=UNDEFINED, type=INT8, qnt_type=AFFINE, zp=-125, scale=1.951411 index=1, name=553, n_dims=3, dims=[1, 16800, 2, 0], n_elems=33600, size=33600, fmt=UNDEFINED, type=INT8, qnt_type=AFFINE, zp=-2, scale=0.243586 index=2, name=592, n_dims=3, dims=[1, 16800, 10, 0], n_elems=168000, size=168000, fmt=UNDEFINED, type=INT8, qnt_type=AFFINE, zp=-119, scale=1.485194 input_attrs[0].size_with_stride=1228800 output mem [0] = 67200 output mem [1] = 33600 output mem [2] = 168000 model is NHWC input fmt model input height=640, width=640, channel=3 Create Pool success ! rkaiq log level ff1 XCORE:K:rk_aiq_init_lib, ISP HW ver: 32 XCORE:K: ************************** VERSION INFOS ************************** version release date: 2024-2-18 AIQ: AIQ v5.0x5.0 git logs: 25bd14e RV1106: smart_door: release rga/isp/mpp for V1.3.0 99d080a RV1106/RV1103: Battery/Doorbell: release kmpp/rockit-ko for V1.3.2 6458e2a RV1106/RV1103: Battery/Doorbell: release kmpp/rockit-ko for V1.3.1 e8dab39 RV1106: CVR: release rga/isp/mpp for V1.1.0 a021b32 RV1106/RV1103: Battery/Doorbell: release kmpp/rockit-ko for V1.3.0 ************************ VERSION INFOS END ************************ ID: 0, sensor_name is m00_b_sc3336 4-0030, iqfiles is /etc/iqfiles XCORE:K:rk_aiq_uapi_sysctl_preInit_devBufCnt: dev_ent:rkraw_rx, buf_cnt:2 XCORE:E:invalid main scene len! IPCSERVER:K:cid[0] Process path:/tmp/UNIX.domain0, sockfd:22 XCORE:K:cid[0] rk_aiq_uapi_sysctl_init success. iq:/etc/iqfiles/sc3336_CMK-OT2119-PC1_30IRC-F16.json XCORE:K:cid[0] rk_aiq_uapi_sysctl_prepare success. mode:0 rk_aiq_uapi2_sysctl_init/prepare succeed CAMHW:K:cid[0] start success. isGroup:0, isOnline:1, isMultiIsp:0, init_ens:0x1bfc0ffc4739 XCORE:K:cid[0] rk_aiq_uapi_sysctl_start success. rk_aiq_uapi2_sysctl_start succeed rockit log path (null), log_size = 0, can use export rt_log_path=, export rt_log_size= change log_file = (nil) RTVersion 16:42:27-552 {dump :064} --------------------------------------------------------- RTVersion 16:42:27-553 {dump :065} rockit version: git-4720dc10a Tue Apr 30 15:47:55 2024 +0800 RTVersion 16:42:27-554 {dump :066} rockit building: built- 2024-04-30 15:53:43 RTVersion 16:42:27-555 {dump :067} --------------------------------------------------------- (null) 16:42:27-555 {log_level_init :207} please use echo name=level > /tmp/rt_log_level set log level name: all cmpi mb sys vdec venc rgn vpss vgs tde avs wbc vo vi ai ao aenc adec log_level: 0 1 2 3 4 5 6 rockit default level 4, can use export rt_log_level=x, x=0,1,2,3,4,5,6 change (null) 16:42:27-555 {read_log_level :098} text is all=4 (null) 16:42:27-556 {read_log_level :100} module is all, log_level is 4 [INFO rtsp_demo.c:280:rtsp_new_demo] rtsp server demo starting on port 554 (null) 16:42:27-561 {monitor_log_level :149} #Start monitor_log_level thread, arg:(nil) [DEBUG rtsp_demo.c:480:rtsp_new_session] add session path: /live/0 rtsp streamq_alloc size is 1753484 vi_dev_init RKViDev 16:42:27-563 {vi_set_dev_attr :612} VI_DEV_ATTR_S all parameter reserved RTIsp3x 16:42:27-565 {ispInitDevice :591} sensor name = m00_b_sc3336 4-0030 RTDeviceSensorV4 16:42:27-567 {ispOpenDevice :502} v4l2_open(/dev/video0), handler=55 RTDeviceSensorV4 16:42:27-568 {ispOpenDevice :502} v4l2_open(/dev/v4l-subdev2), handler=57 RTDeviceSensorV4 16:42:27-568 {close :112} do RTDeviceSensorV4L2 close RTDeviceSensorV4 16:42:27-569 {close :112} do RTDeviceSensorV4L2 close RKViChn 16:42:27-570 {prepareRuntime :354} --------------------------------------------------------- RKViChn 16:42:27-570 {prepareRuntime :356} vi version: 1.22, name:vvi RKViChn 16:42:27-572 {prepareRuntime :357} rockit-ko version: vmpi:28ee389dbc33 RKViChn 16:42:27-572 {prepareRuntime :358} rockit-ko building: -2024-05-24-18:15:06 RKViChn 16:42:27-573 {prepareRuntime :359} --------------------------------------------------------- cmpi 16:42:27-573 {prepareRuntime :378} mb pool create success, MBCnt= 2 RTIsp3x 16:42:27-575 {ispInitDevice :591} sensor name = m00_b_sc3336 4-0030 cmpi 16:42:27-576 {createRuntime :634} >>>>>>>>> Sensor link info dump: <<<<<<<<< cmpi 16:42:27-577 {createRuntime :636} vicap media name : /dev/media0 cmpi 16:42:27-577 {createRuntime :637} vicap model name : rkcif-mipi-lvds cmpi 16:42:27-577 {createRuntime :638} camera id : 0 cmpi 16:42:27-578 {createRuntime :639} sensor name : m00_b_sc3336 4-0030 cmpi 16:42:27-578 {createRuntime :641} stream_cif_mipi_id0 video name: /dev/video0 cmpi 16:42:27-578 {createRuntime :642} stream_cif_mipi_id1 video name: /dev/video1 cmpi 16:42:27-578 {createRuntime :643} stream_cif_mipi_id2 video name: /dev/video2 cmpi 16:42:27-579 {createRuntime :644} stream_cif_mipi_id3 video name: /dev/video3 cmpi 16:42:27-580 {createRuntime :646} sensor raw width : 2304 cmpi 16:42:27-580 {createRuntime :647} sensor raw height : 1296 cmpi 16:42:27-580 {createRuntime :648} --------------------------------------------------------- cmpi 16:42:27-580 {createRuntime :654} isp media name : /dev/media1 cmpi 16:42:27-580 {createRuntime :655} isp model name : rkisp0 cmpi 16:42:27-581 {createRuntime :656} isp driver name : rkisp-vir0 cmpi 16:42:27-581 {createRuntime :657} isp dev name : /dev/v4l-subdev3 cmpi 16:42:27-581 {createRuntime :659} isp rawrd0_m_path : /dev/video17 cmpi 16:42:27-581 {createRuntime :660} isp rawrd1_l_path : cmpi 16:42:27-582 {createRuntime :661} isp rawrd2_s_path : /dev/video18 cmpi 16:42:27-582 {createRuntime :664} mainpath video name : /dev/video11 cmpi 16:42:27-582 {createRuntime :665} selfpath video name : /dev/video12 cmpi 16:42:27-582 {createRuntime :666} bypasspath video name : /dev/video13 cmpi 16:42:27-582 {createRuntime :667} sensor link type : 2 cmpi 16:42:27-582 {createRuntime :668} sensor is united : 0 cmpi 16:42:27-583 {createRuntime :672} --------------------------------------------------------- cmpi 16:42:27-583 {createRuntime :711} [non-WRAP MODE]: buff size = 518400 RTIsp3x 16:42:27-586 {ispInitDevice :591} sensor name = m00_b_sc3336 4-0030 RTDeviceV4L2 16:42:27-587 {open :137} cameraIndex:0, entityName:rkisp_mainpath RTDeviceV4L2 16:42:27-588 {open :143} open video name(/dev/video11) RKViChn 16:42:27-589 {setFrameRate :1469} [vi] dev(0) ch(0) illegal param s32SrcFrameRate(0) s32DstFrameRate(0) RTDeviceV4L2 16:42:27-590 {ispCameraInfo :567} current device:/dev/video11 isn't compatible(cap:0x84201000) device,memoryType:4, retry:0 RTDeviceV4L2 16:42:27-590 {ispInitFormat :767} ioctl VIDIOC_S_FMT OK cmpi 16:42:27-590 {start :1093} =========== vi Start startRuntime =========== RTDeviceV4L2 16:42:27-591 {ispStreamOn :458} do ispStreamOn start CAMHW:K:camId:0, notify_isp_stream_status on RTDeviceV4L2 16:42:27-616 {ispStreamOn :511} do ispStreamOn done venc_init MpiAdapterEncode 16:42:27-617 {ma_encode_create :1743} ringbuf buf_size 520192 === 0 === MpiAdapterEncode 16:42:27-621 {ma_encode_create :1782} mem_fd = 61 init success cmpi 16:42:27-652 {mb_get_buffer_by_i:433} allocated buffer(this=0x3cd938, data=(nil), size=0, id=-1) cmpi 16:42:27-653 {getFrameRuntime :1347} -------------------------------vviBuf->buf_size: 520192 === 1 === MpiAdapterEncode 16:42:27-743 {ma_encode_get_pack:2079} map ptr: 0xa44ee000, fd 63 [DEBUG utils.c:134:rtsp_codec_data_parse_from_user_h264] sps 29 [DEBUG utils.c:142:rtsp_codec_data_parse_from_user_h264] pps 4 cmpi 16:42:27-745 {mb_get_buffer_by_i:433} allocated buffer(this=0x4fc440, data=(nil), size=0, id=-1) cmpi 16:42:27-745 {getFrameRuntime :1347} -------------------------------vviBuf->buf_size: 520192 |
facenet만으로 얼굴 영역만 탐지. 1TOPS라 그런가 제법 빠르게 반응하는 느낌

CPU는 대충 65% 정도.. rtsp 부하인가?

'embeded > luckfox' 카테고리의 다른 글
| luckfox 카메라 모션 디텍트 끄기 (0) | 2026.04.27 |
|---|---|
| luckfox rv1106 riscv (0) | 2026.04.24 |
| luckfox rv1106 rockchip RNN (0) | 2026.04.24 |
| luckfox csi 카메라 테스트 (0) | 2026.04.23 |
| luckfox pico ultra W 켜봄 (0) | 2026.04.22 |
