diff --git a/paddlex/cv/datasets/voc.py b/paddlex/cv/datasets/voc.py index 8633fe5305929c5238523a067af172720156d3d5..45335084a9f8ddd9b850b52f3a6db9fe6886a153 100644 --- a/paddlex/cv/datasets/voc.py +++ b/paddlex/cv/datasets/voc.py @@ -113,7 +113,7 @@ class VOCDetection(Dataset): is_crowd = np.zeros((len(objs), 1), dtype=np.int32) difficult = np.zeros((len(objs), 1), dtype=np.int32) for i, obj in enumerate(objs): - cname = obj.find('name').text + cname = obj.find('name').text.strip() gt_class[i][0] = cname2cid[cname] _difficult = int(obj.find('difficult').text) x1 = float(obj.find('bndbox').find('xmin').text)