blueoil.networks.object_detection.yolo_v2_quantize Module Contents Classes


Quantize YOLOv2 Network.

class blueoil.networks.object_detection.yolo_v2_quantize.YoloV2Quantize(quantize_first_convolution=True, quantize_last_convolution=True, activation_quantizer=None, activation_quantizer_kwargs={}, weight_quantizer=None, weight_quantizer_kwargs={}, *args, **kwargs)

Bases: blueoil.networks.object_detection.yolo_v2.YoloV2

Quantize YOLOv2 Network.

It is based on original YOLO v2.

static _quantized_variable_getter(weight_quantization, quantize_first_convolution, quantize_last_convolution, getter, name, *args, **kwargs)

Get the quantized variables.

Use if to choose or skip the target should be quantized.

  • getter – Default from tensorflow.

  • name – Default from tensorflow.

  • weight_quantization – Callable object which quantize variable.

  • args – Args.

  • kwargs – Kwargs.

base(self, images, is_training)

Base network.

Returns: Output. output shape depends on parameter.

When data_format is NHWC shape is [

batch_size, num_cell[0], num_cell[1], (num_classes + 5(x, y ,w, h, confidence)) * boxes_per_cell(length of anchors),


When data_format is NCHW shape is [

batch_size, (num_classes + 5(x, y ,w, h, confidence)) * boxes_per_cell(length of anchors), num_cell[0], num_cell[1],