ultrayolo.layers package

Submodules

ultrayolo.layers.core module

ultrayolo.layers.core.DarknetBody(name=None)[source]

the body of the darknet model

Keyword Arguments:

name {str} – the name of the model (default: {None})

Returns:

tensorflow.keras.Model – the tensorflow darknet model

ultrayolo.layers.core.DarknetBodyTiny(name=None)[source]

the Tiny version of darknet

Keyword Arguments:

name {str} – a name for the model (default: {None})

Returns:

tensorflow.keras.Model – an instance of the darknet tiny model

ultrayolo.layers.core.DarknetConv(x, filters, kernel, batch_norm, downsample)[source]

the darknet convolution layer

Arguments:

x {tf.tensor} – a valid tensor filters {int} – the number of filters for the convolution kernel {int} – the size of the kernel patch batch_norm {boolean} – to use batch normalization downsample {boolean} – to use o not the downsampling

Returns:

tf.tensor – the output tensor

ultrayolo.layers.core.DarknetResidual(x, filters)[source]

A residual layer

Arguments:

x {tf.tensor} – a valid tensor filters {int} – the number of filters

Returns:

tf.tensor – the output tensor

ultrayolo.layers.core.DenseNetBody(input_shape, version='DenseNet121', num_branches=3)[source]

a Yolo backbone using DenseNet

Arguments:

input_shape {tuple} – a valid image shape tuple (values: {(X,X,3)})

Keyword Arguments:

version {str} – a version of densnet (default: {‘DenseNet121’}, values: [

‘DenseNet121’, ‘DenseNet169’, ‘DenseNet201’

]) num_branches {int} – [description] (default: {3}, values: [3,4])

Raises:

Exception: in case a not valid value is provided

Returns:

tensorflow.keras.Model –

ultrayolo.layers.core.MobileNetBody(input_shape, version='MobileNetV2', num_branches=3)[source]

a yolo mobile net body It suports only shapes as [96, 128, 160, 192, 224]

Arguments:

input_shape {tuple} – [description]

Keyword Arguments:
version {str} – a version of mobilenet (default: {‘MobileNetV2’},

values: [‘MobileNetV2’])

num_branches {int} – [description] (default: {3}, values: [3,4])

Raises:

Exception: in case a not valid value is provided

Returns:

tensorflow.keras.Model –

ultrayolo.layers.core.ResNetBody(input_shape, version='ResNet50V2', num_branches=3)[source]

a Darknet body implemented via a ResNetV2

Arguments:

input_shape {tuple} – a tuple of 3 values (example: {(X,X,3)})

Keyword Arguments:
version {str} – [description] (default: {‘ResNet50V2’}, values: [

‘ResNet50V2’, ‘ResNet101V2’, ‘ResNet152V2’

]) num_branches {int} – [description] (default: {3}, values: [3,4])

Raises:

Exception: in case a not valid value is provided

Returns:

tensorflow.keras.Model –

ultrayolo.layers.core.YoloHead(x_inputs, filters, name=None, is_tiny=False)[source]
ultrayolo.layers.core.YoloOutput(x_in, filters, num_mask, num_classes, num_pooling, name=None)[source]

Module contents