JSON to YOLO
这里用的JSON文件是已经切割好的小的json文件,一个json对应一个image图片
切割json文件已经放在这里了
切割JSON文件
import json
import os
categorys = ['pedestrian', 'rider', 'car', 'truck', 'bus', 'train', 'motorcycle', 'bicycle'] #类别
path = "F:\\train_jsonAndTxtConjson" #原json文件
textpath = "F:\\DATA\\train\\valids" #生成目标txt文件
files = []
for jsonFile in os.listdir(path):
if not jsonFile.endswith("~") or not jsonFile == "":