How to add more than a file gTruth using [imds,blds] = objectDetectorTrainingData(gTruth)
2 ビュー (過去 30 日間)
古いコメントを表示
I did a dataset labeling two quirurgical tools on a few videos to a dataset to dentify this labels on the rest of them. I want to use more than a gTruth file fo train the net but didn't know how to add another gTruth file to train data. Some ideas about how to do that?
0 件のコメント
回答 (1 件)
Kartik
2023 年 5 月 18 日
Hi,
To use multiple gTruth files to train your object detection network in MATLAB, you can create an array of the groundTruth objects using the "load" function in combination with a for loop.
Here's an example code snippet that shows how to load multiple gTruth files and combine them into a single "groundTruth" array:
% Define a cell array of file names
fileNames = {'gTruth1.mat','gTruth2.mat','gTruth3.mat'};
% Create an empty array of groundTruth objects
groundTruthArray = [];
% Loop over the file names and load each gTruth file
for i = 1:numel(fileNames)
load(fileNames{i},'gTruth');
groundTruthArray = [groundTruthArray;gTruth];
end
% Use objectDetectorTrainingData to create training data from the groundTruth array
[trainingData, detector] = objectDetectorTrainingData(groundTruthArray);
% Train your object detector using the training data and detector options
detector = trainRCNNObjectDetector(trainingData, detectorOptions);
In this example, we define a cell array of file names containing the names of our gTruth files. We then create an empty array of groundTruth objects and loop over the file names, using the "load" function to load each gTruth file and concatenating the resulting "gTruth" object to our "groundTruthArray".
After we have combined all the groundTruth objects into a single array, we can use the "objectDetectorTrainingData" function to create training data from the groundTruth array, and proceed with training our object detector using the combined training data and detector options.
Refer to the following MathWorks documentation for more information regarding "objectDetectorTrainingData":
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!