@ -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_info ss ' , 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 )
"""
@ -2912,7 +2912,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 . * *
@ -3016,7 +3016,7 @@ def retinanet_detection_output(bboxes,
nms_top_k = 1000 ,
keep_top_k = 100 ,
nms_threshold = 0.45 ,
nms_eta = 1. )
nms_eta = 1. 0 )
"""
check_type ( bboxes , ' bboxes ' , ( list ) , ' retinanet_detection_output ' )