NasNet Mobile是一个预训练模型,已经在ImageNet数据库的一个子集上进行了训练。
NasNet-Mobile is a pretrained model that has been trained on a subset of the ImageNet database.
该模型已经接受了超过一百万张图像的训练,可以将图像分为1000个对象类别(如键盘、鼠标、铅笔和许多种类的动物)。
The model is trained on more than a million images and can classify images into 1000 object categories (e.g. keyboard, mouse, pencil, and many animals).
打开nasnetmobile.mlpkginstall文件,将通过MATLAB进行相应版本的初始化过程。
Opening the nasnetmobile.mlpkginstall file from your operating system or from within MATLAB will initiate the installation process for the release you have.
要求使用R2019a及其以上版本。
This mlpkginstall file is functional for R2019a and beyond.
示例:
Usage Example:
% 访问训练模型
% Access the trained model
net = nasnetmobile();
% 设置网络结构的细节
% See details of the architecture
net.Layers
% 读取待分类的图像
% Read the image to classify
I = imread(‘peppers.png’);
% 调整输入图像的大小
% Adjust size of the image
sz = net.Layers(1).InputSize
I = I(1:sz(1),1:sz(2),1:sz(3));
% 采用nasnetmobile 进行图像分类
% Classify the image using nasnetmobile
label = classify(net, I)
% 显示图像及其分类结果
% Show the image and the classification results
figure
imshow(I)
text(10,20,char(label),‘Color’,‘white’)
完整源码下载地址:
http://page2.dfpan.com/fs/6lc2j2b216296166d21/