8.1.1.7.1.4.2.1. blueoil.networks.segmentation.base

8.1.1.7.1.4.2.1.1. Module Contents

8.1.1.7.1.4.2.1.1.1. Classes

Base

base network for segmentation

SegnetBase

Base network class for LMSegnetV0 and LMSegnetV1.

class blueoil.networks.segmentation.base.Base(*args, label_colors=None, **kwargs)

Bases: blueoil.networks.base.BaseNetwork

base network for segmentation

This base network is for segmentation. Each segmentation network class should extend this class.

placeholders(self)

Placeholders.

Return placeholders.

Returns

Placeholders.

Return type

tf.compat.v1.placeholder

inference(self, images, is_training)

Inference.

Parameters

images – images tensor. shape is (batch_num, height, width, channel)

_color_labels(self, images, name='')
_summary_labels(self, labels)
summary(self, output, labels=None)

Summary.

Parameters
  • output – tensor from inference.

  • labels – labels tensor.

metrics(self, output, labels)

Metrics.

Parameters
  • output – tensor from inference.

  • labels – labels tensor.

class blueoil.networks.segmentation.base.SegnetBase(weight_decay_rate=None, *args, **kwargs)

Bases: blueoil.networks.segmentation.base.Base

Base network class for LMSegnetV0 and LMSegnetV1.

In loss function, multiply the ratio of the class frequency on the batch. The ratio is difference from median frequency balancing described in [SegNet](https://arxiv.org/pdf/1511.00561.pdf).

loss(self, output, labels)

Loss

Parameters
  • output – Tensor of network output. shape is (batch_size, output_height, output_width, num_classes).

  • labels – Tensor of grayscale image gt labels. shape is (batch_size, height, width).

_weight_decay_loss(self)

L2 weight decay (regularization) loss.