记录一次成功把ssd_mobilenet移植英特尔Movidius VPU

(23条消息)Movidius VPU移植ssd_mobilenet问题记录 - 搬砖之路的专栏 - CSDN博客
https://blog.csdn.net/bobpeter84/article/details/82685310

楼上这家好像没有移植成功。主要是命令不对。

我记录下我的方法。

首先在win10下是可以转的。

前提是 用 powellshell ,记得用管理员方式打开。

进入OpenVINO的model_optmizer目录下,同时建立文件夹为ssd,

把ssd_mobilenet_v2.config及ssd_mobilenet_v2.pb复制到ssd文件夹下,在model_optmizer目录下执行一下命令:

python mo_tf.py --input_model ssd/ssd_mobilenet_v2.pb --output=detection_boxes,detection_scores,num_detections --tensorflow_use_custom_operations_config extensions/front/tf/ssd_v2_support.json --tensorflow_object_detection_api_pipeline_config ssd/ssd_mobilenet_v2.config

不要用 我曾经一次在 英特尔 他们的 技术交流会给的 错误指南,如下

最后输出结果如下:

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
对于RK3399的VPU硬件解码器,可以使用Rockchip提供的硬件解码器库(Rockchip Hardware Decoder)来实现。以下是一个使用该库进行视频解码的示例代码: ```c++ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <sys/ioctl.h> #include <linux/videodev2.h> #include <rockchip/rk_vpu.h> #define INPUT_FILE "input.h264" #define OUTPUT_FILE "output.yuv" int main(int argc, char **argv) { FILE *fp_in, *fp_out; int fd_vpu, ret; struct v4l2_format fmt; struct vpu_dec_in dec_in; struct vpu_dec_out dec_out; // 打开输入文件 fp_in = fopen(INPUT_FILE, "rb"); if (!fp_in) { printf("Failed to open input file: %s\n", INPUT_FILE); return -1; } // 打开输出文件 fp_out = fopen(OUTPUT_FILE, "wb"); if (!fp_out) { printf("Failed to open output file: %s\n", OUTPUT_FILE); return -1; } // 打开VPU设备 fd_vpu = open("/dev/rk_vpu", O_RDWR); if (fd_vpu < 0) { printf("Failed to open /dev/rk_vpu\n"); return -1; } // 配置VPU解码器 memset(&fmt, 0, sizeof(struct v4l2_format)); fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT; fmt.fmt.pix.width = 1920; fmt.fmt.pix.height = 1080; fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_H264; ret = ioctl(fd_vpu, VIDIOC_S_FMT, &fmt); if (ret < 0) { printf("Failed to set VPU format\n"); return -1; } // 初始化VPU解码器 memset(&dec_in, 0, sizeof(struct vpu_dec_in)); dec_in.src_buf = (char *)malloc(1024 * 1024); dec_in.src_length = fread(dec_in.src_buf, 1, 1024 * 1024, fp_in); dec_in.dst_buf = (char *)malloc(fmt.fmt.pix.width * fmt.fmt.pix.height * 3 / 2); dec_in.dst_length = fmt.fmt.pix.width * fmt.fmt.pix.height * 3 / 2; dec_in.keyframe = 1; memset(&dec_out, 0, sizeof(struct vpu_dec_out)); dec_out.dst_buf_size = fmt.fmt.pix.width * fmt.fmt.pix.height * 3 / 2; dec_out.dst_frames = 1; dec_out.disp_flag = 0; // 开始解码 ret = ioctl(fd_vpu, VPU_IOC_DEC_START, &dec_in); if (ret < 0) { printf("Failed to start decode\n"); return -1; } // 获取解码结果 ret = ioctl(fd_vpu, VPU_IOC_DEC_GET_RESULT, &dec_out); if (ret < 0) { printf("Failed to get decode result\n"); return -1; } // 保存解码后的图像 fwrite(dec_out.dst_buf, 1, dec_out.dst_buf_size, fp_out); // 关闭文件和VPU设备 fclose(fp_in); fclose(fp_out); close(fd_vpu); return 0; } ``` 在上述代码中,我们首先打开输入文件和输出文件,然后打开RK3399的VPU设备,使用 `ioctl()` 函数配置VPU解码器的输入和输出格式,并初始化解码器的输入和输出缓冲区。接着,我们使用 `ioctl()` 函数启动VPU解码器进行解码,并获取解码结果。最后,我们将解码后的图像保存到输出文件中,并关闭文件和VPU设备。需要注意的是,上述代码仅作为示例,实际应用中需要根据实际情况进行修改和优化。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

往事如yan

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值