'Converts the roi labels from compressed (1, num_rois) shape
to the one-hot format required for the global buffers of shape
(num_classes, num_rois)'

def _onehot_labels(self, labels):

    labels_full = np.zeros((self.num_classes, self.num_rois))
    for (idx, l) in enumerate(labels):
        labels_full[(int(l), idx)] = 1
    return labels_full
