cropImageTrainGenerator {animl}R Documentation

Tensorflow data generator for training that crops images to bounding box.

Description

Creates an image data generator that crops images based on bounding box coordinates and returnes an image/label pair.

Usage

cropImageTrainGenerator(
  files,
  boxes,
  label,
  classes,
  resize_height = 456,
  resize_width = 456,
  standardize = FALSE,
  augmentation_color = FALSE,
  augmentation_geometry = FALSE,
  shuffle = FALSE,
  cache = FALSE,
  cache_dir = NULL,
  return_iterator = FALSE,
  batch = 32
)

Arguments

files

a vector of file names

boxes

a data frame or matrix of bounding box coordinates in the format left, top, width, height.

label

a vector of labels

classes

a vector of all classes for the active model

resize_height

the height the cropped image will be resized to.

resize_width

the width the cropped image will be resized to.

standardize

standardize the image to the range 0 to 1, TRUE or FALSE.

augmentation_color

use data augmentation to change the color, TRUE or FALSE.

augmentation_geometry

use data augmentation to change the geometry of the images, TRUE or FALSE.

shuffle

return data pairas in random order, TRUE or FALSE.

cache

use caching to reduce reading from disk, TRUE or FALSE.

cache_dir

directory used for caching, if none provided chaching will be done in memory.

return_iterator

Should an iterator be returned? If RALSE a tfdataset will be returned.

batch

the batch size for the image generator.

Value

A Tensorflow image data generator.

Examples

## Not run: 
dataset <- cropImageTrainGenerator(images, standardize = FALSE, batch = batch)
## End(Not run)

[Package animl version 1.1.0 Index]