yolov10 生成json 自动标注
import glob
import json
import os
import shutilimport cv2
import timeimport numpy as np
import torch# import torch
from ultralytics import YOLOv10model = YOLOv10(r"runs\train\exp6\weights\best_12033.pt")mp4_path = r"dao_o\video"
import random
import time
prev_time = 0
fps = 0fiels = glob.glob(mp4_path + '/*')
if len(fiels) == 0:print('len(fiels) is 0',len(fiels))exit(123)
lou_len=0
for dir_i, dir_path in enumerate(fiels):mp4_path = os.path.join(dir_path, 'diffusion0.mp4')videocapture = cv2.VideoCapture(mp4_path)# frame_width, frame_height = int(videocapture.get(3)), int(videocapture.g