Firefly开源社区

打印 上一主题 下一主题

[技术讨论] rkmeida中摄像头作为rknn输入NCHW与预处理设置问题

回帖奖励 1 灯泡 回复本帖可获得 1 灯泡奖励! 每人限 1 次

72

积分

0

威望

0

贡献

技术小白

积分
72

rkmeida中摄像头作为rknn输入NCHW与预处理设置问题

发表于 2022-4-9 13:46:05      浏览:5020 | 回复:1        打印      只看该作者   [复制链接] 楼主
本帖最后由 cxr 于 2022-4-9 13:51 编辑

问题:用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)
开始识别


回复

使用道具 举报

72

积分

0

威望

0

贡献

技术小白

积分
72
发表于 2022-4-9 13:59:26        只看该作者  沙发
本帖最后由 cxr 于 2022-4-9 14:00 编辑

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

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表