提交 a3c36b82 编写于 作者: 碧雨若风's avatar 碧雨若风

格式转换中的几个错误

上级 dd323e8d
......@@ -147,7 +147,7 @@ class LabelMe2COCO(X2COCO):
img_name_part = osp.splitext(img_file)[0]
json_file = osp.join(json_dir, img_name_part + ".json")
if not osp.exists(json_file):
os.remove(osp.join(image_dir, img_file))
os.remove(osp.join(img_dir, img_file))
continue
image_id = image_id + 1
with open(json_file, mode='r', \
......@@ -220,7 +220,7 @@ class EasyData2COCO(X2COCO):
img_name_part = osp.splitext(img_file)[0]
json_file = osp.join(json_dir, img_name_part + ".json")
if not osp.exists(json_file):
os.remove(osp.join(image_dir, img_file))
os.remove(osp.join(img_dir, img_file))
continue
image_id = image_id + 1
with open(json_file, mode='r', \
......@@ -317,7 +317,7 @@ class JingLing2COCO(X2COCO):
img_name_part = osp.splitext(img_file)[0]
json_file = osp.join(json_dir, img_name_part + ".json")
if not osp.exists(json_file):
os.remove(osp.join(image_dir, img_file))
os.remove(osp.join(img_dir, img_file))
continue
image_id = image_id + 1
with open(json_file, mode='r', \
......
......@@ -23,6 +23,7 @@ import shutil
import numpy as np
import PIL.Image
from .base import MyEncoder, is_pic, get_encoding
import math
class X2Seg(object):
def __init__(self):
......@@ -140,7 +141,7 @@ class JingLing2Seg(X2Seg):
img_name_part = osp.splitext(img_name)[0]
json_file = osp.join(json_dir, img_name_part + ".json")
if not osp.exists(json_file):
os.remove(os.remove(osp.join(image_dir, img_name)))
os.remove(osp.join(image_dir, img_name))
continue
with open(json_file, mode="r", \
encoding=get_encoding(json_file)) as j:
......@@ -226,7 +227,7 @@ class LabelMe2Seg(X2Seg):
img_name_part = osp.splitext(img_name)[0]
json_file = osp.join(json_dir, img_name_part + ".json")
if not osp.exists(json_file):
os.remove(os.remove(osp.join(image_dir, img_name)))
os.remove(osp.join(image_dir, img_name))
continue
img_file = osp.join(image_dir, img_name)
img = np.asarray(PIL.Image.open(img_file))
......@@ -260,7 +261,7 @@ class EasyData2Seg(X2Seg):
img_name_part = osp.splitext(img_name)[0]
json_file = osp.join(json_dir, img_name_part + ".json")
if not osp.exists(json_file):
os.remove(os.remove(osp.join(image_dir, img_name)))
os.remove(osp.join(image_dir, img_name))
continue
with open(json_file, mode="r", \
encoding=get_encoding(json_file)) as j:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册