Image Regression using image datastore
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
In the trainNetwork documentation the only options you have for image regression is either using an image datastore and a target table/array. But what if my target responses are saved in a text file?
The answer to this post suggests using a fileDatastore, but it doesn't seem like the proper way to do it.https://uk.mathworks.com/matlabcentral/answers/459161-image-regression-using-mat-files-and-a-datastore
So how can I do it with an image datastore and maybe a normal datastore?
0 Kommentare
Antworten (1)
Raunak Gupta
am 19 Mär. 2020
Hi,
You can use fileDatastore for reading the text file and converting them into the required array for labels as it’s much easier and provide all the functionality required. You need to define a custom ReadFcn for reading the text files and formatting them carefully to create a vector out of each file. For reading text file you can use readmatrix if the file contains only vector with a specific delimiter otherwise textscan is suggested. I assume that since these are labels, they either be one-hot encoded or have a categorical number rather than a string for each class. If it’s a string class name then the textscan will provide cell array of string which can then be converted to specific class number to be useful for trainNetwork.
Hope it helps!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Large Files and Big Data finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!