参考
https://zhuanlan.zhihu.com/p/383610906
资源下载
论文地址: https://arxiv.org/pdf/1905.01489.pdf
github地址: https://github.com/valeoai/woodscape
数据集下载链接:https://drive.google.com/drive/folders/1X5JOMEfVlaXfdNy24P8VA-jMs0yzf_HR
workshop地址: https://sites.google.com/view/omnicv2021/home
样本筛选
参考WoodScape-master/README.md说明文档进行测试;
提取2D目标检测(矩形框)标注信息
测试用例:
WoodScape-master/scripts/box_2d_generator.py
命令:
python box_2d_generator.py --src_path [DATASET DIR]/data/instance_annotations/ --dst_path [DATASET DIR]/data/box_2d_annotations --box_2d_class_mapping [DATASET DIR]/scripts/configs/box_2d_mapping_5_classes.json --instance_class_mapping [DATASET DIR]/scripts/mappers/class_names.json --rgb_image_path [DATASET DIR]/data/rgb_images
其中:
–src_path :输入路径,遍历json后缀的文件,根据其前缀解析出待检测图像名称;
–dst_path :输出路径,保存目标框信息
–box_2d_class_mapping
–instance_class_mapping
–rgb_image_path:图像所在路径
检测结果:
提取2D目标检测(多边形框)标注信息
测试用例:
WoodScape-master/scripts/polygon_generator.py
命令:
./scripts/polygon_generator.py --src_path /mnt/d/work/NET/WoodScape-dataset/instance_annotations/instance_annotations/ --dst_path /mnt/d/work/NET/WoodScape-dataset/polygon_annotations --box_2d_class_mapping ./scripts/configs/box_2d_mapping_5_classes.json --instance_class_mapping ./scripts/mappers/class_names.json --rgb_image_path /mnt/d/work/NET/WoodScape-dataset/rgb_images/
检测结果:
报错1:
当WoodScape-master/scripts/configs/box_2d_mapping_5_classes.json中 debug设为false时,报错:
‘NoneType’ object has no attribute ‘shape’
原因分析:
WoodScape-master/scripts/polygon_generator.py中,debug为false时,image_debug = None,但是
generate_polygons函数(WoodScape-master/scripts/parsers/detection/helpers.py)未作判断就使用了传入的参数;
修改方式:
WoodScape-master/scripts/polygon_generator.py
报错2:
原因: cv2.findContours的opencv旧版本返回3个值:
im2, contours, hierarchy = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
新版本返回2个值:
contours, hierarchy = cv2.findContours(mask, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
原代码:
_,contours, _ = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
改为:
contours, _ = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
即可