Class PriorBox

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.

参数
  • 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.

参数

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.

参数

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.

参数

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.

参数

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.

参数

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.

参数

image_size_h[in] Define the height of the image.

void set_step_w(const float step_w)

Method to set step_w attribute.

参数

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.

参数

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.

参数

clip[in] Define whether clip the prior boxes to [0.0, 1.0].

void set_flip(const bool flip)

Method to set flip attribute.

参数

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.

参数

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.

返回

min_sizes attribute.

std::vector<int64_t> get_max_sizes() const

Method to get max_sizes attribute.

返回

max_sizes attribute.

std::vector<float> get_aspect_ratios() const

Method to get aspect_ratios attribute.

返回

aspect_ratios attribute.

std::vector<float> get_variances() const

Method to get variances attribute.

返回

variances attribute.

int64_t get_image_size_w() const

Method to get image_size_w attribute.

返回

image_size_w attribute.

int64_t get_image_size_h() const

Method to get image_size_h attribute.

返回

image_size_h attribute.

float get_step_w() const

Method to get step_w attribute.

返回

step_w attribute.

float get_step_h() const

Method to get step_h attribute.

返回

step_h attribute.

bool get_flip() const

Method to get flip attribute.

返回

flip attribute.

bool get_clip() const

Method to get clip attribute.

返回

clip attribute.

float get_offset() const

Method to get offset attribute.

返回

offset attribute.