root_path为图片路径
out_file为生成 txt标注文件的保存路径
仅适用于检测车牌框(只有plate一个类)
import os
import re
import cv2
root_path = r'/home/joy/SXH/tensorflow-yolov4-tflite/data/CCPD2019/images/'
file_name = os.listdir(root_path)
def convert(size, box):
dw = 1. / size[0]
dh = 1. / size[1]
x = (box[0] + box[1]) / 2.0
y = (box