-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add DetectionMAPEvaluator #2467
Conversation
map<size_t, vector<NormalizedBBox>> bboxes; | ||
for (int i = labelIndex[n]; i < labelIndex[n + 1]; ++i) { | ||
vector<NormalizedBBox> bbox; | ||
getBBoxFromLabelData(cpuLabel_->getData() + i * 6, 1, bbox); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
和layout相关6,7常量后续的PR需要重新设计,避免固定死,这里标记下
++n; | ||
} | ||
++imgId; | ||
if (imgId > batchSize) break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
什么时候imgId > batchSize?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewrite this part.
|
||
// calcTFPos | ||
calcTFPos( | ||
batchSize, allGTBBoxes, allDetectBBoxes, &allTruePos_, &allFalsePos_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allTruePos_,allFalsePos_都已经是成员变量了,这里也不用当做参数传吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
map<size_t, size_t> numPos_; | ||
map<size_t, vector<pair<real, size_t>>> allTruePos_; | ||
map<size_t, vector<pair<real, size_t>>> allFalsePos_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对变量增加注释~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
std::string getTypeImpl() const { return "detection_map"; } | ||
|
||
real getValueImpl() const { return calcMAP() * 100; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100放到calcMAP()里吧,这样130行也不用乘了~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ap_type="11point", | ||
name=None): | ||
""" | ||
Detection mAP Evaluator. It will print mean Average Precision for detection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mean Average Precision -> mean Average Precision(mAP)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
""" | ||
Detection mAP Evaluator. It will print mean Average Precision for detection. | ||
|
||
The detection mAP Evaluator according to the detection_output's output count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
count-> counts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Detection mAP Evaluator. It will print mean Average Precision for detection. | ||
|
||
The detection mAP Evaluator according to the detection_output's output count | ||
the true positive and the false positive bbox and integral them to get the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
integral -> integrates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是积分哈
""" | ||
Detection mAP Evaluator. It will print mean Average Precision for detection. | ||
|
||
The detection mAP Evaluator according to the detection_output's output count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to the detection_output's output
based on the output detection_output
layer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
:type overlap_threshold: float | ||
:param background_id: The background class index. | ||
:type background_id: int | ||
:param evaluate_difficult: Wether evaluate a difficult ground truth. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wether - Whether
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow comments.
|
||
std::string getTypeImpl() const { return "detection_map"; } | ||
|
||
real getValueImpl() const { return calcMAP() * 100; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
map<size_t, size_t> numPos_; | ||
map<size_t, vector<pair<real, size_t>>> allTruePos_; | ||
map<size_t, vector<pair<real, size_t>>> allFalsePos_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
// calcTFPos | ||
calcTFPos( | ||
batchSize, allGTBBoxes, allDetectBBoxes, &allTruePos_, &allFalsePos_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ap_type="11point", | ||
name=None): | ||
""" | ||
Detection mAP Evaluator. It will print mean Average Precision for detection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
""" | ||
Detection mAP Evaluator. It will print mean Average Precision for detection. | ||
|
||
The detection mAP Evaluator according to the detection_output's output count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
""" | ||
Detection mAP Evaluator. It will print mean Average Precision for detection. | ||
|
||
The detection mAP Evaluator according to the detection_output's output count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Detection mAP Evaluator. It will print mean Average Precision for detection. | ||
|
||
The detection mAP Evaluator according to the detection_output's output count | ||
the true positive and the false positive bbox and integral them to get the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是积分哈
:type overlap_threshold: float | ||
:param background_id: The background class index. | ||
:type background_id: int | ||
:param evaluate_difficult: Wether evaluate a difficult ground truth. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -21,7 +21,8 @@ | |||
"chunk_evaluator", "sum_evaluator", "column_sum_evaluator", | |||
"value_printer_evaluator", "gradient_printer_evaluator", | |||
"maxid_printer_evaluator", "maxframe_printer_evaluator", | |||
"seqtext_printer_evaluator", "classification_error_printer_evaluator" | |||
"seqtext_printer_evaluator", "classification_error_printer_evaluator", | |||
"detection_map_evaluator" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
++n; | ||
} | ||
++imgId; | ||
if (imgId > batchSize) break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewrite this part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
resolves #2466