Compute Library
 21.02
PriorBoxLayerInfo Class Referencefinal

PriorBox layer info. More...

#include <Types.h>

Public Member Functions

 PriorBoxLayerInfo ()
 Default Constructor. More...
 
 PriorBoxLayerInfo (const std::vector< float > &min_sizes, const std::vector< float > &variances, float offset, bool flip=true, bool clip=false, const std::vector< float > &max_sizes={}, const std::vector< float > &aspect_ratios={}, const Coordinates2D &img_size=Coordinates2D{ 0, 0 }, const std::array< float, 2 > &steps={ { 0.f, 0.f } })
 Constructor. More...
 
std::vector< float > min_sizes () const
 Get min sizes. More...
 
std::vector< float > variances () const
 Get min variances. More...
 
std::array< float, 2 > steps () const
 Get the step coordinates. More...
 
Coordinates2D img_size () const
 Get the image size coordinates. More...
 
float offset () const
 Get the offset. More...
 
bool flip () const
 Get the flip value. More...
 
bool clip () const
 Get the clip value. More...
 
std::vector< float > max_sizes () const
 Get max sizes. More...
 
std::vector< float > aspect_ratios () const
 Get aspect ratios. More...
 

Detailed Description

PriorBox layer info.

Definition at line 839 of file Types.h.

Constructor & Destructor Documentation

◆ PriorBoxLayerInfo() [1/2]

PriorBoxLayerInfo ( )
inline

Default Constructor.

Definition at line 843 of file Types.h.

844  : _min_sizes(),
845  _variances(),
846  _offset(),
847  _flip(true),
848  _clip(false),
849  _max_sizes(),
850  _aspect_ratios(),
851  _img_size(),
852  _steps()
853  {
854  }

◆ PriorBoxLayerInfo() [2/2]

PriorBoxLayerInfo ( const std::vector< float > &  min_sizes,
const std::vector< float > &  variances,
float  offset,
bool  flip = true,
bool  clip = false,
const std::vector< float > &  max_sizes = {},
const std::vector< float > &  aspect_ratios = {},
const Coordinates2D img_size = Coordinates2D{ 0, 0 },
const std::array< float, 2 > &  steps = { { 0.f, 0.f } } 
)
inline

Constructor.

Parameters
[in]min_sizesMin sizes vector.
[in]variancesVariances vector.
[in]offsetOffset value.
[in]flip(Optional) Flip the aspect ratios.
[in]clip(Optional) Clip coordinates so that they're within [0,1].
[in]max_sizes(Optional) Max sizes vector.
[in]aspect_ratios(Optional) Aspect ratios of the boxes.
[in]img_size(Optional) Image size.
[in]steps(Optional) Step values.

Definition at line 867 of file Types.h.

868  {}, const std::vector<float> &aspect_ratios = {},
869  const Coordinates2D &img_size = Coordinates2D{ 0, 0 }, const std::array<float, 2> &steps = { { 0.f, 0.f } })
870  : _min_sizes(min_sizes),
871  _variances(variances),
872  _offset(offset),
873  _flip(flip),
874  _clip(clip),
875  _max_sizes(max_sizes),
876  _aspect_ratios(),
877  _img_size(img_size),
878  _steps(steps)
879  {
880  _aspect_ratios.push_back(1.);
881  for(unsigned int i = 0; i < aspect_ratios.size(); ++i)
882  {
883  float ar = aspect_ratios[i];
884  bool already_exist = false;
885  for(auto ar_new : _aspect_ratios)
886  {
887  if(fabs(ar - ar_new) < 1e-6)
888  {
889  already_exist = true;
890  break;
891  }
892  }
893  if(!already_exist)
894  {
895  _aspect_ratios.push_back(ar);
896  if(flip)
897  {
898  _aspect_ratios.push_back(1.f / ar);
899  }
900  }
901  }
902  }
2D Coordinates structure
Definition: types.h:28
std::vector< float > aspect_ratios() const
Get aspect ratios.
Definition: Types.h:944
std::array< float, 2 > steps() const
Get the step coordinates.
Definition: Types.h:914
float offset() const
Get the offset.
Definition: Types.h:924
std::vector< float > max_sizes() const
Get max sizes.
Definition: Types.h:939
bool flip() const
Get the flip value.
Definition: Types.h:929
std::vector< float > variances() const
Get min variances.
Definition: Types.h:909
bool clip() const
Get the clip value.
Definition: Types.h:934
std::vector< float > min_sizes() const
Get min sizes.
Definition: Types.h:904

Member Function Documentation

◆ aspect_ratios()

◆ clip()

bool clip ( ) const
inline

Get the clip value.

Definition at line 934 of file Types.h.

Referenced by CLPriorBoxLayerKernel::configure(), arm_compute::operator<<(), arm_compute::test::validation::reference::prior_box_layer(), and arm_compute::to_string().

935  {
936  return _clip;
937  }

◆ flip()

bool flip ( ) const
inline

Get the flip value.

Definition at line 929 of file Types.h.

Referenced by arm_compute::operator<<(), and arm_compute::to_string().

930  {
931  return _flip;
932  }

◆ img_size()

Coordinates2D img_size ( ) const
inline

Get the image size coordinates.

Definition at line 919 of file Types.h.

Referenced by CLPriorBoxLayerKernel::configure(), arm_compute::operator<<(), arm_compute::test::validation::reference::prior_box_layer(), and arm_compute::to_string().

920  {
921  return _img_size;
922  }

◆ max_sizes()

◆ min_sizes()

◆ offset()

float offset ( ) const
inline

Get the offset.

Definition at line 924 of file Types.h.

Referenced by CLPriorBoxLayerKernel::configure(), arm_compute::operator<<(), arm_compute::test::validation::reference::prior_box_layer(), and arm_compute::to_string().

925  {
926  return _offset;
927  }

◆ steps()

std::array<float, 2> steps ( ) const
inline

Get the step coordinates.

Definition at line 914 of file Types.h.

Referenced by CLPriorBoxLayerKernel::configure(), arm_compute::operator<<(), arm_compute::test::validation::reference::prior_box_layer(), and arm_compute::to_string().

915  {
916  return _steps;
917  }

◆ variances()

std::vector<float> variances ( ) const
inline

Get min variances.

Definition at line 909 of file Types.h.

Referenced by CLPriorBoxLayerKernel::configure(), arm_compute::operator<<(), arm_compute::test::validation::reference::prior_box_layer(), and arm_compute::to_string().

910  {
911  return _variances;
912  }

The documentation for this class was generated from the following file: