From 4e64acbdf9c13982d47e52aa9c31d0d0da353018 Mon Sep 17 00:00:00 2001 From: cjphp Date: Sun, 7 Dec 2025 20:59:12 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E6=89=A7?= =?UTF-8?q?=E8=A1=8Cvoc=E9=A2=84=E6=B5=8B=E6=97=B6=E6=AF=8F=E6=AC=A1?= =?UTF-8?q?=E9=83=BD=E9=9C=80=E8=A6=81=E5=8A=A0=E8=BD=BDCOCO=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E6=96=87=E4=BB=B6=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ppdet/data/source/dataset.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ppdet/data/source/dataset.py b/ppdet/data/source/dataset.py index cccf9570f2..5610700365 100644 --- a/ppdet/data/source/dataset.py +++ b/ppdet/data/source/dataset.py @@ -217,16 +217,17 @@ def _load_images(self, do_eval=False): images = self._parse() ct = 0 records = [] - anno_file = self.get_anno() - coco = COCO(anno_file) for image in images: assert image != '' and os.path.isfile(image), \ "Image {} not found".format(image) if self.sample_num > 0 and ct >= self.sample_num: break if do_eval: + anno_file = self.get_anno() + coco = COCO(anno_file) image_id = self.get_image_id(image, coco) ct = image_id + rec = {'im_id': np.array([ct]), 'im_file': image} self._imid2path[ct] = image ct += 1