# >> !pip install -r requirements.txt
from json_to_dataset import mk_dataset
class args:
label_name_to_value = {'_background_': 0, 'center':1} # 指定标签映射
json_file = "./data" # json路径
image_file = "./data" # 图片路径
img_type = "bmp" # 图片类型
out_dir = "./data" # 输出路径
is_RGBLabel = True # 保存 COLOR 标签图
is_GRAYLabel = True # 保存 LABEL 标签图
is_MASK = True # 保存 Makrs 掩码图
pass
mk_dataset(args.json_file, args.image_file, args.out_dir, args.label_name_to_value,
args.img_type,
args.is_RGBLabel,
args.is_GRAYLabel,
args.is_MASK)
print("finish")
json_to_dataset文件链接https://download.csdn.net/download/weixin_41275726/21072570