フィルターのクリア

How to apply my image preprocessing for AlexNet?

5 ビュー (過去 30 日間)
David Bielenberg
David Bielenberg 2019 年 8 月 8 日
コメント済み: Debanjan Konar 2020 年 5 月 30 日
Good Morning!
Due to a smaller university assignment I am working on a plate recognition programm using AlexNet. I am quite unexperienced with matlab. I have started by creating a quite simple function that crops different images to their license plate and returnes a binary image of the plate on a 277x277 image so it is preprocessed for AlexNet.
I have images stored in 3 folders for the 3 labels that are needed for my task. Right now I am still using generated plates, but the algorithm also works well enough for actual photos of cars
%load a well structured dataset into matlab. It contains folders for each label needed
% 1) Folder containing plates from city A
% 2) Folder containng plates from city B
% 3) Folder containing plates from random Cities
unzip('Generated.zip');
imds = imageDatastore('Generated', ...
'IncludeSubfolders',true, ...
'LabelSource','foldernames');
% apply my own preprocessing function to crop to license plates
% the datastore is transformed like I wanted it to.
% But it give me TransformedDatastore which won't work for the AlexNet
imdsCropped = transform(imds2,@(x) findPlate(x));
My problem is that the following code of AlexNet is not working with my Datastore, which after applying the 'transform' method is of type 'TransformedDatastore'
[imdsTrain,imdsValidation] = splitEachLabel(imdsCropped,0.7,'randomized');
Output: Undefined function 'splitEachLabel' for input arguments of type 'matlab.io.datastore.TransformedDatastore'.
Obviously, I am doing something wrong. Is there a way to cast the TransformedDatastore back to an imageDatastore, or is another function than 'transform' needed to apply the preprocessing of the images. I am also going to attach the full source code, if it helps finding the problem.
This is my first question. Let me know if I did something wrong. Happy about all kinds of help.
Have a nice day
  1 件のコメント
Debanjan Konar
Debanjan Konar 2020 年 5 月 30 日
which version of Mtalb you are using. I think it is lower version than 2018a.

サインインしてコメントする。

回答 (1 件)

karthikeyan chandrasekar
karthikeyan chandrasekar 2019 年 8 月 16 日
I am using alexnet trained model it seems you are doing training in wrong way, while training we should follow some constrains which allows us to train the existing network to our customised network.
Instead of using zip format of your data select the directory which contains this'Generated' folder and do your training (of your own data set).
plaese follow this link for training your network.
  1 件のコメント
David Bielenberg
David Bielenberg 2019 年 8 月 25 日
Hello,
I do not understand. You say I should use a directory instead of a .zip file? How would that help with my problem? Also the link you shared basically shows the process with a zip file used for the imageDataStore.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by