3 #ifndef BBOX_TRANSFORM_OP_H_ 4 #define BBOX_TRANSFORM_OP_H_ 6 #include "caffe2/core/context.h" 7 #include "caffe2/core/logging.h" 8 #include "caffe2/core/operator.h" 9 #include "caffe2/utils/math.h" 11 C10_DECLARE_CAFFE2_OPERATOR(BBoxTransform)
15 template <
typename T,
class Context>
18 template<
class... Args>
21 weights_(this->
template GetRepeatedArgument<T>(
23 vector<T>{1.0f, 1.0f, 1.0f, 1.0f})),
25 this->
template GetSingleArgument<bool>(
"apply_scale",
true)),
26 rotated_(this->
template GetSingleArgument<bool>(
"rotated",
false)),
28 this->
template GetSingleArgument<bool>(
"angle_bound_on",
true)),
30 this->
template GetSingleArgument<int>(
"angle_bound_lo", -90)),
32 this->
template GetSingleArgument<int>(
"angle_bound_hi", 90)),
34 this->
template GetSingleArgument<float>(
"clip_angle_thresh", 1.0)) {
38 "weights size " + c10::to_string(weights_.size()) +
"must be 4.");
40 USE_OPERATOR_CONTEXT_FUNCTIONS;
42 bool RunOnDevice()
override;
51 bool apply_scale_{
true};
57 bool angle_bound_on_{
true};
58 int angle_bound_lo_{-90};
59 int angle_bound_hi_{90};
63 float clip_angle_thresh_{1.0};
68 #endif // BBOX_TRANSFORM_OP_H_ A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...