def _gather_samples(roidb, roi_inds, rels, num_classes):
    '\n    join all samples and produce sampled items\n    '
    rois = roidb['boxes']
    labels = roidb['max_classes']
    overlaps = roidb['max_overlaps']
    bg_inds = np.where((overlaps < cfg.TRAIN.FG_THRESH))[0]
    labels = labels.copy()
    labels[bg_inds] = 0
    labels = labels[roi_inds]
    overlaps = overlaps[roi_inds]
    rois = rois[roi_inds]
    roi_ind_map = {}
    for (i, roi_i) in enumerate(roi_inds):
        roi_ind_map[roi_i] = i
    for (i, rel) in enumerate(rels):
        rels[i] = [roi_ind_map[rel[0]], roi_ind_map[rel[1]], rel[2]]
    (bbox_targets, bbox_inside_weights) = _get_bbox_regression_labels(roidb['bbox_targets'][roi_inds, :], num_classes)
    return (rels, labels, overlaps, rois, bbox_targets, bbox_inside_weights)
join all samples and produce sampled items
def _gather_samples(roidb, roi_inds, rels, num_classes):
    '\n    \n    '
    rois = roidb['boxes']
    labels = roidb['max_classes']
    overlaps = roidb['max_overlaps']
    bg_inds = np.where((overlaps < cfg.TRAIN.FG_THRESH))[0]
    labels = labels.copy()
    labels[bg_inds] = 0
    labels = labels[roi_inds]
    overlaps = overlaps[roi_inds]
    rois = rois[roi_inds]
    roi_ind_map = {}
    for (i, roi_i) in enumerate(roi_inds):
        roi_ind_map[roi_i] = i
    for (i, rel) in enumerate(rels):
        rels[i] = [roi_ind_map[rel[0]], roi_ind_map[rel[1]], rel[2]]
    (bbox_targets, bbox_inside_weights) = _get_bbox_regression_labels(roidb['bbox_targets'][roi_inds, :], num_classes)
    return (rels, labels, overlaps, rois, bbox_targets, bbox_inside_weights)