Problems with the evaluateObjectDetection function

3 Ansichten (letzte 30 Tage)
Patrizia
Patrizia am 15 Jul. 2024
Kommentiert: Patrizia am 16 Jul. 2024
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.

Antworten (1)

Muskan
Muskan am 15 Jul. 2024
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:
  1. 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.
  2. 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.
  3. 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.
You can further refer to the documentation of "evaluateObjectDetection" for its correct usage: https://www.mathworks.com/help/vision/ref/evaluateobjectdetection.html
  1 Kommentar
Patrizia
Patrizia am 16 Jul. 2024
As you can see from the attached file, the 'detectionResultTbl' appears to be correctly populated.
Thank you anyway for your reply.
Patrizia

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by