Răsfoiți Sursa

fix the bug

sunyanfang01 5 ani în urmă
părinte
comite
13501bfb6f

+ 1 - 1
paddlex/cv/datasets/easydata_cls.py

@@ -76,7 +76,7 @@ class EasyDataCls(ImageNet):
                     raise IOError(
                         'The image file {} is not exist!'.format(img_file))
                 with open(json_file, mode='r', \
-                          encoding=get_encoding(label_list)) as j:
+                          encoding=get_encoding(json_file)) as j:
                     json_info = json.load(j)
                 label = json_info['labels'][0]['name']
                 self.file_list.append([img_file, self.labels.index(label)])

+ 1 - 1
paddlex/cv/datasets/easydata_det.py

@@ -96,7 +96,7 @@ class EasyDataDet(VOCDetection):
                     raise IOError(
                         'The image file {} is not exist!'.format(img_file))
                 with open(json_file, mode='r', \
-                          encoding=get_encoding(label_list)) as j:
+                          encoding=get_encoding(json_file)) as j:
                     json_info = json.load(j)
                 im_id = np.array([ct])
                 im = cv2.imread(img_file)

+ 1 - 1
paddlex/cv/datasets/easydata_seg.py

@@ -79,7 +79,7 @@ class EasyDataSeg(Dataset):
                     raise IOError(
                         'The image file {} is not exist!'.format(img_file))
                 with open(json_file, mode='r', \
-                          encoding=get_encoding(label_list)) as j:
+                          encoding=get_encoding(json_file)) as j:
                     json_info = json.load(j)
                 im = cv2.imread(img_file)
                 im_w = im.shape[1]