From d77f2ccaeffe3c7757cc8ed6291e2d376529e990 Mon Sep 17 00:00:00 2001 From: Maxim Zhiltsov Date: Fri, 5 Jun 2020 11:24:55 +0300 Subject: [PATCH] Allow any annotations file name in coco extractor --- datumaro/datumaro/plugins/coco_format/extractor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datumaro/datumaro/plugins/coco_format/extractor.py b/datumaro/datumaro/plugins/coco_format/extractor.py index a4f52f814048..ecd39d29d6ff 100644 --- a/datumaro/datumaro/plugins/coco_format/extractor.py +++ b/datumaro/datumaro/plugins/coco_format/extractor.py @@ -24,7 +24,8 @@ class _CocoExtractor(SourceExtractor): def __init__(self, path, task, merge_instance_polygons=False): assert osp.isfile(path), path - subset = osp.splitext(osp.basename(path))[0].rsplit('_', maxsplit=1)[1] + subset = osp.splitext(osp.basename(path))[0].rsplit('_', maxsplit=1) + subset = subset[1] if len(subset) == 2 else None super().__init__(subset=subset) rootpath = ''