datumaro.plugins.tiling#

class datumaro.plugins.tiling.Tile(extractor, grid_size: Tuple[int, int], overlap: Tuple[float, float], threshold_drop_ann: float)[source]#

Bases: Transform, CliPlugin

Apply tile tranformation to items in the dataset. This transformation is useful for detecting small objects [1]. The high-resolution input images are divided into overlapping small tile images so that the relative area of small objects increases with respect to the images. Annotations of the input image (such as bounding boxes) are also repositioned to fit each tile image.

You should set `save_media=True` to save the tiled image also.

Examples

The following example is the CLI command for a 3x2 tiling with a width and height overlap of 10%:

$ datum transform -t tile -- --grid-size 3 2 --overlap 0.1 0.1 --threshold-drop-ann 0.1

--threshold-drop-ann means an area threshold to remove bboxes and polygons when they are in the boundary of the tiled image and cropped by tiling. In this example, annotations remaining their area within 10% after tiling are discarded.

References

classmethod build_cmdline_parser(**kwargs)[source]#
transform_item(item: DatasetItem) List[DatasetItem][source]#

Modules

datumaro.plugins.tiling.merge_tile

datumaro.plugins.tiling.tile

datumaro.plugins.tiling.util