From 1ec46f7b735bcefee9d501e262c5de537148037d Mon Sep 17 00:00:00 2001 From: SunAhong1993 <48579383+SunAhong1993@users.noreply.github.com> Date: Mon, 25 May 2020 11:13:18 +0800 Subject: [PATCH] Update voc.py --- paddlex/cv/datasets/voc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddlex/cv/datasets/voc.py b/paddlex/cv/datasets/voc.py index fee0c78..a62aeb7 100644 --- a/paddlex/cv/datasets/voc.py +++ b/paddlex/cv/datasets/voc.py @@ -72,9 +72,9 @@ class VOCDetection(Dataset): label_id = 1 with open(label_list, 'r', encoding=get_encoding(label_list)) as fr: for line in fr.readlines(): - cname2cid[line.strip()] = label_id + cname2cid[line[:-1]] = label_id label_id += 1 - self.labels.append(line.strip()) + self.labels.append(line[:-1]) logging.info("Starting to read file list from dataset...") for k, v in cname2cid.items(): annotations['categories'].append({ -- GitLab