提交 9ab19fff 编写于 作者: S sunyanfang01

modify the coco

上级 ca669355
......@@ -19,8 +19,6 @@ import copy
import json
import cv2
import numpy as np
from pycocotools.coco import COCO
from pycocotools.mask import decode
import paddlex.utils.logging as logging
from .voc import VOCDetection
from .dataset import is_pic
......@@ -82,6 +80,7 @@ class EasyDataDet(VOCDetection):
'name': k
})
from pycocotools.mask import decode
ct = 0
ann_ct = 0
with open(file_list, encoding=get_encoding(file_list)) as f:
......@@ -133,7 +132,7 @@ class EasyDataDet(VOCDetection):
'area':
float((x2 - x1 + 1) * (y2 - y1 + 1)),
'segmentation':
[] if gt_poly[i] is None else gt_poly[i],
[[x1, y1, x1, y2, x2, y2, x2, y1]] if gt_poly[i] is None else gt_poly[i],
'category_id':
cname2cid[cname],
'id':
......@@ -175,6 +174,7 @@ class EasyDataDet(VOCDetection):
logging.info("{} samples in file {}".format(
len(self.file_list), file_list))
self.num_samples = len(self.file_list)
from pycocotools.coco import COCO
self.coco_gt = COCO()
self.coco_gt.dataset = annotations
self.coco_gt.createIndex()
......
......@@ -19,7 +19,6 @@ import copy
import json
import cv2
import numpy as np
from pycocotools.mask import decode
import paddlex.utils.logging as logging
from .dataset import Dataset
from .dataset import get_encoding
......@@ -59,6 +58,7 @@ class EasyDataSeg(Dataset):
self.labels = list()
self._epoch = 0
from pycocotools.mask import decode
cname2cid = {}
label_id = 0
with open(label_list, encoding=get_encoding(label_list)) as fr:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册