-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Evaluation][3D Object] 3D object detection performance evaluation #18
Labels
Comments
AP计算由来
|
AP 计算公式vector<double> getThresholds(vector<double>& v, double n_groundtruth)
{
// holds scores needed to compute N_SAMPLE_PTS recall values
vector<double> t;
// sort scores in descending order
// (highest score is assumed to give best/most confident detections)
sort(v.begin(), v.end(), greater<double>());
// get scores for linearly spaced recall
double current_recall = 0;
for (int32_t i = 0; i < v.size(); i++) {
// check if right-hand-side recall with respect to current recall is close than left-hand-side one
// in this case, skip the current detection score
double l_recall, r_recall, recall;
l_recall = (double) (i + 1) / n_groundtruth;
if (i < (v.size() - 1))
r_recall = (double) (i + 2) / n_groundtruth;
else
r_recall = l_recall;
if ((r_recall - current_recall) < (current_recall - l_recall) && i < (v.size() - 1))
continue;
// left recall is the best approximation, so use this and goto next recall step for approximation
recall = l_recall;
// the next recall step was reached
t.push_back(v[i]);
current_recall += 1.0 / (N_SAMPLE_PTS - 1.0);
}
return t;
}
...
// get scores that must be evaluated for recall discretization
thresholds = getThresholds(v, n_gt);
...
// iterate on every frame of data
for (int32_t i = 0; i < groundtruth.size(); i++) {
// for all scores/recall thresholds do:
for (int32_t t = 0; t < thresholds.size(); t++) {
tPrData tmp = tPrData();
tmp = computeStatistics(current_class, groundtruth[i], detections[i], dontcare[i],
ignored_gt[i], ignored_det[i], true, boxoverlap, metric,
compute_aos, thresholds[t], t == 38);
// add no. of TP, FP, FN, AOS for current frame to total evaluation for current threshold
pr[t].tp += tmp.tp;
pr[t].fp += tmp.fp;
pr[t].fn += tmp.fn;
if (tmp.similarity != -1)
pr[t].similarity += tmp.similarity;
}
}
// compute recall, precision and AOS
vector<double> recall;
precision.assign(N_SAMPLE_PTS, 0);
if (compute_aos)
aos.assign(N_SAMPLE_PTS, 0);
double r = 0;
for (int32_t i = 0; i < thresholds.size(); i++) {
r = pr[i].tp / (double) (pr[i].tp + pr[i].fn);
recall.push_back(r);
precision[i] = pr[i].tp / (double) (pr[i].tp + pr[i].fp);
if (compute_aos)
aos[i] = pr[i].similarity / (double) (pr[i].tp + pr[i].fp);
}
// filter precision and AOS using max_{i..end}(precision)
for (int32_t i = 0; i < thresholds.size(); i++) {
precision[i] = *max_element(precision.begin() + i, precision.end());
if (compute_aos)
aos[i] = *max_element(aos.begin() + i, aos.end());
} |
Durant35
changed the title
3D object detection performance evaluation
[Evaluation][3D Object] 3D object detection performance evaluation
Feb 14, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Refer
The text was updated successfully, but these errors were encountered: