Skip to content

waikato-datamining/image-dataset-converter-imgaug

Repository files navigation

image-dataset-converter-imgaug

Image augmentation extension for the image-dataset-converter library.

Installation

Via PyPI:

pip install image_dataset_converter_imgaug

The latest code straight from the repository:

pip install git+https://github.com/waikato-datamining/image-dataset-converter-imgaug.git

Tools

Generate regions

usage: idc-generate-regions [-h] -W WIDTH -H HEIGHT [-r NUM_ROWS]
                            [-c NUM_COLS] [-R ROW_HEIGHT] [-C COL_WIDTH]
                            [--overlap_right OVERLAP_RIGHT]
                            [--overlap_bottom OVERLAP_BOTTOM] [-m MARGIN]
                            [--margin_left MARGIN_LEFT]
                            [--margin_top MARGIN_TOP]
                            [--margin_right MARGIN_RIGHT]
                            [--margin_bottom MARGIN_BOTTOM] [-f] [-p] [-1]
                            [-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}]

Tool turns an image size into regions to be used, e.g., with the 'sub-images'
filter. Either specify the number of rows/cols or the height/width of
rows/cols.

options:
  -h, --help            show this help message and exit
  -W WIDTH, --width WIDTH
                        The width of the image. (default: None)
  -H HEIGHT, --height HEIGHT
                        The height of the image. (default: None)
  -r NUM_ROWS, --num_rows NUM_ROWS
                        The number of rows. (default: None)
  -c NUM_COLS, --num_cols NUM_COLS
                        The number of columns. (default: None)
  -R ROW_HEIGHT, --row_height ROW_HEIGHT
                        The height of rows. (default: None)
  -C COL_WIDTH, --col_width COL_WIDTH
                        The width of columns. (default: None)
  --overlap_right OVERLAP_RIGHT
                        The overlap between two images (on the right of the
                        left-most image). (default: 0)
  --overlap_bottom OVERLAP_BOTTOM
                        The overlap between two images (on the bottom of the
                        top-most image). (default: 0)
  -m MARGIN, --margin MARGIN
                        The margin around the actual section to generate the
                        regions from. (default: 0)
  --margin_left MARGIN_LEFT
                        The left margin for the actual section to generate the
                        regions from. (default: 0)
  --margin_top MARGIN_TOP
                        The top margin for the actual section to generate the
                        regions from. (default: 0)
  --margin_right MARGIN_RIGHT
                        The right margin for the actual section to generate
                        the regions from. (default: 0)
  --margin_bottom MARGIN_BOTTOM
                        The bottom margin for the actual section to generate
                        the regions from. (default: 0)
  -f, --fixed_size      Whether to use fixed row height/col width, omitting
                        any left-over bits at right/bottom, when using
                        num_rows/num_cols (default: False)
  -p, --partial         Whether to output partial regions, the left-over bits
                        at right/bottom, when using row_height/col_width
                        (default: False)
  -1, --one_based       Whether to use 1-based coordinates (default: False)
  -l {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --logging_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        The logging level to use. (default: WARN)

Combine sub-images

usage: idc-combine-sub-images [-h] -i INPUT [INPUT ...] -g REGEXP -x REGEXP -y
                              REGEXP -W WIDTH -H HEIGHT [-1] -r CMDLINE [-m]
                              -w CMDLINE
                              [-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}]

Tool for combining image regions and annotations generated by the 'sub-images'
filter. NB: it does not combine adjacent annotations.

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT [INPUT ...], --input INPUT [INPUT ...]
                        Path to the report file(s) to read; glob syntax is
                        supported (default: None)
  -g REGEXP, --group REGEXP
                        Regular expression for grouping the sub-images into
                        ones that belong to a single image (first group is
                        used a group ID) (default: None)
  -x REGEXP             Regular expression for extracting the x coordinate
                        (first group) (default: None)
  -y REGEXP             Regular expression for extracting the y coordinate
                        (first group) (default: None)
  -W WIDTH, --width WIDTH
                        The width of the image. (default: None)
  -H HEIGHT, --height HEIGHT
                        The height of the image. (default: None)
  -1, --one_based       Whether the coordinates are 1-based (default: False)
  -r CMDLINE, --reader CMDLINE
                        The reader command-line to use for reading the sub-
                        images. (default: None)
  -m, --merge_adjacent_polygons
                        Whether to merge adjacent polygons (object detection
                        only). (default: False)
  -w CMDLINE, --writer CMDLINE
                        The writer command-line to use for writing the
                        combined images, must contain parameters for storing
                        the output. (default: None)
  -l {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --logging_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        The logging level to use. (default: WARN)

Plugins

See here for an overview of all plugins.