Skip to content

Commit b1e7799

Browse files
committed
fix yolov3_loss param name. test=develop
1 parent 1237dfa commit b1e7799

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

python/paddle/fluid/layers/detection.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -509,35 +509,35 @@ def polygon_box_transform(input, name=None):
509509

510510
@templatedoc(op_type="yolov3_loss")
511511
def yolov3_loss(x,
512-
gtbox,
513-
gtlabel,
512+
gt_box,
513+
gt_label,
514514
anchors,
515515
anchor_mask,
516516
class_num,
517517
ignore_thresh,
518518
downsample_ratio,
519-
gtscore=None,
519+
gt_score=None,
520520
use_label_smooth=True,
521521
name=None):
522522
"""
523523
${comment}
524524
525525
Args:
526526
x (Variable): ${x_comment}
527-
gtbox (Variable): groud truth boxes, should be in shape of [N, B, 4],
527+
gt_box (Variable): groud truth boxes, should be in shape of [N, B, 4],
528528
in the third dimenstion, x, y, w, h should be stored
529529
and x, y, w, h should be relative value of input image.
530530
N is the batch number and B is the max box number in
531531
an image.
532-
gtlabel (Variable): class id of ground truth boxes, shoud be in shape
532+
gt_label (Variable): class id of ground truth boxes, shoud be in shape
533533
of [N, B].
534534
anchors (list|tuple): ${anchors_comment}
535535
anchor_mask (list|tuple): ${anchor_mask_comment}
536536
class_num (int): ${class_num_comment}
537537
ignore_thresh (float): ${ignore_thresh_comment}
538538
downsample_ratio (int): ${downsample_ratio_comment}
539539
name (string): the name of yolov3 loss. Default None.
540-
gtscore (Variable): mixup score of ground truth boxes, shoud be in shape
540+
gt_score (Variable): mixup score of ground truth boxes, shoud be in shape
541541
of [N, B]. Default None.
542542
use_label_smooth (bool): ${use_label_smooth_comment}
543543
@@ -558,25 +558,25 @@ def yolov3_loss(x,
558558
.. code-block:: python
559559
560560
x = fluid.layers.data(name='x', shape=[255, 13, 13], dtype='float32')
561-
gtbox = fluid.layers.data(name='gtbox', shape=[6, 4], dtype='float32')
562-
gtlabel = fluid.layers.data(name='gtlabel', shape=[6], dtype='int32')
563-
gtscore = fluid.layers.data(name='gtscore', shape=[6], dtype='float32')
561+
gt_box = fluid.layers.data(name='gt_box', shape=[6, 4], dtype='float32')
562+
gt_label = fluid.layers.data(name='gt_label', shape=[6], dtype='int32')
563+
gt_score = fluid.layers.data(name='gt_score', shape=[6], dtype='float32')
564564
anchors = [10, 13, 16, 30, 33, 23, 30, 61, 62, 45, 59, 119, 116, 90, 156, 198, 373, 326]
565565
anchor_mask = [0, 1, 2]
566-
loss = fluid.layers.yolov3_loss(x=x, gtbox=gtbox, gtlabel=gtlabel,
567-
gtscore=gtscore, anchors=anchors,
566+
loss = fluid.layers.yolov3_loss(x=x, gt_box=gt_box, gt_label=gt_label,
567+
gt_score=gt_score, anchors=anchors,
568568
anchor_mask=anchor_mask, class_num=80,
569569
ignore_thresh=0.7, downsample_ratio=32)
570570
"""
571571
helper = LayerHelper('yolov3_loss', **locals())
572572

573573
if not isinstance(x, Variable):
574574
raise TypeError("Input x of yolov3_loss must be Variable")
575-
if not isinstance(gtbox, Variable):
575+
if not isinstance(gt_box, Variable):
576576
raise TypeError("Input gtbox of yolov3_loss must be Variable")
577-
if not isinstance(gtlabel, Variable):
577+
if not isinstance(gt_label, Variable):
578578
raise TypeError("Input gtlabel of yolov3_loss must be Variable")
579-
if gtscore is not None and not isinstance(gtscore, Variable):
579+
if gt_score is not None and not isinstance(gt_score, Variable):
580580
raise TypeError("Input gtscore of yolov3_loss must be Variable")
581581
if not isinstance(anchors, list) and not isinstance(anchors, tuple):
582582
raise TypeError("Attr anchors of yolov3_loss must be list or tuple")
@@ -602,11 +602,11 @@ def yolov3_loss(x,
602602

603603
inputs = {
604604
"X": x,
605-
"GTBox": gtbox,
606-
"GTLabel": gtlabel,
605+
"GTBox": gt_box,
606+
"GTLabel": gt_label,
607607
}
608608
if gtscore:
609-
inputs["GTScore"] = gtscore
609+
inputs["GTScore"] = gt_score
610610

611611
attrs = {
612612
"anchors": anchors,

0 commit comments

Comments
 (0)