How to edit the label Definitions of data labelled using lidar labeller app
3 次查看(过去 30 天)
显示 更早的评论
while trying to edit the label definition i used this code:
% Extract data from old ground truth.
dataSource = gTruth.DataSource;
labelDefs = gTruth.LabelDefinitions;
labelData = gTruth.LabelData;
% Replace oldName with newName
oldName = 'Pedestrian'; newName = 'Pedestrain';
labelDefs.Name = strrep(labelDefs.Name, oldName, newName);
labelData.Properties.VariableNames = strrep(labelData.Properties.VariableNames, oldName, newName);
% Create new groundTruth object
newGTruth = groundTruth(dataSource, labelDefs, labelData);
But got this error:
Error using groundTruth
Expected input to be one of these types:
groundTruthDataSource
Instead its type was vision.labeler.loading.PointCloudSequenceSource.
validateattributes(dataSource, {'groundTruthDataSource'},...
dataSource = validateDataSource(this, dataSource);
this.DataSource = dataSource;
how to resolve it.
1 个评论
Manikanta Aditya
2024-4-8
The error message indicates that the dataSource you’re trying to use to create a new groundTruth object is of type 'vision.labeler.loading.PointCloudSequenceSource', but it expects a 'groundTruthDataSource'.
The 'groundTruth' function in MATLAB expects the 'dataSource' to be an instance of 'groundTruthDataSource' or a cell array of file names. If your data source is a point cloud sequence, you might need to convert it to a format that groundTruth can accept.
Here’s a general way to create a 'groundTruthDataSource':
% Create a fileDatastore object
fds = fileDatastore(location, 'ReadFcn', @load, 'FileExtensions', '.mat');
% Create a groundTruthDataSource object
gTruthDataSource = groundTruthDataSource(fds);
Replace location with the location of your data files. The @load function is used to read the data files, and .mat is the file extension of the data files.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labeling, Segmentation, and Detection 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!