import tensorflow as tf

        box_wh = tf.exp(box_wh) * anchors

        box_x1y1 = box_xy - box_wh / 2.
        box_x2y2 = box_xy + box_wh / 2.
        box = tf.concat([box_x1y1, box_x2y2], axis=-1)

        boxes.append(tf.reshape(box, (x_shape[0], -1, 1, 4)))
        objects.append(tf.reshape(obj, (x_shape[0], -1, 1)))
        classes.append(tf.reshape(cls, (x_shape[0], -1, num_classes)))

    boxes = tf.concat(boxes, axis=1)
    objects = tf.concat(objects, axis=1)
    classes = tf.concat(classes, axis=1)

    scores = objects * classes
    boxes, scores, classes, valid = tf.image.combined_non_max_suppression(
        boxes=boxes,
        scores=scores,
        max_output_size_per_class=max_outputs,
        max_total_size=max_outputs,
