6

I'm wondering if there's any difference between specifying the data augmentations like this:

data_augmentation_options {
  random_horizontal_flip {
  }
}
data_augmentation_options {
  ssd_random_crop {
  }
}

Or like this:

data_augmentation_options {
  random_horizontal_flip {
  }
  ssd_random_crop {
  }
}

In the object detection pipeline file?

All the samples in the models repo use the first format, but the second format is accepted as well.

jvlier
  • 77
  • 6

1 Answers1

13

The only correct format is the first one.

While the second one will not break the pipeline, it will only take the first specified option. You can verify this yourself by inspecting the created pipeline.config in model_dir. The reason for that is that data_augmentation_options is of type PreprocessingStep which consists of a oneof preprocessing_step. Note the oneof.

On the other hand, data_augmentation_options is repeated, thus you can specify

data_augmentation_options {
  augmentation_option_1 {
  }
}
data_augmentation_options {
  augmentation_option_2 {
  }
}
...

and so on, as many as you like.

netanel-sam
  • 1,862
  • 9
  • 14