文本检测定位需要检测文本位置,由于数据不够所以需要要增强
数据增强方式:
# 包括: | |
# 1. 裁剪(需改变bbox) | |
# 2. 平移(需改变bbox) | |
# 3. 改变亮度 | |
# 4. 加噪声 | |
# 5. 旋转角度(需要改变bbox) | |
# 6. 镜像(需要改变bbox) | |
# 7. cutout |
使用 https://github.com/maozezhong/CV_ToolBox 对数据进行增强。
input 场景图片 groundtruth roc数据集格式xml
output 增强后图片 groundtruth roc数据集格式xm
下载作者代码
进入DataAugForObjectDetection 文件夹
运行DataAugmentForObejctDetection.py
这里需要指定文件位置
source_pic_root_path = './data_split'
source_xml_root_path = './data_voc/VOC2007/Annotations'
# 在435 436行将路径改为你自己的路径
当然数据增强也可以使用imgaug一个库