(bbox_target_data)
return bbox_targets, bbox_inside_weights
Bounding-box regression targets are stored in a compact form in the
    roidb.
    This function expands those targets into the 4-of-4*K representation used
    by the network (i.e. only one class has non-zero targets). The loss weights
    are similarly expanded.
    Returns:
        bbox_target_data (ndarray): N x 4K blob of regression targets
        bbox_inside_weights (ndarray): N x 4K blob of loss weights
Bounding-box regression targets are stored in a compact form in the
    roidb.
    This function expands those targets into the 4-of-4*K representation used
    by the network (i.e. only one class has non-zero targets). The loss weights
    are similarly expanded.
    Returns:
        bbox_target_data (ndarray): N x 4K blob of regression targets
        bbox_inside_weights (ndarray): N x 4K blob of loss weights
Bounding - box regression targets are stored in a compact form in the roidb . This function expands those targets into the 4 - of - 4 * K representation used by the network ( i . e . only one class has non - zero targets ) . The loss weights are similarly expanded . Returns : bbox_target_data ( ndarray ) : N x 4K blob of regression targets bbox_inside_weights ( ndarray ) : N x 4K blob of loss weights
def _expand_bbox_targets(bbox_target_data):
    """Bounding-box regression targets are stored in a compact form in the
    roidb.
    This function expands those targets into the 4-of-4*K representation used
    by the network (i.e. only one class has non-zero targets). The loss weights
    are similarly expanded.
    Returns:
        bbox_target_data (ndarray): N x 4K blob of regression targets
        bbox_inside_weights (ndarray): N x 4K blob of loss weights
    """
    num_bbox_reg_classes = 2 if config.network.cls_agnostic_bbox_reg else config.dataset.num_classes

    clss = bbox_target_data[:, 0]
    bbox_targets = np.zeros((clss.size, 4 * num_bbox_reg_classes), dtype=np.float32)
    bbox_inside_weights = np.zeros(bbox_targets.shape, dtype=np.float32)
    inds = np.where(clss > 0)[0]
    for ind in inds:
        cls = int(clss[ind])
        start = 4 * cls
        end = start + 4
        bbox_targets[ind, start:end] = bbox_target_data[ind, 1:]
        bbox_inside_weights[ind, start:end] = (1.0, 1.0, 1.0, 1.0)
    return bbox_targets, bbox_inside_weights
def _expand_bbox_targets ( bbox_target_data ) : num_bbox_reg_classes = 2 if config . network . cls_agnostic_bbox_reg else config . dataset . num_classes clss = bbox_target_data [ : , 0 ] bbox_targets = np . zeros ( ( clss . size , 4 * num_bbox_reg_classes ) , dtype = np . float32 ) bbox_inside_weights = np . zeros ( bbox_targets . shape , dtype = np . float32 ) inds = np . where ( clss > 0 ) [ 0 ] for ind in inds : cls = int ( clss [ ind ] ) start = 4 * cls end = start + 4 bbox_targets [ ind , start : end ] = bbox_target_data [ ind , 1 : ] bbox_inside_weights [ ind , start : end ] = ( 1.0 , 1.0 , 1.0 , 1.0 ) return bbox_targets , bbox_inside_weights