admin管理员组文章数量:1655672
# -*- 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:
# os.path.basename(path),返回path最后的文件名
# Python replace() 方
版权声明:本文标题:Labelme批量转换json文件(代码注释) 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1729699577a1210444.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论