@@ -509,35 +509,35 @@ def polygon_box_transform(input, name=None):
509
509
510
510
@templatedoc (op_type = "yolov3_loss" )
511
511
def yolov3_loss (x ,
512
- gtbox ,
513
- gtlabel ,
512
+ gt_box ,
513
+ gt_label ,
514
514
anchors ,
515
515
anchor_mask ,
516
516
class_num ,
517
517
ignore_thresh ,
518
518
downsample_ratio ,
519
- gtscore = None ,
519
+ gt_score = None ,
520
520
use_label_smooth = True ,
521
521
name = None ):
522
522
"""
523
523
${comment}
524
524
525
525
Args:
526
526
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],
528
528
in the third dimenstion, x, y, w, h should be stored
529
529
and x, y, w, h should be relative value of input image.
530
530
N is the batch number and B is the max box number in
531
531
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
533
533
of [N, B].
534
534
anchors (list|tuple): ${anchors_comment}
535
535
anchor_mask (list|tuple): ${anchor_mask_comment}
536
536
class_num (int): ${class_num_comment}
537
537
ignore_thresh (float): ${ignore_thresh_comment}
538
538
downsample_ratio (int): ${downsample_ratio_comment}
539
539
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
541
541
of [N, B]. Default None.
542
542
use_label_smooth (bool): ${use_label_smooth_comment}
543
543
@@ -558,25 +558,25 @@ def yolov3_loss(x,
558
558
.. code-block:: python
559
559
560
560
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')
564
564
anchors = [10, 13, 16, 30, 33, 23, 30, 61, 62, 45, 59, 119, 116, 90, 156, 198, 373, 326]
565
565
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,
568
568
anchor_mask=anchor_mask, class_num=80,
569
569
ignore_thresh=0.7, downsample_ratio=32)
570
570
"""
571
571
helper = LayerHelper ('yolov3_loss' , ** locals ())
572
572
573
573
if not isinstance (x , Variable ):
574
574
raise TypeError ("Input x of yolov3_loss must be Variable" )
575
- if not isinstance (gtbox , Variable ):
575
+ if not isinstance (gt_box , Variable ):
576
576
raise TypeError ("Input gtbox of yolov3_loss must be Variable" )
577
- if not isinstance (gtlabel , Variable ):
577
+ if not isinstance (gt_label , Variable ):
578
578
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 ):
580
580
raise TypeError ("Input gtscore of yolov3_loss must be Variable" )
581
581
if not isinstance (anchors , list ) and not isinstance (anchors , tuple ):
582
582
raise TypeError ("Attr anchors of yolov3_loss must be list or tuple" )
@@ -602,11 +602,11 @@ def yolov3_loss(x,
602
602
603
603
inputs = {
604
604
"X" : x ,
605
- "GTBox" : gtbox ,
606
- "GTLabel" : gtlabel ,
605
+ "GTBox" : gt_box ,
606
+ "GTLabel" : gt_label ,
607
607
}
608
- if gtscore :
609
- inputs ["GTScore" ] = gtscore
608
+ if gt_score :
609
+ inputs ["GTScore" ] = gt_score
610
610
611
611
attrs = {
612
612
"anchors" : anchors ,
0 commit comments