zzh8829/yolov3-tf2

What does tf.pad do?

dhwgithub opened this issue · 3 comments

Source code link: https://github.com/zzh8829/yolov3-tf2/blob/master/yolov3_tf2/dataset.py#L115

    paddings = [[0, FLAGS.yolo_max_boxes - tf.shape(y_train)[0]], [0, 0]]
    y_train = tf.pad(y_train, paddings)

In addition, FLAGS.yolo_max_boxes I did not find the assignment statement

Can someone help me answer these two questions? Thank you

Label shape must match network output shape. Network output shape is defined by yolo_max_boxes. So if image have only 2 label and yolo_max_boxes equals 100, you need to add padding with zeros (e.g. 98 "zeros" labels) so shapes matches.

Where is yolo_max_boxes defined or initialized? thanks