Load trained neural network using gui in matlab

3 visualizaciones (últimos 30 días)
Maaz Ahmed
Maaz Ahmed el 14 de Mzo. de 2019
Comentada: Geoff Hayes el 14 de Mzo. de 2019
I am having a trained neural network. I want to load all the variables realed to neural network in the workspace by pressing the pushbutton in gui matlab.
The code is as follows:
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
trained_net_vars = load('netTransfer1');
handles.neural_net = trained_net_vars.net;
The variables are not getting loaded in the workspace. Can anyone help me here !!
  3 comentarios
Maaz Ahmed
Maaz Ahmed el 14 de Mzo. de 2019
I am trying to get the variables in workspace (after loading the neural network) so as to define the variables used in my other push_button.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
url = 'http://192.168.43.1:8080/shot.jpg ' ;
filename = 'shot.jpg ';
a = imread(url) ;
axes(handles.axes1) ;
imshow(a) ;
outfilename = websave(filename, url );
tester = imageDatastore(outfilename);
inputSize = evalin('base', 'inputSize');
netTransfer1 = evalin('base', 'netTransfer1');
%tester = imageDatastore('C:\Users\ahmedmaaz20\Desktop\Imo\IMG_20190226_134111.jpg');
tester1 = augmentedImageDatastore(inputSize(1:2),tester);
[YPred1,scores1] = classify(netTransfer1,tester1);
The variables inputSize and netTransfer1 can only be defined if they are in my workspace. A screenshot of my workspace
Capture.JPG
The above screenshot is the view of my workspace. Here I have already loaded the variables in workspace via command via but instead I want through pushbutton in gui. Hope it helps.
Geoff Hayes
Geoff Hayes el 14 de Mzo. de 2019
Why can't the GUI set the inputSize and the netTransfer1 variables and hold on to those variables (as fields within the handles structure) within the GUI "workspace"?

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by