0

I want to use coco datasets for training ssd(single shot multibox detector) network in tensorflow 2.1

The paper said that they use image cropping for robustness so, I tried to use tf.image.sample_distorted_bounding_box()

However, I realized that this function only resizes bounding boxes, not preserving the corresponding labels.

How can I crop images with appropriate bboxes and labels preserved? Appropriate means that bbox coordinates are refined as the image changes and the bbox out of the cropped image to be removed.

Simas Joneliunas
  • 2,890
  • 20
  • 28
  • 35
이재엽
  • 11
  • 2

1 Answers1

0

I have worked on creating a Data Generator for the COCO dataset with PyCOCO for Image Segmentation and I think my experience can help you out. My post on medium documents the entire process from start to finish, including adding augmentations with Tensorflow Keras to the images with the corresponding changes in the masks to ensure labels are preserved (you can find this in Part 2).

As explained in the ADD AUGMENTATIONS section of my post, to ensure that the image and mask remain in sync even after the random augmentations (crop, rotate, brightness, etc), the 'seed' should remain the same for both.

However, point to note, I was working with Semantic Segmentation Masks and not Object detection (bounding boxes). But I am sure you can take back something useful from my code that might help you figure out the solution to your issue.

Viraf
  • 121
  • 3