Toybrick

标题: demo 推理耗时长 [打印本页]

作者: 板蓝根    时间: 2020-9-24 10:53
标题: demo 推理耗时长
http://t.rock-chips.com/forum.ph ... &extra=page%3D1

参考上面的 demo 把USB 摄像头改成本地 h264码流。平均每帧耗时70ms 请问这个效率正常吗?

cost_time=3 ms              
rga ok                       
detect_time = 6954ms


detect_time 推理计算的代码 没有改动

        start_time = get_time();
        ret = rknn_api.inference(rgbImg.data,
                                           img_width *
                                           img_height *
                                           img_channels,
                                           out_data->out);
        if (ret < 0) {
                printf("inference fail! ret=%d\n", ret);
                goto Error;
        }

        end_time = get_time();

        detect_count++;
        detect_time += (end_time - start_time);

        if (detect_count > 100) {
                printf("detect_time = %dms\n", detect_time);
                detect_count = 0;
                detect_time = 0;
        }








欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3