Skip to content

Commit 4388b0a

Browse files
authored
Correct subset creation and evaluation (#3978)
* Fix kaldi subset creation convert.py * FIx coco_orig_metrics.py for subset evaluation * Update dataset.py
1 parent f798fd6 commit 4388b0a

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

tools/accuracy_checker/accuracy_checker/annotation_converters/convert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def make_subset_kaldi(annotation, size, shuffle=True, **kwargs):
248248
indices = indices[:num_elem_to_add]
249249
else:
250250
if shuffle:
251-
indices = np.random.shuffle(indices)
251+
np.random.shuffle(indices)
252252
subset.extend([annotation[idx] for idx in indices])
253253
if len(subset) == size:
254254
break

tools/accuracy_checker/accuracy_checker/dataset.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,10 @@ def multi_infer(self):
389389
def labels(self):
390390
return self.data_provider.labels
391391

392+
@property
393+
def subsample_size(self):
394+
return get_subsample_size(self.config)
395+
392396

393397
def read_annotation(annotation_file: Path, log=True):
394398
annotation_file = Path(annotation_file)

tools/accuracy_checker/accuracy_checker/metrics/coco_orig_metrics.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,7 @@ def _run_coco_evaluation(coco, coco_res, iou_type='bbox', threshold=None):
381381

382382
@property
383383
def _use_original_coco(self):
384-
subsample_size = self.dataset.config.get('subsample_size')
385-
if not subsample_size:
384+
if not self.dataset.subsample_size:
386385
annotation_conversion_parameters = self.dataset.config.get('annotation_conversion', {})
387386
if 'annotation_file' in annotation_conversion_parameters:
388387
annotation_file = Path(annotation_conversion_parameters['annotation_file'])

0 commit comments

Comments
 (0)