dlpy.layers.Detection

class dlpy.layers.Detection(name=None, act='AUTO', detection_model_type=None, anchors=None, softmax_for_class_prob=None, coord_type=None, class_number=None, grid_number=None, predictions_per_grid=None, do_sqrt=None, coord_scale=None, object_scale=None, prediction_not_a_object_scale=None, class_scale=None, detection_threshold=None, iou_threshold=None, random_boxes=None, src_layers=None, max_boxes=None, max_label_per_image=None, match_anchor_size=None, num_to_force_coord=None, force_coord_scale=None, **kwargs)

Detection layer

Parameters
namestring, optional

Specifies the name of the layer.

actstring, optional

Specifies the activation function. Valid Values: AUTO, IDENTITY, LOGISTIC, SIGMOID, TANH, RECTIFIER, RELU, SOFPLUS, ELU, LEAKY, FCMP Default: AUTO

detection_model_typeint, optional

Specifies the type of the object detection model. Valid Values: YOLOV1, YOLOV2 Default: YOLOV2

anchorsiter-of-floats, optional

Specifies the anchor box values. Anchor box values are a list of scalar value pairs that represent the normalized box sizes in X and Y direction for objects to be detected. The normalized box sizes are calculated by dividing the box size in pixels by the grid size.

softmax_for_class_probbool, optional

Specifies whether to perform Softmax on class probability per predicted object. Default: True

coord_typeint, optional

Specifies the coordinates format type in the input label and detection result. Valid Values: RECT, COCO, YOLO Default: RECT

class_numberint

Specifies the number of classes to detection in the detection layer.

grid_numberint

Specifies the number of grids per side in the detection layer.

predictions_per_gridint

Specifies the number of predictions to generate in the detection layer.

do_sqrtbool, optional

Specifies whether to apply the SQRT function to width and height of the object for the cost function. Default: True

coord_scalefloat, optional

Specifies the weight for the cost function in the detection layer, when objects exist in the grid.

object_scalefloat, optional

Specifies the weight for object detected for the cost function in the detection layer.

prediction_not_a_object_scalefloat, optional

Specifies the weight for the cost function in the detection layer, when objects do not exist in the grid.

class_scalefloat, optional

Specifies the weight for the class of object detected for the cost function in the detection layer.

detection_thresholdfloat, optional

Specifies the threshold for object detection.

iou_thresholdfloat, optional

Specifies the IOU Threshold of maximum suppression in object detection.

random_boxesbool, optional

Randomizing boxes when loading the bounding box information. Default: False

src_layersiter-of-Layers, optional

Specifies the layers directed to this layer.

max_boxesint, optional

Specifies the maximum number of overall predictions allowed in the detection layer.

max_label_per_imageint, optional

The maximum number of labels per image

match_anchor_sizebool, optional

Whether to force the predicted box match the anchor boxes in sizes for all predictions

num_to_force_coordint, optional

The number of leading chunk of images in training when the algorithm forces predicted objects in each grid to be equal to the anchor box sizes, and located at the grid center

force_coord_scalefloat, optional

The scale for location error during the training period while forcing the predicted boxes to have default sizes/locations

Returns
Detection
__init__(name=None, act='AUTO', detection_model_type=None, anchors=None, softmax_for_class_prob=None, coord_type=None, class_number=None, grid_number=None, predictions_per_grid=None, do_sqrt=None, coord_scale=None, object_scale=None, prediction_not_a_object_scale=None, class_scale=None, detection_threshold=None, iou_threshold=None, random_boxes=None, src_layers=None, max_boxes=None, max_label_per_image=None, match_anchor_size=None, num_to_force_coord=None, force_coord_scale=None, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__([name, act, detection_model_type, …])

Initialize self.

count_instances()

format_name([block_num, local_count])

Format the name of the layer

get_number_of_instances()

to_model_params()

Convert the model configuration to CAS action parameters

Attributes

can_be_last_layer

kernel_size

layer_id

num_bias

num_weights

number_of_instances

output_size

rnn_summary

Return a DataFrame containing the layer information for rnn models

summary

Return a DataFrame containing the layer information

type

type_desc

type_label