From b4c065df59f490adec2628faa9a696396ed323d0 Mon Sep 17 00:00:00 2001 From: buptdragon <39579122+buptdragon@users.noreply.github.com> Date: Tue, 26 Oct 2021 16:17:23 +0800 Subject: [PATCH] img_path is different between "train" and "val" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1、Second param of os.path.json() should not begins with '/'. 2、img_path should var depends tag. --- utils/prepare/prepare_coco.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/prepare/prepare_coco.py b/utils/prepare/prepare_coco.py index d38744b..a49d94f 100644 --- a/utils/prepare/prepare_coco.py +++ b/utils/prepare/prepare_coco.py @@ -36,7 +36,7 @@ def make_data(data_path=None, tag="train"): target[cls] = 1 path = img_info['file_name'] data['target'] = target - data['img_path'] = os.path.join(os.path.join(data_path, "/images/val2014/"), path) + data['img_path'] = os.path.join(os.path.join(data_path, "images/"+tag+"2014/"), path) message.append(data) with open('data/coco/{}_coco2014.json'.format(tag), 'w') as f: