How to edit the label Definitions of data labelled using lidar labeller app

조회 수: 3 (최근 30일)
gaurav
gaurav 2024년 4월 8일
댓글: Manikanta Aditya 2024년 4월 8일
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
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 CenterFile Exchange에서 Labeling, Segmentation, and Detection에 대해 자세히 알아보기

태그

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by