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!