function identifyButtonPushed(app, event)
d5=load('.\models\dnet_error90.mat');
path1='cache\';
res='';
for i=3:7
img=uint8(imread(strcat(path1,num2str(i),'.jpg')));
se=[1,1,1];
img=imerode(img,se);
img=imerode(img,se);
[~,index]=max(predict(d5,img));
res=strcat(res,num2str(index-1));
end
set(app.result,'Text',res);
end
Matlab中代码如图,这是一个按钮的回调函数代码。在使用时predict函数会报错"no valid system or dataset was specified",经我检查发现这个system、dataset参数对应的是另一个同名predict函数。请问我应该如何指定到deeplearning toolbox工具箱中的predict函数呢?由于我现在找不到这个工具箱在根目录哪里,文件搜索命令也找不到对应的predict.m文件。所以我无法使用addpath来指定路径,同时我不知道为什么命令行窗口能够运行predict(net,img)而app designer中使用predict却会指向另一个predict函数,其他类似的函数如classify同样如此。
我想了解一下正确做法如何在app designer中进行CNN目标检测模型调用的或者对于上述的命令行能用已安装工具箱但是却找不到其根目录的奇怪情况能够跟俺说说是咋回事。
不胜感激!
附:使用64位 Matlab R2021a、Win10操作系统。Deeplearning Toolbox工具箱为matlab官方工具箱,安装时自带的。