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;
19 OperatorBase::GetSingleArgument<float>(
"score_thresh", 0.05)),
20 nms_thres_(OperatorBase::GetSingleArgument<float>(
"nms", 0.3)),
22 OperatorBase::GetSingleArgument<int>(
"detections_per_im", 100)),
24 OperatorBase::GetSingleArgument<bool>(
"soft_nms_enabled",
false)),
25 soft_nms_method_str_(OperatorBase::GetSingleArgument<std::string>(
29 OperatorBase::GetSingleArgument<float>(
"soft_nms_sigma", 0.5)),
30 soft_nms_min_score_thres_(OperatorBase::GetSingleArgument<float>(
31 "soft_nms_min_score_thres",
34 soft_nms_method_str_ ==
"linear" || soft_nms_method_str_ ==
"gaussian",
35 "Unexpected soft_nms_method");
36 soft_nms_method_ = (soft_nms_method_str_ ==
"linear") ? 1 : 2;
41 bool RunOnDevice()
override;
45 float score_thres_ = 0.05;
47 float nms_thres_ = 0.3;
49 int detections_per_im_ = 100;
51 bool soft_nms_enabled_ =
false;
53 std::string soft_nms_method_str_ =
"linear";
54 unsigned int soft_nms_method_ = 1;
56 float soft_nms_sigma_ = 0.5;
58 float soft_nms_min_score_thres_ = 0.001;
62 #endif // BOX_WITH_NMS_AND_LIMIT_OP_H_
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...