Please enable JavaScript to view this site.

Waijung 2 User Guide

Navigation: Zynq-7000 target > Tutorials > Advanced tutorials

Tutorial 1: Simulate Image Classifier block

Scroll Prev Top Next More

Introduction

This tutorial will guide you to create a computer simulation using image classification algorithm. Here, a image with peppers will be used as the input to the image classifier block.

zynq_7000_peppers

 

1.Download the sample image peppers.png and place it in the same folder that you are going to create the Simulink model

2.Open Matlab and make a new Simulink model. Save the Simulink model as tutorial_1.

zynq7000_advanced_tutorial1_1
zynq7000_advanced_tutorial1_2

3.First, add the the Image From File block from Computer Vision toolbox. This block will be used to load an image from the computer

zynq7000_advanced_tutorial1_3
zynq7000_advanced_tutorial1_4

4.Double click on that block mask and browse the peppers.png file in your Matlab current folder. Then click OK to apply the changes.

zynq7000_advanced_tutorial1_5

5.Then add the next bock, Image Classifier block to the Simulink model

zynq7000_advanced_tutorial1_6
zynq7000_advanced_tutorial1_7

6.Double click on the Image Classifier block to open the block mask parameters. Change the following parameters and click OK to apply the changes

a.Network: Network from MATLAB function

b.MATLAB function: mobilenetv2

zynq7000_advanced_tutorial1_8

7.Then, add the display block to show the results

zynq7000_advanced_tutorial1_9
zynq7000_advanced_tutorial1_10

8.Connect all three blocks together as follow and save the Simulink model

zynq7000_advanced_tutorial1_11

9.Run the simulation by going to SIMULATION tab and click on the Run button

zynq7000_advanced_tutorial1_12

10.As the result, the Image Classifier block outputs the predicted class label. In this scenario, it is bellPepper_label

zynq7000_advanced_tutorial1_13

Resources

Simulink model file: tutorial_1.slx

 

Copyright 2024 Aimagin Co.,Ltd. Rev.1680