import argparse
import base64
import json
import os
import os.path as osp
import warnings
import PIL.Image
import yaml
from labelme import utils
def main():
warnings.warn("This script is aimed to demonstrate how to convert the\n"
"JSON file to a single image dataset, and not to handle\n"
"multiple JSON files to generate a real-use dataset.")
parser = argparse.ArgumentParser()
parser.add_argument('json_file')
parser.add_argument('-o', '--out', default=None)
args = parser.parse_args()
json_file = args.json_file
list_file = os.listdir(json_file)
# if args.out is None:
# out_dir = osp.basename(json_file).replace('.', '_')
# out_dir = osp.join(osp.dirname(json_file), out_dir)
# else:
# out_dir = args.out
# if not osp.exists(out_dir):
# os.mkdir(out_dir
批量处理LabelMe标记后的Json文件
最新推荐文章于 2024-09-07 01:18:14 发布