1
votes

Currently, there is no support for Cutout image augmentation during the preprocessing step using the TensorFlow object detection API.

My question is:

1. How can I add a custom augmentation(Cutout in this case) to the TensorFlow object detection preprocessor?

I tried to follow:

https://github.com/tensorflow/models/commit/ec4b78f3e7030184b255099c369c52e9b404d71f

After following that pull request and running protoc object_detection/protos/*.proto --python_out=. in the protoc directory

and attempting to use the cutout augmentation I implemented during the training of an object detector, I get the following error:

google.protobuf.text_format.ParseError: 140:5 : Message type "object_detection.protos.PreprocessingStep" has no field named "CutOut".

Also, for the implementation of Cutout, I'm using https://www.tensorflow.org/addons/api_docs/python/tfa/image/cutout

Any help and guidance are very much appreciated! :-)

1

1 Answers

0
votes

I'm not that experienced in Tensorflow's object detection API, but I think you can add an augmentation called "random_black_patches", that is similar to cutout. You can see it in the proto here.

If you see the arguments, you can see that you control the number, probability and aspect ratio of the patches.

I used it in my pipeline.config as follows:


train_config {
  batch_size: 4
  data_augmentation_options{
    random_black_patches {
    }
  }
}