YUVMultiNet Real-time YUV multi-task CNN for autonomous driving

论文地址:https://arxiv.org/pdf/1904.05673.pdf

摘要

        在这篇文章中,我们提出了一个多任务卷积神经网络(CNN)框架优化对一个低功率汽车级Soc。我们介绍一个网络基于一个统一框架,其中编码是分享在两个任务检测和分割。这个提出的网络运行达到25帧在1280*1280像素上。我们主要讨论这个方法使用去优化网络框架,例如使用本地YUV图直接地,优化层&特征图以及应用量化。我们也集中在内存带宽在我们设计卷积,数据密集型和大部分SOCs带宽瓶颈。我们认证这个的有效,我们提出的网络对一个专用CNN加速展示这个关键绩效指标(KPI)在检测和分割任务上,从硬件执行和对应运行时间。

                                                    

系统框架

                                                      

YUV4:2:0图像空间

                                                      

V2N9网络模型

                                                                     

结论

      我们能合理地维持,三个主要贡献被展示在这篇文章中:一个数据数据层来专用和优化对YUV4:2:0图像空间,一个网络面向CNN核的低功率SoC和一个网络较高地减少框架靠近原始的多网络精度但速度比较快

了解更多关于《计算机视觉与图形学》相关知识,请关注公众号:

下载我们视频中代码和相关讲义,请在公众号回复:计算机视觉课程资料

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1. 首先安装libjpeg-turbo库,可以通过以下命令进行安装: ``` sudo apt-get install libjpeg-turbo8-dev ``` 2. 在程序中添加以下头文件: ``` #include <jpeglib.h> ``` 3. 定义一个结构体变量来存储压缩后的JPEG数据: ``` struct jpeg_compress_struct cinfo; struct jpeg_error_mgr jerr; ``` 4. 初始化JPEG压缩对象: ``` cinfo.err = jpeg_std_error(&jerr); jpeg_create_compress(&cinfo); ``` 5. 设置JPEG压缩参数: ``` cinfo.image_width = width; cinfo.image_height = height; cinfo.input_components = 3; cinfo.in_color_space = JCS_YCbCr; jpeg_set_defaults(&cinfo); jpeg_set_quality(&cinfo, quality, TRUE); ``` 其中,width和height分别为图像的宽度和高度,quality为压缩质量,取值范围为0-100,0为最差质量,100为最好质量。 6. 设置输出文件: ``` FILE *outfile = fopen(output_file, "wb"); jpeg_stdio_dest(&cinfo, outfile); ``` 7. 开始压缩: ``` jpeg_start_compress(&cinfo, TRUE); JSAMPROW row_pointer[1]; int row_stride; row_stride = width * 3; unsigned char *yuv_data = (unsigned char *)malloc(width * height * 3); // 将YUV数据转换成JPEG数据 for (int i = 0; i < height; i++) { row_pointer[0] = &yuv_data[i * width * 3]; jpeg_write_scanlines(&cinfo, row_pointer, 1); } ``` 其中,row_stride为每行数据的字节数,yuv_data为存储YUV数据的数组。 8. 压缩结束,释放内存: ``` jpeg_finish_compress(&cinfo); fclose(outfile); jpeg_destroy_compress(&cinfo); free(yuv_data); ``` 完整代码示例: ``` #include <stdio.h> #include <stdlib.h> #include <jpeglib.h> void yuv_to_jpeg(unsigned char *yuv_data, int width, int height, int quality, const char *output_file) { struct jpeg_compress_struct cinfo; struct jpeg_error_mgr jerr; cinfo.err = jpeg_std_error(&jerr); jpeg_create_compress(&cinfo); FILE *outfile = fopen(output_file, "wb"); jpeg_stdio_dest(&cinfo, outfile); cinfo.image_width = width; cinfo.image_height = height; cinfo.input_components = 3; cinfo.in_color_space = JCS_YCbCr; jpeg_set_defaults(&cinfo); jpeg_set_quality(&cinfo, quality, TRUE); jpeg_start_compress(&cinfo, TRUE); JSAMPROW row_pointer[1]; int row_stride; row_stride = width * 3; for (int i = 0; i < height; i++) { row_pointer[0] = &yuv_data[i * width * 3]; jpeg_write_scanlines(&cinfo, row_pointer, 1); } jpeg_finish_compress(&cinfo); fclose(outfile); jpeg_destroy_compress(&cinfo); free(yuv_data); } int main() { // 读取YUV数据 int width = 1920; int height = 1080; unsigned char *yuv_data = (unsigned char *)malloc(width * height * 3); FILE *fp = fopen("input.yuv", "rb"); fread(yuv_data, 1, width * height * 3, fp); fclose(fp); // 转换成JPEG yuv_to_jpeg(yuv_data, width, height, 80, "output.jpg"); return 0; } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值