# -*- coding: utf-8 -*-
from __future__ import unicode_literals
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
if args.out is None:
&

这个脚本展示了如何将JSON文件转换为单个图像数据集,但不适用于处理多个JSON文件来创建实际的数据集。它从JSON文件加载数据,处理图像和形状,然后保存为图像和标签文件,并生成label_names.txt和info.yaml文件。
最低0.47元/天 解锁文章
992

被折叠的 条评论
为什么被折叠?



