MATLAB Answers

How to load data from Video Labelled Sessions?

4 views (last 30 days)
Nitin Kumar
Nitin Kumar on 28 Oct 2020
Answered: Rishik Ramena on 3 Nov 2020
I am trying to create yolo_v2 object detection model. For this I have .mp4 video file which is labeled using MATLAB Video Labeller. The labelled data is stored as groundTruth in MATLAB workspace.
The Structure of the ground_truth
TIME PEN BLUE_PEN AC_REMOTE
%labels is the original groundTruth variable
video_bbox = labels.LabelData;
rng(0);
shuffledIndices = randperm(height(video_bbox));
idx = floor(0.8 * length(shuffledIndices) );
trainingIdx = 1:idx;
trainingDataTbl = video_bbox(shuffledIndices(trainingIdx),:);
validationIdx = idx+1 : idx + 1 + floor(0.1 * length(shuffledIndices) );
validationDataTbl = video_bbox(shuffledIndices(validationIdx),:);
imdsTrain = imageDatastore(trainingDataTbl{:,'Time'});
bldsTrain = boxLabelDatastore(trainingDataTbl(:,{'Pen','Blue_Pen','AC_Remote'}));
imdsValidation = imageDatastore(validationDataTbl{:,'Time'});
bldsValidation = boxLabelDatastore(validationDataTbl(:,{'Pen','Blue_Pen','AC_Remote'}));
trainingData = combine(imdsTrain,bldsTrain);
validationData = combine(imdsValidation,bldsValidation);
%error
Error using yolo (line 11)
Unrecognized table variable name 'Time'.

Answers (1)

Rishik Ramena
Rishik Ramena on 3 Nov 2020
LabelData is a timetable which is different than a regular table. If you need to access the time column as well you might want to consider using timetable2table. You can also access the Time column from timetables using a dot notation as mentioned here.
TLDR: convert the timetable to table as shown below and this should work.
video_bbox = timetable2table(labels.LabelData); %convert timetable to table

Community Treasure Hunt

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

Start Hunting!

Translated by