- Read the first image of size m-by-n. (I'm assuming greyscale. Additional work required if RGB.)
- Reshape to mn-by-1 vector.
- Repeat for the other 299 images.
- Organise data into mn-by-300 matrix.
- Pair up with target matrix t-by-300.
Do I have to have a dataset to train a Neural Network or can I just insert the folder location?
1 次查看(过去 30 天)
显示 更早的评论
Below you can find my code and the 5 attemps made at inserting the images.
close all;
clear;
%%GOAL%%
% get 300 images
% x = 640 x 300
% t = 3 x 300
%% attempt 1 %%
% size(x)
% imgFolder = fullfile('D:\train\chair');
% imgSet = imageSet(imgFolder);
%% attempt 2 %%
% [x,t] = image_dataset;
% [ I N ] = size(x) % [ 640 300 ]
% [ O N ] = size(t) % [ 3 300 ]
%% attempt 3 %%
% imds = imageDatastore('D:\test\cup');
% imgRGB = imds.read;
%% attempt 4 %%
% my_dataset = 'D:\train\chair';
% load(my_dataset);
%% attempt 5 %%
% folder = 'D:\train\chair';
% myImgaes =imageSet(folder);
% x = folder;
% t =
net = patternnet(10);
view(net);
[net,tr] = train(net,x,t);
nntraintool;
plotperform(tr)
testX = x(:,tr.testInd);
testT = t(:,tr.testInd);
testY = net(testX);
testIndices = vec2ind(testY);
plotconfusion(testT,testY)
0 个评论
采纳的回答
Eustace Tan
2019-7-25
What should happen is:
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!