Error when creating pixelLabelDatastore: The value of 'gTruth' is invalid

9 vues (au cours des 30 derniers jours)
I am trying to create a pixelLabelDatastore to hold some segmented images that I created using Matlab's ImageLabeller.
The line:
labels = pixelLabelDatastore(data.gTruth);
in my code results in the following error:
Error using pixelLabelDatastore>parseGroundTruthInputs (line 225)
The value of 'gTruth' is invalid. Undefined function 'hasTimeStamps' for input
arguments of type 'cell'.
Error in pixelLabelDatastore (line 203)
[gTruth, params] = parseGroundTruthInputs(varargin{:});
Error in segmentation_neural_network (line 22)
labels = pixelLabelDatastore(data.gTruth);
data is a matfile containing the gTruth object generated by ImageLabeller:
data = matfile(strcat(training_datapath,'/pixel_maps/eye_segmentation_labels.mat'));
Below is my full script.
% Set datapath
datapath = '/scratch/qbi/uqhrile1';
training_datapath = strcat(datapath,'/training_dataset');
% Get training dataset
training_dataset = imageDatastore(strcat(training_datapath,'/images_rgb'));
% Get pixel map labels
data = matfile(strcat(training_datapath,'/pixel_maps/eye_segmentation_labels.mat'));
labels = pixelLabelDatastore(data.gTruth);
This script worked fine in the directory where I first created it (on an external harddrive). When I moved it and the dataset onto a supercomputer using an SSH connection the code stopped working.
Update: I just realized that different operating systems may be the cause of the issue. When I run my code on Windows it works fine, but the supercomputer I've moved it to is Linux. Could moving my mat file from Windows to Linux have changed the way its data is recognised? When I run
class(data.gTruth)
on Windows the variable is recognised as a ground truth object, but when I run my code on the supercomputer it seems to be treated as a cell array. I'm just waiting for supercomputer resources to become available and then I'll run the class function on there and update my question with the result.
  2 commentaires
Walter Roberson
Walter Roberson le 16 Sep 2019
When I use imageLabeller(), I do not seem to get any Ground Truth objects generated ?
MATLAB thinks that your data.gTruth is a cell array.
Heather Riley
Heather Riley le 16 Sep 2019
I got the ground truth object by exporting my labels - they were saved to a .mat file. When I looked at the data in the .mat file the only variable was gTruth.

Connectez-vous pour commenter.

Réponse acceptée

Heather Riley
Heather Riley le 16 Sep 2019
Modifié(e) : Heather Riley le 16 Sep 2019
I have found the answer. The ground truth object I'm using contains absolute paths to its data source which are invalid now that I've moved it, so I need to use the changeFilePaths(gTruth,alterPaths) function to fix it.

Plus de réponses (1)

hla hla myint
hla hla myint le 8 Sep 2020
How to create ground turth object in 3 D volumetric with file extension nii. I know 2 D image, ground turth object create labeler app.

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by