diff --git a/python/paddle/fluid/layers/detection.py b/python/paddle/fluid/layers/detection.py index 7e3f40b22fbe453430b1af2273d8a7d905ef7707..18f057623a393509370dbf3b6501f17735f0adc6 100644 --- a/python/paddle/fluid/layers/detection.py +++ b/python/paddle/fluid/layers/detection.py @@ -233,7 +233,7 @@ def retinanet_target_assign(bbox_pred, dtype='float32') is_crowd = fluid.data(name='is_crowd', shape=[1], dtype='float32') - im_info = fluid.data(name='im_infoss', shape=[1, 3], + im_info = fluid.data(name='im_info', shape=[1, 3], dtype='float32') score_pred, loc_pred, score_target, loc_target, bbox_inside_weight, fg_num = \\ fluid.layers.retinanet_target_assign(bbox_pred, cls_logits, anchor_box, @@ -452,7 +452,7 @@ def rpn_target_assign(bbox_pred, return predicted_cls_logits, predicted_bbox_pred, target_label, target_bbox, bbox_inside_weight -def sigmoid_focal_loss(x, label, fg_num, gamma=2, alpha=0.25): +def sigmoid_focal_loss(x, label, fg_num, gamma=2.0, alpha=0.25): """ **Sigmoid Focal Loss Operator.** @@ -493,9 +493,9 @@ def sigmoid_focal_loss(x, label, fg_num, gamma=2, alpha=0.25): is int32. fg_num(Variable): A 1-D tensor with shape [1] represents the number of positive samples in a mini-batch, which should be obtained before this OP. The data type of :attr:`fg_num` is int32. - gamma(float): Hyper-parameter to balance the easy and hard examples. Default value is + gamma(int|float): Hyper-parameter to balance the easy and hard examples. Default value is set to 2.0. - alpha(float): Hyper-parameter to balance the positive and negative example. Default value + alpha(int|float): Hyper-parameter to balance the positive and negative example. Default value is set to 0.25. Returns: @@ -514,7 +514,7 @@ def sigmoid_focal_loss(x, label, fg_num, gamma=2, alpha=0.25): loss = fluid.layers.sigmoid_focal_loss(x=input, label=label, fg_num=fg_num, - gamma=2., + gamma=2.0, alpha=0.25) """ @@ -2914,7 +2914,7 @@ def retinanet_detection_output(bboxes, nms_top_k=1000, keep_top_k=100, nms_threshold=0.3, - nms_eta=1.): + nms_eta=1.0): """ **Detection Output Layer for the detector RetinaNet.** @@ -3010,15 +3010,15 @@ def retinanet_detection_output(bboxes, im_info = fluid.data( name="im_info", shape=[1, 3], dtype='float32') nmsed_outs = fluid.layers.retinanet_detection_output( - bboxes=[bboxes_low, bboxes_high], - scores=[scores_low, scores_high], - anchors=[anchors_low, anchors_high], - im_info=im_info, - score_threshold=0.05, - nms_top_k=1000, - keep_top_k=100, - nms_threshold=0.45, - nms_eta=1.) + bboxes=[bboxes_low, bboxes_high], + scores=[scores_low, scores_high], + anchors=[anchors_low, anchors_high], + im_info=im_info, + score_threshold=0.05, + nms_top_k=1000, + keep_top_k=100, + nms_threshold=0.45, + nms_eta=1.0) """ check_type(bboxes, 'bboxes', (list), 'retinanet_detection_output')