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

Name Description
in_images
Required

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

order

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

default value: RGB
scaling_factor

multiplier for channel values

default value: 1.0
output_height

output image height

default value: 224
output_width

output image width

default value: 224
preserve_aspect_ratio

if True, preserve image aspect ratio while scaling

default value: True

Returns

Type Description

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