Class PriorBox
Defined in File prior_box.h
Inheritance Relationships
Base Type
public mindspore::ops::BaseOperator
Class Documentation
-
class PriorBox : public mindspore::ops::BaseOperator
PriorBox defined PriorBox operator prototype of lite.
Public Functions
-
inline PriorBox()
Constructor.
-
void Init(const std::vector<int64_t> &min_sizes, const std::vector<int64_t> &max_sizes, const std::vector<float> &aspect_ratios, const std::vector<float> &variances, const int64_t image_size_w, const int64_t image_size_h, const float step_w, const float step_h, const bool clip, const bool flip, const float offset)
Method to init the op’s attributes.
- Parameters
min_sizes – [in] Define the minimum side length of square boxes, can be multiple.
max_sizes – [in] Define the maximum side length of square boxes as sqrt(min_size * max_size), can be multiple.
aspect_ratios – [in] Define the aspect ratios of generated boxes. For each aspect_ratio, the width and height are min_size * sqrt(aspect_ratio) and min_size / sqrt(aspect_ratio) respectively.
variances – [in] Define variances for adjusting the prior boxes.
image_size_w – [in] Define the width of the image.
image_size_h – [in] Define the height of the image.
step_w – [in] Define the ratio of the image width and the feature map width.
step_h – [in] Define the ratio of the image height and the feature map height.
clip – [in] Define whether clip the prior boxes to [0.0, 1.0].
flip – [in] Define whether flip aspect ratios. If true, with an aspect ratio r, ratio 1.0/r will be generated.
offset – [in] Define the offset to the zero points of width and height.
-
void set_min_sizes(const std::vector<int64_t> &min_sizes)
Method to set min_sizes attribute.
- Parameters
min_sizes – [in] Define the minimum side length of square boxes, can be multiple.
-
void set_max_sizes(const std::vector<int64_t> &max_sizes)
Method to set max_sizes attribute.
- Parameters
max_sizes – [in] Define the maximum side length of square boxes as sqrt(min_size * max_size), can be multiple.
-
void set_aspect_ratios(const std::vector<float> &aspect_ratios)
Method to set aspect_ratios attribute.
- Parameters
aspect_ratios – [in] Define the aspect ratios of generated boxes. For each aspect_ratio, the width and height are min_size * sqrt(aspect_ratio) and min_size / sqrt(aspect_ratio) respectively.
-
void set_variances(const std::vector<float> &variances)
Method to set variances attribute.
- Parameters
variances – [in] Define variances for adjusting the prior boxes.
-
void set_image_size_w(const int64_t image_size_w)
Method to set image_size_w attribute.
- Parameters
image_size_w – [in] Define the width of the image.
-
void set_image_size_h(const int64_t image_size_h)
Method to set image_size_h attribute.
- Parameters
image_size_h – [in] Define the height of the image.
-
void set_step_w(const float step_w)
Method to set step_w attribute.
- Parameters
step_w – [in] Define the ratio of the image width and the feature map width.
-
void set_step_h(const float step_h)
Method to set step_h attribute.
- Parameters
step_h – [in] Define the ratio of the image height and the feature map height.
-
void set_clip(const bool clip)
Method to set clip attribute.
- Parameters
clip – [in] Define whether clip the prior boxes to [0.0, 1.0].
-
void set_flip(const bool flip)
Method to set flip attribute.
- Parameters
flip – [in] Define whether flip aspect ratios. If true, with an aspect ratio r, ratio 1.0/r will be generated.
-
void set_offset(const float offset)
Method to set offset attribute.
- Parameters
offset – [in] Define the offset to the zero points of width and height.
-
std::vector<int64_t> get_min_sizes() const
Method to get min_sizes attribute.
- Returns
min_sizes attribute.
-
std::vector<int64_t> get_max_sizes() const
Method to get max_sizes attribute.
- Returns
max_sizes attribute.
-
std::vector<float> get_aspect_ratios() const
Method to get aspect_ratios attribute.
- Returns
aspect_ratios attribute.
-
std::vector<float> get_variances() const
Method to get variances attribute.
- Returns
variances attribute.
-
int64_t get_image_size_w() const
Method to get image_size_w attribute.
- Returns
image_size_w attribute.
-
int64_t get_image_size_h() const
Method to get image_size_h attribute.
- Returns
image_size_h attribute.
-
float get_step_w() const
Method to get step_w attribute.
- Returns
step_w attribute.
-
float get_step_h() const
Method to get step_h attribute.
- Returns
step_h attribute.
-
bool get_flip() const
Method to get flip attribute.
- Returns
flip attribute.
-
bool get_clip() const
Method to get clip attribute.
- Returns
clip attribute.
-
float get_offset() const
Method to get offset attribute.
- Returns
offset attribute.
-
inline PriorBox()