Loading a DAGNetwork file from the workspace to Simulink

6 ビュー (過去 30 日間)
Hassan Alkomy
Hassan Alkomy 2021 年 7 月 22 日
コメント済み: Hassan Alkomy 2021 年 7 月 27 日
After training YOLO v2, I have a DAGNetwork in the workspace. I want to send this to Simulink. I can't do this at all. All (From Workspace, Frome File, ... etc) options do not work.

回答 (1 件)

Pratyush Roy
Pratyush Roy 2021 年 7 月 27 日
Hi Hassan,
Getting a deep network into Simulink in R2020a requires the use of Legacy Code Tool and S-functions. In order to make sure you have the appropriate support packages, you can install both of these:
Then, you can refer to this workflow:
for an example of how to get the 'detect_lane' function into Simulink. You can replace 'detect_lane' with a function which executes your neural network to import it into Simulink.
If you are interested in trying out the updated workflows in R2020b, you can simply load your deep networks as-normal from inside a MATLAB Function block. For example, to load YOLO inside a function block in R2020b, I would simply execute:
​​​​​​​persistent detectionnet;
if isempty(detectionnet)
detectionnet = coder.loadDeepLearningNetwork('yolo_tsr.mat','Detection');
end
The net is declared as persistent to ensure we do not load the net repeatedly each time the block is executed.
Hope this helps!
  1 件のコメント
Hassan Alkomy
Hassan Alkomy 2021 年 7 月 27 日
Thank you, Pratyush.
Ok, let's say that I want to load the DAGNetwork and have it detect and classify different objects in real-time (Using a video capture block or soemthing similar). Would the S-functions and Legacy Code allow for real-time applications of deep learning or is there a specific code or function that is needed for this implementation?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDeep Learning with Simulink についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by