user2672299
user2672299

Reputation: 423

Visualizing augmented train images [tensorflow object detection api]

It is possible to augment images in tensorflow object detection api config files, e.g.:

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

How can I visualize the training images to inspect the results of the augmentation?

Thank you for your help.

Upvotes: 3

Views: 1675

Answers (2)

user2672299
user2672299

Reputation: 423

Here is the code to achieve what has been asked in the question https://github.com/majrie/visualize_augmentation/blob/master/visualize_augmentation.ipynb .

It is based on the answer of @danyfang.

Upvotes: 5

Danny Fang
Danny Fang

Reputation: 4051

I suggest you look at input_test.py file, specifically the function test_apply_image_and_box_augmentation in class DataAugmentationFnTest. You can add the data_augmentation_options there and pass your image to the tensor_dict. To visualize it, you can call matplotlib function after sess.run() as augmented_tensor_dict_out can be passed as input argument.

Upvotes: 4

Related Questions