(bbox_targets_data, num_classes)
return bbox_targets, bbox_weights
expand from 5 to 4 * num_classes; only the right class has non-zero bbox regression targets
    :param bbox_targets_data: [k * 5]
    :param num_classes: number of classes
    :return: bbox target processed [k * 4 num_classes]
    bbox_weights ! only foreground boxes have bbox regression computation!
expand from 5 to 4 * num_classes; only the right class has non-zero bbox regression targets
    :param bbox_targets_data: [k * 5]
    :param num_classes: number of classes
    :return: bbox target processed [k * 4 num_classes]
    bbox_weights ! only foreground boxes have bbox regression computation!
expand from 5 to 4 * num_classes ; only the right class has non - zero bbox regression targets : param bbox_targets_data : [ k * 5 ] : param num_classes : number of classes : return : bbox target processed [ k * 4 num_classes ] bbox_weights ! only foreground boxes have bbox regression computation!
def expand_bbox_regression_targets(bbox_targets_data, num_classes):
    """
    expand from 5 to 4 * num_classes; only the right class has non-zero bbox regression targets
    :param bbox_targets_data: [k * 5]
    :param num_classes: number of classes
    :return: bbox target processed [k * 4 num_classes]
    bbox_weights ! only foreground boxes have bbox regression computation!
    """
    classes = bbox_targets_data[:, 0]
    if config.network.class_agnostic:
        num_classes = 2
    bbox_targets = np.zeros((classes.size, 4 * num_classes), dtype=np.float32)
    bbox_weights = np.zeros(bbox_targets.shape, dtype=np.float32)
    indexes = np.where(classes > 0)[0]
    for index in indexes:
        cls = classes[index]
        start = int(4 * 1 if cls > 0 else 0) if config.network.class_agnostic else int(4 * cls)
        end = start + 4
        bbox_targets[index, start:end] = bbox_targets_data[index, 1:]
        bbox_weights[index, start:end] = config.train.bbox_weights
    return bbox_targets, bbox_weights
def expand_bbox_regression_targets ( bbox_targets_data , num_classes ) : classes = bbox_targets_data [ : , 0 ] if config . network . class_agnostic : num_classes = 2 bbox_targets = np . zeros ( ( classes . size , 4 * num_classes ) , dtype = np . float32 ) bbox_weights = np . zeros ( bbox_targets . shape , dtype = np . float32 ) indexes = np . where ( classes > 0 ) [ 0 ] for index in indexes : cls = classes [ index ] start = int ( 4 * 1 if cls > 0 else 0 ) if config . network . class_agnostic else int ( 4 * cls ) end = start + 4 bbox_targets [ index , start : end ] = bbox_targets_data [ index , 1 : ] bbox_weights [ index , start : end ] = config . train . bbox_weights return bbox_targets , bbox_weights