+ All Categories
Home > Documents > CMSC5743 Lab 04 MNN Tutorial Materials

CMSC5743 Lab 04 MNN Tutorial Materials

Date post: 22-Feb-2022
Category:
Upload: others
View: 11 times
Download: 0 times
Share this document with a friend
16
CMSC5743 Lab 04 MNN Tutorial Materials Yang BAI Department of Computer Science & Engineering Chinese University of Hong Kong [email protected] November 19, 2021
Transcript

CMSC5743 Lab 04MNN Tutorial Materials

Yang BAIDepartment of Computer Science & EngineeringChinese University of Hong [email protected]

November 19, 2021

1 MNN Converter

2 MNN Interpreter

3 Homework

Outline

2/16

• Converter

• Interpreter

• C/C++ or Python

MNN Workflow

3/16

Converter

• Frontends

• Graph Optimization

MNN Converter

5/16

• Tensorflow

• Caffe

• ONNX

MNN Converter-Frontends

6/16

• Operator Fusion

• Operator Replace

• Layout Adjustment

MNN Converter-Graph Optimization

7/16

Interpreter

• Engine

• Backends

• Runtime Optimization

MNN Interpreter

9/16

• Graph Schedule

• CV process

MNN Interpreter-Engine

10/16

• CPU Backend

• Metal Backend

• OpenCL Backend

• Vulkan Backend

MNN Interpreter-Backends

11/16

• Winograd Conv

• Strassen

• Low Precision Calculation

• Neon/ASM

• Multi-threads

• Memory Reuse

• Heterogeneous Computing

MNN Interpreter-Optimization

12/16

Homework and Sample Code

• Build the MNN from the source code:

• Go to the ./Lab04-code/MNN/schema• Run sh generate.sh in your terminal• Go to the ./Lab04-code/MNN• Run mkdir build && cd build in your terminal• Run cmake DMNN_BUILD_DEMO=ON MNN_BUILD_CONVERTER=ON ..• Run make -j8

• Run the human pose estimation example:

• Go to the ./Lab04-code/Data/model• Copy modelmobilenet_v1_075.pb, inputPose.jpeg, convertTool.sh, runPose.sh to./Lab04-code/MNN/build

• Go to the ./Lab04-code/MNN/build and run sh runPose.sh to get theresult

• Open the outputPose.png to see the visualization of human pose estimation

14/16

Q1 Convert the model in./Lab04-code/MNN/Data/model/deeplabv3_257_mv_gpu.tfliteusing the MNNConvert tool to MNN model format. TheMNNConvert tool is in the ./Lab04-code/MNN/build named asMNNConvert

Q2 Learn the segment.cpp from the/Lab04-code/MNN/demo/exec/ to get the result of semanticsegmentation

• Copy image from /Lab04-code/Data/inputSeg.jpegto ./Lab04-code/MNN/build

• Use the segment.out in ./Lab04-code/MNN/build and the MNNmodel from textbfQuestion 1

• Get the visualization of semantic segmentation

15/16

THANK YOU!


Recommended