金宝app®is a trusted tool for designing complex systems that include decision logic and controllers, sensor fusion, vehicle dynamics, and 3D visualization components.
截至2020年的版本,您可以将深度学习网络合并到Simulink模型中以执行系统级仿真和部署。金宝app
Learn how to run simulations of a lane and vehicle detector using deep learning networks based on YOLO v2 in Simulink on NVIDIA®GPUs. The Simulink model includes preprocessing and postprocessing components that perform operations such as resizing incoming videos, detecting coordinates, and drawing bounding boxes around detected vehicles. With the same Simulink model, you can generate optimized CUDA code using cuDNN or TensorRT to target GPUs such as NVIDIA Tesla®and NVIDIA Jetson®平台。
Simulink is a trusted tool for designing complex systems that include decision logic, and controllers, sensor fusion, vehicle dynamics, and 3D visualization components. As of release 2020b, you can incorporate deep learning networks into your Simulink models to perform system-level simulation and deployment. If we look inside the vehicle and lane detection subsystem, we'll see the use of two deep learning networks at the top and bottom. Our input video will come in, we'll then do some preprocessing to resize the image, which we then feed into our lane detection network.
在这里,您可以看到这是由Matlab目录的数学文件带入的。我们将执行一些后处理以检测左侧右侧车道的坐标,最后我们将执行一些注释以突出车辆和车道。底部深度学习网络正在检测车辆,它基于YOLOV2。又一次,您可以看到在我们的目录上的屏蔽文件中加载此内容。所以回来,我们可以运行模拟。您在左侧看到我们的输入视频,以及我们在右侧的输出视频,我们将突出显示左侧和右侧的绿色标记。然后我们在我们看到的车辆周围驾驶黄色边界盒。所以在这一点上,我们已经准备好继续并生成代码,以便我们可以推出Simulink编码器或嵌入式代码包装。金宝app
让我们先看看代码生成设置。在这里,您将看到我们使用正确的系统目标文件,我们已经检查了此处的复选框以生成CUDA代码。我们也可以看看深度学习图书馆。在这种情况下,我们可以选择Cudnn或Tensorr,所以我们现在将保持CUDNN。而对于Toolchain设置,我们正在使用NVIDIA的CUDA Toolkit。最后,对于非深度学习零件,我们正在使用Cublas,Cusolver和袖口等优化的库。
所以我们都设置了,让我们继续生成代码。这是代码生成报告,您可以看到左侧生成的文件。让我们先寻找阶段功能。在此处,您可以看到Cudamalloc调用,它正在为GPU内存分配变量。在这里,我们有CudamEmcpy的数据,它正在将数据从CPU内存复制到GPU内存并在正确的位置返回。在这里,是一对正在推出的GPU内核,以便在GPU核心上加速。我们也有两个深入学习网络。这是我们的第一个,Lanenet。您可以在此处查看所有公共和私人方法。在这里,我们还有设置,预测,清理,除了几个其他之外。
Here's our second Deep Learning network, that's the vehicle detector using YOLOv2. And again, we have the same set of methods. If we look inside of the setup method, you can see the code which is run once at the beginning of the program to load the deep learning network into memory. So if you look inside of here, we are going through one layer at a time, and we're loading the weights and biases as we go through. So that's a quick look at generating CUDA code from Simulink models that use deep learning networks. For more information, take a look at the links below.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.