How do I configure labeled training data for trainFastRCNNObjectDetector()?
1 次查看(过去 30 天)
显示 更早的评论
I've created a set of labeled images in Matlab's imageLabeler app and exported them to my work space as a table data object.
data = load('buildingLabels.mat');
numClasses = 2;
trainingData = data.buildingLabels;
Here is what the training data looks like:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1539832/image.png)
From here I set up an object detection net using instructions from: trainFastRCNNObjectDetector
When I run the code I get the error:
--> Extracting region proposals from 200 training images...Error using tabular/rowfun>dfltErrHandler
Applying the function '@(varargin)nSanitizeTrainingDataRow(varargin{:})' to the 1st row of A generated the following error:
Index in position 2 exceeds array bounds. Index must not exceed 1.
Since the code for the fastRCNN is basically copied over, I believe the issue is with my trainingData configuration but I'm not sure how to fix it.
0 个评论
回答(1 个)
T.Nikhil kumar
2023-11-21
Hello Raymond,
I understand that you are facing an error while training a ‘fastRCNNObjectDetector’ network based on Resnet-50 on your custom training Data.
The error message essentially suggests that there is an anomaly in the training data as you rightly pointed out.
The training data expected by the network is supposed to contain the bounding boxes as M-by-4 matrices where each row is of the form [x, y, width, height], where [x, y] represent the top-left coordinates of the bounding box and [width, height] represent the width and height of the bounding box. The labels should be a cell-array that contains M-by-1 categorical vectors with class names.
I can see that some of the bounding boxes and labels are empty in the training data. Therefore, I suggest you to either modify those entries or remove them.
Refer to the ‘trainingData’ section in the following documentation to understand more about the required format -
Hope this helps you proceed further!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!