ImageAugmentationConfig Struct Reference
Collaboration diagram for ImageAugmentationConfig:

Public Member Functions

 ImageAugmentationConfig ()
 
void Register (ParseOptions *po)
 
void Check () const
 
FillMode GetFillMode () const
 

Public Attributes

int32 num_channels
 
BaseFloat horizontal_flip_prob
 
BaseFloat horizontal_shift
 
BaseFloat vertical_shift
 
BaseFloat rotation_degree
 
BaseFloat rotation_prob
 
std::string fill_mode_string
 

Detailed Description

Definition at line 33 of file nnet3-egs-augment-image.cc.

Constructor & Destructor Documentation

◆ ImageAugmentationConfig()

Member Function Documentation

◆ Check()

void Check ( ) const
inline

Definition at line 73 of file nnet3-egs-augment-image.cc.

References KALDI_ASSERT.

Referenced by kaldi::nnet3::PerturbImage().

◆ GetFillMode()

FillMode GetFillMode ( ) const
inline

Definition at line 84 of file nnet3-egs-augment-image.cc.

References ImageAugmentationConfig::fill_mode_string, KALDI_ERR, kaldi::nnet3::kNearest, and kaldi::nnet3::kReflect.

Referenced by kaldi::nnet3::PerturbImage().

84  {
85  FillMode fill_mode;
86  if (fill_mode_string == "reflect") {
87  fill_mode = kReflect;
88  } else {
89  if (fill_mode_string != "nearest") {
90  KALDI_ERR << "Choices for --fill-mode are 'nearest' or 'reflect', got: "
92  } else {
93  fill_mode = kNearest;
94  }
95  }
96  return fill_mode;
97  }
#define KALDI_ERR
Definition: kaldi-error.h:147

◆ Register()

void Register ( ParseOptions po)
inline

Definition at line 52 of file nnet3-egs-augment-image.cc.

References ParseOptions::Register().

Referenced by main().

52  {
53  po->Register("num-channels", &num_channels, "Number of colors in the image."
54  "It is important to specify this (helps interpret the image "
55  "correctly.");
56  po->Register("horizontal-flip-prob", &horizontal_flip_prob,
57  "Probability of doing horizontal flip");
58  po->Register("horizontal-shift", &horizontal_shift,
59  "Maximum allowed horizontal shift as proportion of image "
60  "width. Padding is with closest pixel.");
61  po->Register("vertical-shift", &vertical_shift,
62  "Maximum allowed vertical shift as proportion of image "
63  "height. Padding is with closest pixel.");
64  po->Register("rotation-degree", &rotation_degree,
65  "Maximum allowed degree to rotate the image");
66  po->Register("rotation-prob", &rotation_prob,
67  "Probability of doing rotation");
68  po->Register("fill-mode", &fill_mode_string, "Mode for dealing with "
69  "points outside the image boundary when applying transformation. "
70  "Choices = {nearest, reflect}");
71  }
void Register(const std::string &name, bool *ptr, const std::string &doc)

Member Data Documentation

◆ fill_mode_string

std::string fill_mode_string

Definition at line 40 of file nnet3-egs-augment-image.cc.

Referenced by ImageAugmentationConfig::GetFillMode().

◆ horizontal_flip_prob

BaseFloat horizontal_flip_prob

Definition at line 35 of file nnet3-egs-augment-image.cc.

Referenced by kaldi::nnet3::PerturbImage().

◆ horizontal_shift

BaseFloat horizontal_shift

Definition at line 36 of file nnet3-egs-augment-image.cc.

Referenced by kaldi::nnet3::PerturbImage().

◆ num_channels

int32 num_channels

◆ rotation_degree

BaseFloat rotation_degree

Definition at line 38 of file nnet3-egs-augment-image.cc.

Referenced by kaldi::nnet3::PerturbImage().

◆ rotation_prob

BaseFloat rotation_prob

Definition at line 39 of file nnet3-egs-augment-image.cc.

Referenced by kaldi::nnet3::PerturbImage().

◆ vertical_shift

BaseFloat vertical_shift

Definition at line 37 of file nnet3-egs-augment-image.cc.

Referenced by kaldi::nnet3::PerturbImage().


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