提交 ad2affa7 编写于 作者: M mamingjie-China

fix import pycocotools

上级 7f67465e
......@@ -15,6 +15,7 @@
import os.path as osp
import random
import json
from pycocotools.coco import COCO
from .utils import MyEncoder
import paddlex.utils.logging as logging
......@@ -23,12 +24,6 @@ def split_coco_dataset(dataset_dir, val_percent, test_percent, save_dir):
if not osp.exists(osp.join(dataset_dir, "annotations.json")):
logging.error("\'annotations.json\' is not found in {}!".format(
dataset_dir))
try:
from pycocotools.coco import COCO
except:
logging.error(
"pycococotools is not installed, follow this doc install pycocotools: https://paddlex.readthedocs.io/zh_CN/develop/install.html#pycocotools"
)
annotation_file = osp.join(dataset_dir, "annotations.json")
coco = COCO(annotation_file)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册