3 #ifndef BOX_WITH_NMS_AND_LIMIT_OP_H_ 4 #define BOX_WITH_NMS_AND_LIMIT_OP_H_ 6 #include "caffe2/core/context.h" 7 #include "caffe2/core/operator.h" 12 template <
class Context>
15 USE_OPERATOR_CONTEXT_FUNCTIONS;
16 template <
class... Args>
20 this->
template GetSingleArgument<float>(
"score_thresh", 0.05)),
21 nms_thres_(this->
template GetSingleArgument<float>(
"nms", 0.3)),
23 this->
template GetSingleArgument<int>(
"detections_per_im", 100)),
25 this->
template GetSingleArgument<bool>(
"soft_nms_enabled",
false)),
26 soft_nms_method_str_(this->
template GetSingleArgument<std::string>(
30 this->
template GetSingleArgument<float>(
"soft_nms_sigma", 0.5)),
31 soft_nms_min_score_thres_(this->
template GetSingleArgument<float>(
32 "soft_nms_min_score_thres",
34 rotated_(this->
template GetSingleArgument<bool>(
"rotated",
false)) {
36 soft_nms_method_str_ ==
"linear" || soft_nms_method_str_ ==
"gaussian",
37 "Unexpected soft_nms_method");
38 soft_nms_method_ = (soft_nms_method_str_ ==
"linear") ? 1 : 2;
41 ~BoxWithNMSLimitOp() {}
43 bool RunOnDevice()
override;
47 float score_thres_ = 0.05;
49 float nms_thres_ = 0.3;
51 int detections_per_im_ = 100;
53 bool soft_nms_enabled_ =
false;
55 std::string soft_nms_method_str_ =
"linear";
56 unsigned int soft_nms_method_ = 1;
58 float soft_nms_sigma_ = 0.5;
60 float soft_nms_min_score_thres_ = 0.001;
67 #endif // BOX_WITH_NMS_AND_LIMIT_OP_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...