前期配置及遇到的乱七八糟的问题等见:https://blog.csdn.net/chenfang0529/article/details/115094036
一、导出
使用mmdetection训练自己的数据集,数据集使用VCAT进行标注,标注的文件是视频文件,将图像帧及标注文件导出为COCO格式。常用的还有PASCAL VOC
导出后包括两个文件
images和annotations
images中包含图像帧
annotations包含标注文件,我们只需要对第三个文件进行修改。
二、相关代码
1.批量修改图片名
import os
class BatchRename():
def rename(self):
path="D:\\achenf\data\\taxi\\test\\task_2_9_car_test-2021_04_13_13_25_24-coco\images"
filelist=os.listdir(path)
total_num = len(filelist)
i=595
for item in filelist:
if item.endswith('.jpg'):
src=os.path.join(os.path.abspath(path),item)
dst=os.path.join