这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » 国产MCU » rkmeida中摄像头作为rknn输入NCHW与预处理设置出错如何解决?

共2条 1/1 1 跳转至

rkmeida中摄像头作为rknn输入NCHW与预处理设置出错如何解决?

工程师
2023-06-03 09:26:15     打赏

问题:用rkmedia_vi_rknn_venc_rtsp_test部署自己rknn模型后界面白色部分变成紫色,识别到的框都是错误的。该rknn在电脑测试输出准确。
rknn信息:输入NCHW,方差1均值0。rknn模型无量化。
请问是否以下设置出错?转rknn已经设置预处理,是否需要自己写C++预处理?

设置:
inputs[0].index = 0;
inputs[0].type = RKNN_TENSOR_FLOAT16; //换uint8也不行,设置存疑
inputs[0].size = rga_buffer_model_input_size;
inputs[0].fmt = RKNN_TENSOR_NCHW; //input tensors n_dims=4 dims=[1 3 576 768] 此处设置存疑
inputs[0].buf = rga_buffer_model_input;
inputs[0].pass_through = 0; //从NHWC转换成 NCHW 的过程

outputs[0].want_float = 0; //无量化

输出:
[root@RV1126_RV1109:/]# ./oem/usr/bin/wbc -c /oem/usr/share/rtsp-nn.cfg -l /oem/usr/share/rknn_model/nano_labels_list.txt -p /oem/usr/share/rknn_model/wbc.rknn
media get entity by name: stream_cif_dvp_id0 is null
media get entity by name: stream_cif_dvp_id1 is null
media get entity by name: stream_cif_dvp_id2 is null
media get entity by name: stream_cif_dvp_id3 is null
media get entity by name: rkcif-lvds-subdev is null
media get entity by name: rkcif-lite-lvds-subdev is null
media get entity by name: stream_cif is null
media get entity by name: rkcif-dvp-sof is null
media get entity by name: rkisp-mpfbc-subdev is null
media get entity by name: rkisp_dmapath is null
media get entity by name: rockchip-mipi-dphy-rx is null
media get entity by name: rkcif_dvp is null
media get entity by name: rkcif_dvp is null
media get entity by name: rkcif_lite_mipi_lvds is null
[11:35:29.340137][CAMHW]:XCAM ERROR CamHwIsp20.cpp:1022: No free isp&ispp needed by fake camera!
rcfg path is /oem/usr/share/rtsp-nn.cfg
LABEL_NALE_TXT_PATH is /oem/usr/share/rknn_model/nano_labels_list.txt
MODEL_PATH is /oem/usr/share/rknn_model/wbc.rknn
#CameraIdx: 0

rtsp path = /live/main_stream.
video_type = 5.
width = 768.
height = 576.
video path =rkispp_scale0.
image type = 4.
rtsp path = /live/sub_stream.
video_type = 5.
width = 768.
height = 576.
video path =rkispp_scale1.
image type = 4.
init rtsp
[INFO  rtsp_demo.c:281:rtsp_new_demo] rtsp server demo starting on port 554
init mpi
##RKMEDIA Log level: 2
[RKMEDIA][SYS][Info]:text is all=2
[RKMEDIA][SYS][Info]:module is all, log_level is 2
[DEBUG rtsp_demo.c:481:rtsp_new_session] add session path: /live/main_stream[RKMEDIA][SYS][Info]:RK_MPI_SYS_Bind: Bind Mode[VI]:Chn[1] to Mode[VENC]:Chn[1]...
rtsp video
create rknn_list success
x_rate is 1.000000, y_rate is 1.000000
#Start GetMediaBuffer thread, arg:(nil)
Loading model ...
[RKMEDIA][SYS][Info]:Camera 0 stream 22 is started
mpp[657]: h264e_sps: set level to 3.1
mpp[657]: h264e_sps: set level to 3.1
[DEBUG utils.c:160:rtsp_codec_data_parse_from_user_h264] sps 24
[DEBUG utils.c:168:rtsp_codec_data_parse_from_user_h264] pps 4
[DEBUG utils.c:160:rtsp_codec_data_parse_from_user_h264] sps 24
[DEBUG utils.c:168:rtsp_codec_data_parse_from_user_h264] pps 4

model input num: 1, output num: 1
input tensors:
index=0 name=data_278 n_dims=4 dims=[1 3 576 768] n_elems=1327104 size=2654208 fmt=0 type=1 qnt_type=0 fl=-81 zp=210095 scale=0.000000
output tensors:
index=0 name=Transpose_Transpose_526/out0_0 n_dims=3 dims=[0 1 9180 35] n_elems=321300 size=642600 fmt=0 type=1 qnt_type=0 fl=-81 zp=210095 scale=0.000000
Had init the rga dev ctx = 0x922b8
rga_api version 1.2.6_[0] (RGA is compiling with meson base: $PRODUCT_BASE)




关键词: rkmeida     rknn     NCHW     预处理    

助工
2023-06-03 09:27:11     打赏
2楼

紫色好像亮度过高就会出现,摄像头是400W HDR高动态红外增强广角 OS04A10 MIPI接口24Pin 适配RV1126。rkmedia_vi_rknn_venc_rtsp_test中nv12转rgb24等vi-rstp这一块没有修改。


共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]