def get_weights(gt_dict):
    """Calculate weights for weighted cross entropy loss.

    Args:
        gt_dict: dictionary of the gt labels.

    Returns:
        list of weigths per class
    """
    count_list = [0, 0]
    for _, item in gt_dict.items():
        item = list(item)
        count_list[1] += item.count(1)
        count_list[0] += item.count(0)

    weights = [1/ count_list[i] if count_list[i]!=0 else 1 for i in range(2)]
    weights_norm = [i/ sum(weights) for i in weights]
    return weights_norm