utils Module

Utilities for models - mostly preprocessing related.

Functions

preprocess_array

Create a tensorflow op that takes an array of image bytes and returns regularized images.

preprocess_array(in_images, order='RGB', scaling_factor=1.0, output_height=224, output_width=224, preserve_aspect_ratio=True)

Parameters

in_images
Required

[?] dim tensor of image bytes. (Typically a placeholder)

order
default value: RGB

order of channels - either 'BGR' or 'RGB'

scaling_factor
default value: 1.0

multiplier for channel values

output_height
default value: 224

output image height

output_width
default value: 224

output image width

preserve_aspect_ratio
default value: True

if True, preserve image aspect ratio while scaling

Returns

[?, output_height, output_width, 3] dim tensor of float32 pixel values of the image.