tensortools.generator

RectangleGenerator

RectangleGenerator(self, /, *args, **kwargs)

Generates rectangles.

CircleGenerator

CircleGenerator(self, /, *args, **kwargs)

Generates circles.

TriangleGenerator

TriangleGenerator(self, /, *args, **kwargs)

Generates triangles.

Generator

Generator(self, /, *args, **kwargs)

generate

Generator.generate(self, n_images, height, width, max_shapes, min_shapes=1, min_size=2, max_size=None, shape=None, allow_overlap=False)

Generates a fake object detection dataset of squares, triangles & circles!

Arguments:

  • n_images: The amount images to generate.
  • height: The height of the desired images.
  • width: The width of the desired images.
  • max_shapes: The max amount of shapes per image.
  • min_shapes: The min amount of shapes per image.
  • min_size: The min size of the shapes.
  • max_size: The max size of the shapes.
  • shape: The type of shape. If None, a shape is randomly chosen each time.
  • allow_overlap: Whether or not to allow overlap.

Returns:

images: The generates images, shape [n_images, height, width, 3].