import tensorflow as tf

import tensorflow as tf
import numpy as np

def YoloV4Header(num_classes, anchorlist, mask, strides,
                 max_outputs, iou_threshold, score_threshold,inputs):
    boxes, objects, classes = [], [], []
    dtype = inputs[0].dtype

    
    for i, logits in enumerate(inputs):
        print(i,mask[i])
        stride = strides[i]
        anchors = anchorlist[mask[i]]
        x_shape = tf.shape(logits)
        logits = tf.reshape(logits, (x_shape[0], x_shape[1], x_shape[2], len(anchors), num_classes + 5))

        box_xy, box_wh, obj, cls = tf.split(logits, (2, 2, 1, num_classes), axis=-1)
        box_xy = tf.sigmoid(box_xy)
        obj = tf.sigmoid(obj)
        cls = tf.sigmoid(cls)
        anchors = anchors.astype(np.float32)

        grid_shape = x_shape[1:3]
        # print(grid_shape)
        grid_h, grid_w = grid_shape[0], grid_shape[1]
        # print(grid_h,tf.range(grid_h))
