models Package

Python representation of models accelerated with the Azure ML Hardware Accelerated Models Service.

Modules

accel_model

Module with abstract base class of HW accelerated models.

doesnotexisterror

Does not exist error.

utils

Utilities for models - mostly preprocessing related.

Classes

Densenet121

Float-32 Version of Densenet.

This model is in RGB format, and has a scaling factor of 0.017

Create a Float-32 version of Densenet. This model is in RGB format.

QuantizedDensenet121

Quantized version of Densenet.

This model is in RGB format.

Create a version of Densenet quantized for the Azure ML Hardware Accelerated Models Service.

This model is in RGB format.

QuantizedResnet152

Quantized version of Renset-152.

Create a version of resnet 50 quantized for the Azure ML Hardware Accelerated Models Service.

QuantizedResnet50

Quantized version of Renset-50.

Create a version of resnet 50 quantized for the Azure ML Hardware Accelerated Models Service.

QuantizedSsdVgg

Quantized version of SSD-VGG.

This model is in RGB format.

Create a version of SSD VGG quantized for the Azure ML Hardware Accelerated Models Service.

This model is in RGB format. :param model_base_path: Path to download the model into. Used as a cache locally. :param is_frozen: Should the weights of the model be frozen when it is imported. Freezing the weights can

lead to faster training time, but may cause your model to perform worse overall. Defaults to false.

QuantizedVgg16

Quantized version of VGG-16.

This model is in RGB format.

Create a version of VGG 16 quantized for the Azure ML Hardware Accelerated Models Service.

This model is in RGB format.

Resnet152

Float-32 Version of Resnet-152.

Create a Float-32 version of resnet 152.

Resnet50

Float-32 Version of Resnet-50.

Create a Float-32 version of resnet 50.

SsdVgg

Float-32 Version of SSD-VGG.

This model is in RGB format.

Create a Float-32 version of SSD-VGG.

Vgg16

Float-32 Version of VGG-16.

This model is in RGB format.

Create a Float-32 version of VGG 16.

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.