def _write_voc_results_file(self, all_boxes):
    use_salt = self.config['use_salt']
    comp_id = 'comp4'
    if use_salt:
        comp_id += '-{}'.format(os.getpid())
    path = os.path.join(self._pascal_path, ('VOCdevkit' + self._year), 'results', ('VOC' + self._year), 'Main', (comp_id + '_'))
    for (cls_ind, cls) in enumerate(self.classes):
        if (cls == '__background__'):
            continue
        print('Writing {} VOC results file'.format(cls))
        filename = (((((path + 'det_') + self._image_set) + '_') + cls) + '.txt')
        print(filename)
        with open(filename, 'wt') as f:
            for (im_ind, index) in enumerate(self.image_index):
                dets = all_boxes[cls_ind][im_ind]
                if (dets == []):
                    continue
                for k in range(dets.shape[0]):
                    f.write('{:s} {:.3f} {:.1f} {:.1f} {:.1f} {:.1f}\n'.format(index, dets[(k, 4)], (dets[(k, 0)] + 1), (dets[(k, 1)] + 1), (dets[(k, 2)] + 1), (dets[(k, 3)] + 1)))
    return comp_id
def _write_voc_results_file(self, all_boxes):
    use_salt = self.config['use_salt']
    comp_id = 'comp4'
    if use_salt:
        comp_id += '-{}'.format(os.getpid())
    path = os.path.join(self._pascal_path, ('VOCdevkit' + self._year), 'results', ('VOC' + self._year), 'Main', (comp_id + '_'))
    for (cls_ind, cls) in enumerate(self.classes):
        if (cls == '__background__'):
            continue
        print('Writing {} VOC results file'.format(cls))
        filename = (((((path + 'det_') + self._image_set) + '_') + cls) + '.txt')
        print(filename)
        with open(filename, 'wt') as f:
            for (im_ind, index) in enumerate(self.image_index):
                dets = all_boxes[cls_ind][im_ind]
                if (dets == []):
                    continue
                for k in range(dets.shape[0]):
                    f.write('{:s} {:.3f} {:.1f} {:.1f} {:.1f} {:.1f}\n'.format(index, dets[(k, 4)], (dets[(k, 0)] + 1), (dets[(k, 1)] + 1), (dets[(k, 2)] + 1), (dets[(k, 3)] + 1)))
    return comp_id