- Check the Structure of "detectionResultsTbl": Ensure that "detectionResultsTbl" has the necessary columns, including "Label". The table should typically include columns like "Label", "Score", "BoundingBox", etc.
- Verify the Contents of "detectionResultsTbl": Make sure that the "Label" column in "detectionResultsTbl" is populated with the appropriate data. If the column is missing or empty, the function will not be able to proceed.
- Correct the Data Preparation: If the "Label" column is missing or incorrectly populated, revisit the code where "detectionResultsTbl" is created. Ensure that you are correctly assigning labels to your detection results.
Problems with the evaluateObjectDetection function
2 次查看(过去 30 天)
显示 更早的评论
Hello, everyone,
I would like help with the function in the title line..
thanks.
I reproduce the code and its error below.
CODE:
% Evaluate object detection results
metrics = evaluateObjectDetection(detectionResultsTbl, groundTruthDataTbl);
% Extract precision and recall for a specific class ID (e.g. classID = 1)
classID = 1;
precision = metrics.ClassMetrics.Precision{classID};
recall = metrics.ClassMetrics.Recall{classID};
% Plot the precision-recall curve
figure
plot(recall, precision);
xlabel("Recall");
ylabel("Precision");
grid on;
title(sprintf("Average Precision = %.2f", metrics.ClassMetrics.mAP(classID)));
ERROR:
Error using evaluateObjectDetection>iFindOutputIdxsFromDS
Missing data in detectionResults. Unable to find Label data in detectionResults.
Error in evaluateObjectDetection (line 27)
predOutIdxs = iFindOutputIdxsFromDS(dsResultsCopy, 3, "detectionResults");
Error in untitled2 (line 306)
metrics = evaluateObjectDetection(detectionResultsTbl, groundTruthDataTbl);
In addition, I attach tables detectionResultsTbl and groundTruthDataTbl.
0 个评论
回答(1 个)
Muskan
2024-7-15
Hi, as per my understanding of the issue, it looks like the error message you are encountering is because "detectionResultsTbl" does not contain the required "Label" data. This is essential for the "evaluateObjectDetection" function to work properly.
Here are a few steps you can take to resolve this issue:
You can further refer to the documentation of "evaluateObjectDetection" for its correct usage: https://www.mathworks.com/help/vision/ref/evaluateobjectdetection.html
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!