import tensorflow as tf


        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,
