├── demo
├── voc
│ ├── ImageSets
│ │ └── Main
│ │ │ ├── test.txt
│ │ │ ├── val.txt
│ │ │ ├── train.txt
│ │ │ └── trainval.txt
│ ├── worktxt
│ │ ├── train_30178.txt
│ │ ├── train_30131.txt
│ │ ├── train_30180.txt
│ │ ├── train_30185.txt
│ │ ├── train_30101.txt
│ │ ├── train_30147.txt
│ │ ├── train_30126.txt
│ │ ├── train_30209.txt
│ │ ├── train_29635.txt
│ │ ├── train_30169.txt
│ │ ├── train_30092.txt
│ │ ├── train_30202.txt
│ │ ├── train_30123.txt
│ │ ├── train_30138.txt
│ │ ├── train_30190.txt
│ │ ├── train_30156.txt
│ │ ├── train_30183.txt
│ │ ├── train_30116.txt
│ │ ├── train_29641.txt
│ │ └── train_30090.txt
│ ├── JPEGImages
│ │ ├── train_29635.jpg
│ │ ├── train_29641.jpg
│ │ ├── train_30090.jpg
│ │ ├── train_30092.jpg
│ │ ├── train_30101.jpg
│ │ ├── train_30116.jpg
│ │ ├── train_30123.jpg
│ │ ├── train_30126.jpg
│ │ ├── train_30131.jpg
│ │ ├── train_30138.jpg
│ │ ├── train_30147.jpg
│ │ ├── train_30156.jpg
│ │ ├── train_30169.jpg
│ │ ├── train_30178.jpg
│ │ ├── train_30180.jpg
│ │ ├── train_30183.jpg
│ │ ├── train_30185.jpg
│ │ ├── train_30190.jpg
│ │ ├── train_30202.jpg
│ │ └── train_30209.jpg
│ └── Annotations
│ │ ├── train_30131.xml
│ │ ├── train_30178.xml
│ │ ├── train_30180.xml
│ │ ├── train_30185.xml
│ │ ├── train_29635.xml
│ │ ├── train_30092.xml
│ │ ├── train_30101.xml
│ │ ├── train_30126.xml
│ │ ├── train_30147.xml
│ │ ├── train_30169.xml
│ │ ├── train_30202.xml
│ │ ├── train_30209.xml
│ │ ├── train_30123.xml
│ │ ├── train_30138.xml
│ │ ├── train_30183.xml
│ │ ├── train_30190.xml
│ │ ├── train_30156.xml
│ │ ├── train_29641.xml
│ │ ├── train_30090.xml
│ │ └── train_30116.xml
├── yolov3
│ └── custom
│ │ ├── labels
│ │ ├── train_30178.txt
│ │ ├── train_30131.txt
│ │ ├── train_30180.txt
│ │ ├── train_30185.txt
│ │ ├── train_30202.txt
│ │ ├── train_30092.txt
│ │ ├── train_30147.txt
│ │ ├── train_30169.txt
│ │ ├── train_29635.txt
│ │ ├── train_30209.txt
│ │ ├── train_30101.txt
│ │ ├── train_30126.txt
│ │ ├── train_30123.txt
│ │ ├── train_30190.txt
│ │ ├── train_30138.txt
│ │ ├── train_30156.txt
│ │ ├── train_30183.txt
│ │ ├── train_29641.txt
│ │ ├── train_30090.txt
│ │ └── train_30116.txt
│ │ └── trainval.txt
└── coco
│ ├── images
│ ├── train_29635.jpg
│ ├── train_29641.jpg
│ ├── train_30090.jpg
│ ├── train_30092.jpg
│ ├── train_30101.jpg
│ ├── train_30116.jpg
│ ├── train_30123.jpg
│ ├── train_30126.jpg
│ ├── train_30131.jpg
│ ├── train_30138.jpg
│ ├── train_30147.jpg
│ ├── train_30156.jpg
│ ├── train_30169.jpg
│ ├── train_30178.jpg
│ ├── train_30180.jpg
│ ├── train_30183.jpg
│ ├── train_30185.jpg
│ ├── train_30190.jpg
│ ├── train_30202.jpg
│ └── train_30209.jpg
│ ├── val2017
│ ├── train_30092.jpg
│ └── train_30202.jpg
│ ├── train2017
│ ├── train_29635.jpg
│ ├── train_29641.jpg
│ ├── train_30090.jpg
│ ├── train_30101.jpg
│ ├── train_30116.jpg
│ ├── train_30123.jpg
│ ├── train_30126.jpg
│ ├── train_30131.jpg
│ ├── train_30138.jpg
│ ├── train_30147.jpg
│ ├── train_30156.jpg
│ ├── train_30169.jpg
│ ├── train_30178.jpg
│ ├── train_30180.jpg
│ ├── train_30183.jpg
│ ├── train_30185.jpg
│ ├── train_30190.jpg
│ └── train_30209.jpg
│ └── annotations
│ ├── val2017.json
│ ├── train2017.json
│ ├── annotations.json
│ └── annotations_washed.json
├── .idea
├── .gitignore
├── vcs.xml
├── misc.xml
├── inspectionProfiles
│ ├── profiles_settings.xml
│ └── Project_Default.xml
├── modules.xml
└── objectDetectionDatasets.iml
├── coco_visulize.py
├── voc_split_trainVal.py
├── voc_to_yoloV3.py
├── README.md
├── voc_to_yoloV5.py
├── make_voc.py
├── voc_to_coco_v2.py
├── generate_persudo_json.py
├── coco_split_trainVal.py
└── voc_to_coco_v1.py
/demo/voc/ImageSets/Main/test.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/demo/voc/ImageSets/Main/val.txt:
--------------------------------------------------------------------------------
1 | train_30190
2 | train_30180
3 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30178.txt:
--------------------------------------------------------------------------------
1 | 0 0.6072916666666667 0.24296875 0.78125 0.1796875
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30178.txt:
--------------------------------------------------------------------------------
1 | 0 0.6052083333333333 0.24140625000000002 0.78125 0.1796875
2 |
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30131.txt:
--------------------------------------------------------------------------------
1 | 0 0.7760416666666666 0.6414062500000001 0.39791666666666664 0.1421875
2 |
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30180.txt:
--------------------------------------------------------------------------------
1 | 2 0.5645833333333333 0.39453125 0.2916666666666667 0.38593750000000004
2 |
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30131.txt:
--------------------------------------------------------------------------------
1 | 0 0.778125 0.6429687500000001 0.3979166666666667 0.14218750000000002
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30180.txt:
--------------------------------------------------------------------------------
1 | 2 0.5666666666666667 0.39609375 0.2916666666666667 0.38593750000000004
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30185.txt:
--------------------------------------------------------------------------------
1 | 0 0.88125 0.24140625000000002 0.2333333333333334 0.31093750000000003
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30185.txt:
--------------------------------------------------------------------------------
1 | 0 0.8791666666666667 0.23984375000000002 0.23333333333333334 0.31093750000000003
2 |
--------------------------------------------------------------------------------
/demo/coco/images/train_29635.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_29635.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_29641.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_29641.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30090.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30090.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30092.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30092.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30101.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30101.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30116.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30116.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30123.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30123.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30126.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30126.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30131.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30131.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30138.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30138.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30147.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30147.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30156.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30156.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30169.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30169.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30178.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30178.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30180.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30180.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30183.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30183.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30185.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30185.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30190.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30190.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30202.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30202.jpg
--------------------------------------------------------------------------------
/demo/coco/images/train_30209.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/images/train_30209.jpg
--------------------------------------------------------------------------------
/demo/coco/val2017/train_30092.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/val2017/train_30092.jpg
--------------------------------------------------------------------------------
/demo/coco/val2017/train_30202.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/val2017/train_30202.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_29635.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_29635.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_29641.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_29641.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30090.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30090.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30101.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30101.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30116.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30116.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30123.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30123.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30126.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30126.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30131.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30131.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30138.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30138.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30147.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30147.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30156.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30156.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30169.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30169.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30178.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30178.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30180.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30180.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30183.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30183.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30185.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30185.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30190.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30190.jpg
--------------------------------------------------------------------------------
/demo/coco/train2017/train_30209.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/coco/train2017/train_30209.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_29635.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_29635.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_29641.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_29641.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30090.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30090.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30092.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30092.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30101.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30101.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30116.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30116.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30123.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30123.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30126.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30126.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30131.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30131.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30138.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30138.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30147.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30147.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30156.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30156.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30169.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30169.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30178.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30178.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30180.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30180.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30183.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30183.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30185.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30185.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30190.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30190.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30202.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30202.jpg
--------------------------------------------------------------------------------
/demo/voc/JPEGImages/train_30209.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DLLXW/objectDetectionDatasets/HEAD/demo/voc/JPEGImages/train_30209.jpg
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30101.txt:
--------------------------------------------------------------------------------
1 | 1 0.5729166666666666 0.35625 0.2791666666666667 0.40625
2 | 1 0.75 0.3609375 0.2916666666666667 0.421875
3 |
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30147.txt:
--------------------------------------------------------------------------------
1 | 1 0.4041666666666667 0.2609375 0.275 0.134375
2 | 1 0.196875 0.26640625 0.15208333333333332 0.13593750000000002
3 |
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30126.txt:
--------------------------------------------------------------------------------
1 | 1 0.81640625 0.184375 0.0890625 0.03958333333333333
2 | 1 0.79609375 0.29375 0.29531250000000003 0.09166666666666666
3 |
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30209.txt:
--------------------------------------------------------------------------------
1 | 1 0.3364583333333333 0.30078125 0.13125 0.3984375
2 | 1 0.7229166666666667 0.7796875000000001 0.15 0.053125000000000006
3 |
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_29635.txt:
--------------------------------------------------------------------------------
1 | 1 0.6520833333333333 0.21875 0.6666666666666666 0.19375
2 | 1 0.24270833333333333 0.26484375 0.15208333333333332 0.2265625
3 |
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30202.txt:
--------------------------------------------------------------------------------
1 | 1 0.31354166666666666 0.17109375000000002 0.6229166666666667 0.3171875
2 | 1 0.53125 0.44140625 0.1875 0.03281249999999997
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30169.txt:
--------------------------------------------------------------------------------
1 | 1 0.6229166666666667 0.2484375 0.7375 0.42812500000000003
2 | 1 0.4583333333333333 0.540625 0.9249999999999999 0.20625000000000002
3 |
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30092.txt:
--------------------------------------------------------------------------------
1 | 1 0.6375 0.16484375 0.2694444444444445 0.2484375
2 | 1 0.8694444444444445 0.3296875 0.22777777777777786 0.09687500000000004
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30147.txt:
--------------------------------------------------------------------------------
1 | 1 0.40625 0.2625 0.27499999999999997 0.13437500000000002
2 | 1 0.19895833333333335 0.26796875 0.15208333333333335 0.1359375
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30092.txt:
--------------------------------------------------------------------------------
1 | 1 0.6347222222222223 0.16328125000000002 0.26944444444444443 0.2484375
2 | 1 0.8666666666666667 0.328125 0.22777777777777777 0.096875
3 |
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30202.txt:
--------------------------------------------------------------------------------
1 | 1 0.31145833333333334 0.16953125000000002 0.6229166666666667 0.3171875
2 | 1 0.5291666666666667 0.43984375000000003 0.1875 0.0328125
3 |
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30169.txt:
--------------------------------------------------------------------------------
1 | 1 0.6270833333333333 0.2515625 0.7375 0.428125
2 | 1 0.46249999999999997 0.5437500000000001 0.9249999999999999 0.20625000000000004
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_29635.txt:
--------------------------------------------------------------------------------
1 | 1 0.6541666666666666 0.22031250000000002 0.6666666666666666 0.19375
2 | 1 0.24479166666666666 0.26640625 0.1520833333333333 0.2265625
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30209.txt:
--------------------------------------------------------------------------------
1 | 1 0.33854166666666663 0.30234375 0.13125000000000003 0.3984375
2 | 1 0.7250000000000001 0.78125 0.15000000000000002 0.05312499999999998
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30123.txt:
--------------------------------------------------------------------------------
1 | 1 0.5875 0.109375 0.5375 0.10312500000000001
2 | 1 0.0375 0.16875 0.07916666666666666 0.0625
3 | 0 0.584375 0.11015625000000001 0.53125 0.1015625
4 |
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30101.txt:
--------------------------------------------------------------------------------
1 | 1 0.5770833333333334 0.359375 0.2791666666666667 0.40625
2 | 1 0.7541666666666667 0.36406250000000007 0.29166666666666674 0.42187500000000006
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30126.txt:
--------------------------------------------------------------------------------
1 | 1 0.81796875 0.18645833333333334 0.08906250000000004 0.03958333333333333
2 | 1 0.79765625 0.29583333333333334 0.2953125 0.09166666666666667
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30123.txt:
--------------------------------------------------------------------------------
1 | 1 0.5895833333333333 0.11093750000000001 0.5375 0.103125
2 | 1 0.03958333333333333 0.1703125 0.07916666666666666 0.0625
3 | 0 0.5864583333333333 0.11171875 0.53125 0.1015625
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30138.txt:
--------------------------------------------------------------------------------
1 | 1 0.7354166666666666 0.3375 0.5166666666666666 0.178125
2 | 1 0.73125 0.48750000000000004 0.5291666666666667 0.09062500000000001
3 | 1 0.21666666666666667 0.484375 0.43333333333333335 0.08125
4 |
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30190.txt:
--------------------------------------------------------------------------------
1 | 1 0.640625 0.265625 0.7156250000000001 0.41874999999999996
2 | 1 0.328125 0.75 0.08437500000000003 0.3041666666666667
3 | 1 0.08203125 0.7427083333333333 0.09843750000000001 0.19791666666666663
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30190.txt:
--------------------------------------------------------------------------------
1 | 1 0.6390625000000001 0.2635416666666667 0.7156250000000001 0.41875
2 | 1 0.32656250000000003 0.7479166666666667 0.084375 0.30416666666666664
3 | 1 0.08046875 0.740625 0.09843750000000001 0.19791666666666666
4 |
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30156.txt:
--------------------------------------------------------------------------------
1 | 0 0.74609375 0.1451388888888889 0.171875 0.04583333333333334
2 | 0 0.38007812500000004 0.11041666666666668 0.057031250000000006 0.08194444444444444
3 | 0 0.337890625 0.13402777777777777 0.03359375 0.05694444444444444
4 |
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30138.txt:
--------------------------------------------------------------------------------
1 | 1 0.7375 0.33906250000000004 0.5166666666666666 0.17812500000000003
2 | 1 0.7333333333333334 0.48906250000000007 0.5291666666666667 0.09062500000000001
3 | 1 0.21875 0.4859375 0.43333333333333335 0.08125000000000004
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30156.txt:
--------------------------------------------------------------------------------
1 | 0 0.7468750000000001 0.14652777777777778 0.171875 0.04583333333333334
2 | 0 0.380859375 0.11180555555555556 0.05703125000000003 0.08194444444444446
3 | 0 0.338671875 0.13541666666666669 0.03359374999999998 0.056944444444444436
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30183.txt:
--------------------------------------------------------------------------------
1 | 1 0.4197916666666667 0.340625 0.22291666666666665 0.16562500000000002
2 | 1 0.25104166666666666 0.45390625000000007 0.05208333333333334 0.08281250000000001
3 | 1 0.26458333333333334 0.3046875 0.06666666666666668 0.07500000000000001
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30183.txt:
--------------------------------------------------------------------------------
1 | 1 0.41770833333333335 0.33906250000000004 0.22291666666666665 0.16562500000000002
2 | 1 0.24895833333333334 0.45234375000000004 0.052083333333333336 0.08281250000000001
3 | 1 0.2625 0.30312500000000003 0.06666666666666667 0.07500000000000001
4 |
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30116.txt:
--------------------------------------------------------------------------------
1 | 0 0.18645833333333334 0.178125 0.2604166666666667 0.225
2 | 0 0.3885416666666667 0.1296875 0.06875 0.084375
3 | 0 0.38125 0.23203125000000002 0.14583333333333334 0.1921875
4 | 0 0.4708333333333333 0.24375000000000002 0.041666666666666664 0.1875
5 |
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_29641.txt:
--------------------------------------------------------------------------------
1 | 0 0.8520833333333333 0.32421875 0.2625 0.035937500000000004
2 | 0 0.22083333333333333 0.38906250000000003 0.225 0.03125
3 | 1 0.64375 0.51796875 0.11666666666666667 0.1328125
4 | 1 0.5302083333333333 0.5140625 0.08541666666666667 0.09062500000000001
5 |
--------------------------------------------------------------------------------
/demo/voc/worktxt/train_30090.txt:
--------------------------------------------------------------------------------
1 | 1 0.471875 0.40468750000000003 0.18541666666666667 0.33437500000000003
2 | 1 0.3614583333333333 0.40859375000000003 0.07291666666666667 0.3328125
3 | 2 0.4739583333333333 0.40390625 0.18125 0.33906250000000004
4 | 2 0.36041666666666666 0.40703125 0.075 0.33906250000000004
5 |
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_29641.txt:
--------------------------------------------------------------------------------
1 | 0 0.8541666666666666 0.32578125 0.26249999999999996 0.035937499999999956
2 | 0 0.22291666666666665 0.390625 0.22499999999999998 0.03125
3 | 1 0.6458333333333333 0.51953125 0.11666666666666659 0.1328125
4 | 1 0.5322916666666666 0.515625 0.08541666666666664 0.09062499999999996
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30090.txt:
--------------------------------------------------------------------------------
1 | 1 0.4739583333333333 0.40625 0.18541666666666667 0.33437500000000003
2 | 1 0.36354166666666665 0.41015625 0.07291666666666669 0.33281249999999996
3 | 2 0.4760416666666667 0.40546875000000004 0.18124999999999997 0.33906250000000004
4 | 2 0.36250000000000004 0.40859375 0.07500000000000001 0.3390625
--------------------------------------------------------------------------------
/demo/yolov3/custom/labels/train_30116.txt:
--------------------------------------------------------------------------------
1 | 0 0.18854166666666666 0.1796875 0.26041666666666663 0.22499999999999998
2 | 0 0.390625 0.13125 0.06874999999999998 0.08437500000000002
3 | 0 0.3833333333333333 0.23359375000000002 0.14583333333333331 0.1921875
4 | 0 0.47291666666666665 0.24531250000000004 0.04166666666666663 0.18750000000000003
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo/voc/ImageSets/Main/train.txt:
--------------------------------------------------------------------------------
1 | train_29641
2 | train_30183
3 | train_30092
4 | train_30116
5 | train_30202
6 | train_30156
7 | train_30090
8 | train_30178
9 | train_30131
10 | train_30147
11 | train_30209
12 | train_30169
13 | train_30185
14 | train_30101
15 | train_30123
16 | train_30126
17 | train_30138
18 | train_29635
19 |
--------------------------------------------------------------------------------
/demo/voc/ImageSets/Main/trainval.txt:
--------------------------------------------------------------------------------
1 | train_29641
2 | train_30190
3 | train_30183
4 | train_30092
5 | train_30116
6 | train_30202
7 | train_30156
8 | train_30090
9 | train_30178
10 | train_30131
11 | train_30147
12 | train_30209
13 | train_30169
14 | train_30185
15 | train_30180
16 | train_30101
17 | train_30123
18 | train_30126
19 | train_30138
20 | train_29635
21 |
--------------------------------------------------------------------------------
/.idea/objectDetectionDatasets.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30131.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30131.jpg
4 | ./savePicture/train_30131.jpg
5 |
6 | Unknown
7 |
8 |
9 | 480
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30178.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30178.jpg
4 | ./savePicture/train_30178.jpg
5 |
6 | Unknown
7 |
8 |
9 | 480
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30180.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30180.jpg
4 | ./savePicture/train_30180.jpg
5 |
6 | Unknown
7 |
8 |
9 | 480
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30185.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30185.jpg
4 | ./savePicture/train_30185.jpg
5 |
6 | Unknown
7 |
8 |
9 | 480
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
--------------------------------------------------------------------------------
/coco_visulize.py:
--------------------------------------------------------------------------------
1 | import os
2 | import cv2
3 |
4 | from pycocotools.coco import COCO
5 |
6 | json_file = '/home/trojanjet/baidu_qyl/tianma/detect/mmdetection/data/coco/annotations/instances_val2017.json'
7 | dataset_dir = '/home/trojanjet/baidu_qyl/tianma/detect/mmdetection/data/coco/val2017/'
8 | coco = COCO(json_file)
9 | imgIds = coco.getImgIds() #
10 | for i in range(len(imgIds)):
11 | img = coco.loadImgs(imgIds[i])[0]
12 | image = cv2.imread(dataset_dir + img['file_name'])
13 | annIds = coco.getAnnIds(imgIds=img['id'])
14 | annos = coco.loadAnns(annIds)
15 | for ann in annos:
16 | bbox = ann['bbox']
17 | x, y, w, h = bbox
18 | anno_image = cv2.rectangle(image, (int(x), int(y)), (int(x + w), int(y + h)), (0, 255, 255), 2)
19 | cv2.imwrite('demo.jpg', anno_image)
20 | break
21 |
22 |
--------------------------------------------------------------------------------
/demo/coco/annotations/val2017.json:
--------------------------------------------------------------------------------
1 | {"images": [{"file_name": "train_30092.jpg", "height": 640, "width": 360, "id": 5}, {"file_name": "train_30202.jpg", "height": 640, "width": 480, "id": 7}], "annotations": [{"segmentation": [181, 26, 279, 26, 279, 186, 181, 186], "area": 15680, "iscrowd": 0, "image_id": 5, "bbox": [181, 26, 98, 160], "category_id": 2, "id": 0, "ignore": 0}, {"segmentation": [272, 180, 355, 180, 355, 243, 272, 243], "area": 5229, "iscrowd": 0, "image_id": 5, "bbox": [272, 180, 83, 63], "category_id": 2, "id": 1, "ignore": 0}, {"segmentation": [1, 8, 301, 8, 301, 212, 1, 212], "area": 61200, "iscrowd": 0, "image_id": 7, "bbox": [1, 8, 300, 204], "category_id": 2, "id": 2, "ignore": 0}, {"segmentation": [210, 272, 301, 272, 301, 294, 210, 294], "area": 2002, "iscrowd": 0, "image_id": 7, "bbox": [210, 272, 91, 22], "category_id": 2, "id": 3, "ignore": 0}], "categories": [{"name": "window_shielding", "id": 1}, {"name": "multi_signs", "id": 2}, {"name": "non_traffic_sign", "id": 3}]}
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_29635.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_29635.jpg
4 | ./savePicture/train_29635.jpg
5 |
6 | Unknown
7 |
8 |
9 | 480
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
40 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30092.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30092.jpg
4 | ./savePicture/train_30092.jpg
5 |
6 | Unknown
7 |
8 |
9 | 360
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
40 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30101.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30101.jpg
4 | ./savePicture/train_30101.jpg
5 |
6 | Unknown
7 |
8 |
9 | 240
10 | 320
11 | 3
12 |
13 | 0
14 |
27 |
40 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30126.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30126.jpg
4 | ./savePicture/train_30126.jpg
5 |
6 | Unknown
7 |
8 |
9 | 640
10 | 480
11 | 3
12 |
13 | 0
14 |
27 |
40 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30147.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30147.jpg
4 | ./savePicture/train_30147.jpg
5 |
6 | Unknown
7 |
8 |
9 | 480
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
40 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30169.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30169.jpg
4 | ./savePicture/train_30169.jpg
5 |
6 | Unknown
7 |
8 |
9 | 240
10 | 320
11 | 3
12 |
13 | 0
14 |
27 |
40 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30202.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30202.jpg
4 | ./savePicture/train_30202.jpg
5 |
6 | Unknown
7 |
8 |
9 | 480
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
40 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30209.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30209.jpg
4 | ./savePicture/train_30209.jpg
5 |
6 | Unknown
7 |
8 |
9 | 480
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
40 |
--------------------------------------------------------------------------------
/voc_split_trainVal.py:
--------------------------------------------------------------------------------
1 | import os
2 | import random
3 | import sys
4 |
5 |
6 | root_path = 'demo/voc'
7 |
8 | xmlfilepath = root_path + '/Annotations'
9 |
10 | txtsavepath = root_path + '/ImageSets/Main'
11 |
12 |
13 | if not os.path.exists(txtsavepath):
14 | os.makedirs(txtsavepath)
15 |
16 | trainval_percent = 1
17 | train_percent = 0.9
18 | total_xml = os.listdir(xmlfilepath)
19 | num = len(total_xml)
20 | list = range(num)
21 | tv = int(num * trainval_percent)
22 | tr = int(tv * train_percent)
23 | trainval = random.sample(list, tv)
24 | train = random.sample(trainval, tr)
25 |
26 | print("train and val size:", tv)
27 | print("train size:", tr)
28 |
29 | ftrainval = open(txtsavepath + '/trainval.txt', 'w')
30 | ftest = open(txtsavepath + '/test.txt', 'w')
31 | ftrain = open(txtsavepath + '/train.txt', 'w')
32 | fval = open(txtsavepath + '/val.txt', 'w')
33 |
34 | for i in list:
35 | name = total_xml[i][:-4] + '\n'
36 | if i in trainval:
37 | ftrainval.write(name)
38 | if i in train:
39 | ftrain.write(name)
40 | else:
41 | fval.write(name)
42 | else:
43 | ftest.write(name)
44 |
45 | ftrainval.close()
46 | ftrain.close()
47 | fval.close()
48 | ftest.close()
49 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30123.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30123.jpg
4 | ./savePicture/train_30123.jpg
5 |
6 | Unknown
7 |
8 |
9 | 480
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
40 |
53 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30138.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30138.jpg
4 | ./savePicture/train_30138.jpg
5 |
6 | Unknown
7 |
8 |
9 | 480
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
40 |
53 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30183.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30183.jpg
4 | ./savePicture/train_30183.jpg
5 |
6 | Unknown
7 |
8 |
9 | 480
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
40 |
53 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30190.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30190.jpg
4 | ./savePicture/train_30190.jpg
5 |
6 | Unknown
7 |
8 |
9 | 640
10 | 480
11 | 3
12 |
13 | 0
14 |
27 |
40 |
53 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30156.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30156.jpg
4 | ./savePicture/train_30156.jpg
5 |
6 | Unknown
7 |
8 |
9 | 1280
10 | 720
11 | 3
12 |
13 | 0
14 |
27 |
40 |
53 |
--------------------------------------------------------------------------------
/demo/yolov3/custom/trainval.txt:
--------------------------------------------------------------------------------
1 | demo/voc/JPEGImages/train_29641.jpg
2 | demo/voc/JPEGImages/train_30190.jpg
3 | demo/voc/JPEGImages/train_30183.jpg
4 | demo/voc/JPEGImages/train_30092.jpg
5 | demo/voc/JPEGImages/train_30116.jpg
6 | demo/voc/JPEGImages/train_30202.jpg
7 | demo/voc/JPEGImages/train_30156.jpg
8 | demo/voc/JPEGImages/train_30090.jpg
9 | demo/voc/JPEGImages/train_30178.jpg
10 | demo/voc/JPEGImages/train_30131.jpg
11 | demo/voc/JPEGImages/train_30147.jpg
12 | demo/voc/JPEGImages/train_30209.jpg
13 | demo/voc/JPEGImages/train_30169.jpg
14 | demo/voc/JPEGImages/train_30185.jpg
15 | demo/voc/JPEGImages/train_30180.jpg
16 | demo/voc/JPEGImages/train_30101.jpg
17 | demo/voc/JPEGImages/train_30123.jpg
18 | demo/voc/JPEGImages/train_30126.jpg
19 | demo/voc/JPEGImages/train_30138.jpg
20 | demo/voc/JPEGImages/train_29635.jpg
21 | demo/voc/JPEGImages/train_29641.jpg
22 | demo/voc/JPEGImages/train_30190.jpg
23 | demo/voc/JPEGImages/train_30183.jpg
24 | demo/voc/JPEGImages/train_30092.jpg
25 | demo/voc/JPEGImages/train_30116.jpg
26 | demo/voc/JPEGImages/train_30202.jpg
27 | demo/voc/JPEGImages/train_30156.jpg
28 | demo/voc/JPEGImages/train_30090.jpg
29 | demo/voc/JPEGImages/train_30178.jpg
30 | demo/voc/JPEGImages/train_30131.jpg
31 | demo/voc/JPEGImages/train_30147.jpg
32 | demo/voc/JPEGImages/train_30209.jpg
33 | demo/voc/JPEGImages/train_30169.jpg
34 | demo/voc/JPEGImages/train_30185.jpg
35 | demo/voc/JPEGImages/train_30180.jpg
36 | demo/voc/JPEGImages/train_30101.jpg
37 | demo/voc/JPEGImages/train_30123.jpg
38 | demo/voc/JPEGImages/train_30126.jpg
39 | demo/voc/JPEGImages/train_30138.jpg
40 | demo/voc/JPEGImages/train_29635.jpg
41 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_29641.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_29641.jpg
4 | ./savePicture/train_29641.jpg
5 |
6 | Unknown
7 |
8 |
9 | 480
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
40 |
53 |
66 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30090.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30090.jpg
4 | ./savePicture/train_30090.jpg
5 |
6 | Unknown
7 |
8 |
9 | 480
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
40 |
53 |
66 |
--------------------------------------------------------------------------------
/demo/voc/Annotations/train_30116.xml:
--------------------------------------------------------------------------------
1 |
2 | down
3 | train_30116.jpg
4 | ./savePicture/train_30116.jpg
5 |
6 | Unknown
7 |
8 |
9 | 480
10 | 640
11 | 3
12 |
13 | 0
14 |
27 |
40 |
53 |
66 |
--------------------------------------------------------------------------------
/voc_to_yoloV3.py:
--------------------------------------------------------------------------------
1 | import xml.etree.ElementTree as ET
2 | import os
3 | import cv2
4 | classes = ['window_shielding', 'multi_signs', 'non_traffic_sign']
5 |
6 | def convert_annotation(image_id):
7 | in_file = open('demo/voc/Annotations/%s.xml' % image_id)
8 |
9 | if not os.path.exists('demo/yolov3/custom/labels/'):
10 | os.makedirs('demo/yolov3/custom/labels/')
11 | out_file_img = open('demo/yolov3/custom/trainval.txt', 'a') # 生成txt格式文件
12 |
13 | out_file_label = open('demo/yolov3/custom/labels/%s.txt' % image_id,'a') # 生成txt格式文件
14 |
15 | tree = ET.parse(in_file)
16 | root = tree.getroot()
17 | size = root.find('size')
18 | voc_img_dir='demo/voc/JPEGImages/{}.jpg'.format(image_id)
19 | out_file_img.write(voc_img_dir)
20 | out_file_img.write("\n")
21 | img=cv2.imread(voc_img_dir)
22 | dh = 1. / img.shape[0]
23 | dw = 1. / img.shape[1]
24 | cnt=len(root.findall('object'))
25 | if cnt==0:
26 | print('nulll null null.....')
27 | print(image_id)
28 | cc=0
29 | for obj in root.iter('object'):
30 | cc+=1
31 | cls = obj.find('name').text
32 | if cls not in classes:
33 | continue
34 | cls_id = classes.index(cls)
35 | xmlbox = obj.find('bndbox')
36 | if dw*float(xmlbox.find('xmin').text)<0. or dw*float(xmlbox.find('xmax').text)<0. or dh*float(xmlbox.find('ymin').text)<0. or dh*float(xmlbox.find('ymax').text)<0.:
37 | print(image_id)
38 |
39 | b = (dw*float(xmlbox.find('xmin').text), dw*float(xmlbox.find('xmax').text), dh*float(xmlbox.find('ymin').text),
40 | dh*float(xmlbox.find('ymax').text))
41 | out_file_label.write(str(cls_id)+ " " + str((b[0]+b[1])/2) + " " + str((b[2]+b[3])/2) + " " + str(b[1]-b[0]) + " " + str(b[3]-b[2]))
42 | if cc - v1版本实现了转换的同时进行训练/验证的分割
9 | > - v2版本包含了segemetation字段(当训练htc等需要分割的任务时候网络需要用到)
10 | ## convert_voc_to_yoloV5.py 和 convert_voc_to_yoloV3.py
11 | 两个脚本实现的功能几乎相同,灵活取用
12 | > - V5脚本实现将voc格式的数据转化为yoloV5需要的.txt标注文件,运行该脚本,会在voc/目录下生成
13 | worktxt/目录(yolo需要的格式).
14 | > - V3这个脚本除了生成.txt的标注(同上),还会生成一个trianval.txt的索引,以前的yolov3系列用的多一点
15 |
16 | ## coco_split_trainVal.py
17 | 该脚本实现coco格式的数据分割出训练集和验证集,同时里面还实现了一个去除背景图的方法(没有标注框的图),可以结合上面的
18 | voc_to_coco_v2.py使用.
19 |
20 | ## make_voc.py(其余各种格式转voc)
21 | 前面没有写coco转voc格式的脚本,make_voc.py就提供了一个制作voc格式数据的通用套路(核心代码).
22 | ```python
23 | `img = cv2.imread(image_path)
24 | height, width, depth = img.shape
25 | with codecs.open(anno_dir + imgId_frame_name[:-4] + '.xml', 'w', 'utf-8') as xml:
26 | xml.write('\n')
27 | xml.write('\t' + imgId_frame_name + '\n')
28 | xml.write('\t\n')
29 | xml.write('\t\t' + str(width) + '\n')
30 | xml.write('\t\t' + str(height) + '\n')
31 | xml.write('\t\t' + str(depth) + '\n')
32 | xml.write('\t\n')
33 | cnt = 0
34 | for bbox in bboxs:
35 | xmin, ymin, xmax, ymax = bbox
36 | class_name = 'obstacles'
37 | #
38 | xml.write('\t\n')
47 | cnt += 1
48 | assert cnt > 0
49 | xml.write('')`
50 | ```
51 |
--------------------------------------------------------------------------------
/voc_to_yoloV5.py:
--------------------------------------------------------------------------------
1 | '''
2 | 2020/6/15,标注文件转换xml转txt(vol to yolo)转完后需添加labels文件,即数字序号对应的标签名。
3 |
4 | '''
5 |
6 | import xml.etree.ElementTree as ET
7 | import pickle
8 | import os
9 | from os import listdir, getcwd
10 | from os.path import join
11 |
12 | classes = ['window_shielding', 'multi_signs', 'non_traffic_sign']
13 |
14 |
15 | def convert(size, box):
16 | dw = 1./(size[0])
17 | dh = 1./(size[1])
18 | x = (box[0] + box[1])/2.0 - 1
19 | y = (box[2] + box[3])/2.0 - 1
20 | w = box[1] - box[0]
21 | h = box[3] - box[2]
22 | x = x*dw
23 | w = w*dw
24 | y = y*dh
25 | h = h*dh
26 | if w>=1:
27 | w=0.99
28 | if h>=1:
29 | h=0.99
30 | return (x,y,w,h)
31 |
32 | def convert_annotation(rootpath,xmlname):
33 | xmlpath = rootpath + '/Annotations'
34 | xmlfile = os.path.join(xmlpath,xmlname)
35 | with open(xmlfile, "r", encoding='UTF-8') as in_file:
36 | txtname = xmlname[:-4]+'.txt'
37 | print(txtname)
38 | txtpath = rootpath + '/worktxt'#生成的.txt文件会被保存在worktxt目录下
39 | if not os.path.exists(txtpath):
40 | os.makedirs(txtpath)
41 | txtfile = os.path.join(txtpath,txtname)
42 | with open(txtfile, "w+" ,encoding='UTF-8') as out_file:
43 | tree=ET.parse(in_file)
44 | root = tree.getroot()
45 | size = root.find('size')
46 | w = int(size.find('width').text)
47 | h = int(size.find('height').text)
48 | out_file.truncate()
49 | for obj in root.iter('object'):
50 | difficult = obj.find('difficult').text
51 | cls = obj.find('name').text
52 | if cls not in classes or int(difficult)==1:
53 | continue
54 | cls_id = classes.index(cls)
55 | xmlbox = obj.find('bndbox')
56 | b = (float(xmlbox.find('xmin').text), float(xmlbox.find('xmax').text), float(xmlbox.find('ymin').text), float(xmlbox.find('ymax').text))
57 | bb = convert((w,h), b)
58 | out_file.write(str(cls_id) + " " + " ".join([str(a) for a in bb]) + '\n')
59 |
60 |
61 | if __name__ == "__main__":
62 | rootpath='demo/voc/'
63 | xmlpath=rootpath+'/Annotations'
64 | list=os.listdir(xmlpath)
65 | for i in range(0,len(list)) :
66 | path = os.path.join(xmlpath,list[i])
67 | if ('.xml' in path)or('.XML' in path):
68 | convert_annotation(rootpath,list[i])
69 | print('done', i)
70 | else:
71 | print('not xml file',i)
72 |
--------------------------------------------------------------------------------
/make_voc.py:
--------------------------------------------------------------------------------
1 | import os
2 | import xml
3 | import json
4 | import codecs
5 | import cv2
6 | import shutil
7 | from config import Config
8 |
9 | obstacles_classes = ['施工围挡', '路障', '锥桶', '告示牌1','告示牌2','施工痕迹','施工机械','工地正门']
10 | opt=Config()
11 | rawImgDir=opt.raw_data_dir
12 | rawLabelDir=opt.raw_json
13 | anno_dir='../demo/voc/annotations/'
14 | image_dir='../demo/voc/JPEGImages'
15 | if not os.path.exists(anno_dir):
16 | os.makedirs(anno_dir)
17 | if not os.path.exists(image_dir):
18 | os.makedirs(image_dir)
19 | with open(rawLabelDir) as f:
20 | d=json.load(f)
21 | #
22 | annos=d['annotations']
23 | for anno in annos:
24 | status=anno['status']
25 | frames=anno['frames']
26 | imgId = anno['id']
27 | if status==3:
28 | for frame in frames:
29 | if 'obstacles' not in frame:
30 | continue
31 | obstacles=frame['obstacles']
32 | bboxs=[item['bbox'] for item in obstacles]
33 | frame_name=frame['frame_name']
34 | imgId_frame_name=imgId+'_'+frame_name
35 | image_path=os.path.join(rawImgDir, imgId, frame_name)
36 | shutil.copy(os.path.join(rawImgDir, imgId, frame_name), os.path.join(image_dir, imgId_frame_name))
37 | img = cv2.imread(image_path)
38 | height, width, depth = img.shape
39 | with codecs.open(anno_dir + imgId_frame_name[:-4] + '.xml', 'w', 'utf-8') as xml:
40 | xml.write('\n')
41 | xml.write('\t' + imgId_frame_name + '\n')
42 | xml.write('\t\n')
43 | xml.write('\t\t' + str(width) + '\n')
44 | xml.write('\t\t' + str(height) + '\n')
45 | xml.write('\t\t' + str(depth) + '\n')
46 | xml.write('\t\n')
47 | cnt = 0
48 | for bbox in bboxs:
49 | xmin, ymin, xmax, ymax = bbox
50 | class_name = 'obstacles'
51 | #
52 | xml.write('\t\n')
61 | cnt += 1
62 | assert cnt > 0
63 | xml.write('')
64 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/voc_to_coco_v2.py:
--------------------------------------------------------------------------------
1 |
2 | import os.path as osp
3 | import xml.etree.ElementTree as ET
4 |
5 | import mmcv
6 | import os
7 |
8 | from glob import glob
9 | from tqdm import tqdm
10 | from PIL import Image
11 | def object_classes():#这里定义了自己的数据集的目标类别
12 | return ['window_shielding', 'multi_signs', 'non_traffic_sign']
13 | label_ids = {name: i + 1 for i, name in enumerate(object_classes())}
14 | print(label_ids)
15 |
16 | def get_segmentation(points):
17 |
18 | return [points[0], points[1], points[2] + points[0], points[1],
19 | points[2] + points[0], points[3] + points[1], points[0], points[3] + points[1]]
20 |
21 |
22 | def parse_xml(xml_path, img_id, anno_id):
23 | tree = ET.parse(xml_path)
24 | root = tree.getroot()
25 | annotation = []
26 | for obj in root.findall('object'):
27 | name = obj.find('name').text
28 | if name == 'xxx':#当要忽略某一个类别时
29 | continue
30 | category_id = label_ids[name]
31 | bnd_box = obj.find('bndbox')
32 | xmin = int(bnd_box.find('xmin').text)
33 | ymin = int(bnd_box.find('ymin').text)
34 | xmax = int(bnd_box.find('xmax').text)
35 | ymax = int(bnd_box.find('ymax').text)
36 | w = xmax - xmin + 1
37 | h = ymax - ymin + 1
38 | area = w*h
39 | segmentation = get_segmentation([xmin, ymin, w, h])
40 | annotation.append({
41 | "segmentation": segmentation,
42 | "area": area,
43 | "iscrowd": 0,
44 | "image_id": img_id,
45 | "bbox": [xmin, ymin, w, h],
46 | "category_id": category_id,
47 | "id": anno_id,
48 | "ignore": 0})
49 | anno_id += 1
50 | return annotation, anno_id
51 |
52 |
53 | def cvt_annotations(img_path, xml_path, out_file):
54 | images = []
55 | annotations = []
56 |
57 | # xml_paths = glob(xml_path + '/*.xml')
58 | img_id = 1
59 | anno_id = 1
60 | for img_path in tqdm(glob(img_path + '/*.jpg')):
61 | w, h = Image.open(img_path).size
62 | img_name = osp.basename(img_path)
63 | img = {"file_name": img_name, "height": int(h), "width": int(w), "id": img_id}
64 | images.append(img)
65 |
66 | xml_file_name = img_name.split('.')[0] + '.xml'
67 | xml_file_path = osp.join(xml_path, xml_file_name)
68 | annos, anno_id = parse_xml(xml_file_path, img_id, anno_id)
69 | annotations.extend(annos)
70 | img_id += 1
71 |
72 | categories = []
73 | for k,v in label_ids.items():
74 | categories.append({"name": k, "id": v})
75 | final_result = {"images": images, "annotations": annotations, "categories": categories}
76 | mmcv.dump(final_result, out_file)
77 | return annotations
78 |
79 |
80 | def main():
81 |
82 | xml_path = 'demo/voc/Annotations'
83 | img_path = 'demo/voc/JPEGImages'
84 | print('processing {} ...'.format("xml format annotations"))
85 | cvt_annotations(img_path, xml_path, 'demo/coco/annotations/annotations.json')
86 | print('Done!')
87 |
88 |
89 | if __name__ == '__main__':
90 | root_path='./demo'
91 | if not os.path.exists(os.path.join(root_path,'coco/annotations')):
92 | os.makedirs(os.path.join(root_path,'coco/annotations'))
93 | main()
94 |
--------------------------------------------------------------------------------
/generate_persudo_json.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding:utf-8 -*-
3 | import sys
4 | import os
5 | import codecs
6 | import cv2
7 | import json
8 | underwater_classes = ['holothurian', 'echinus', 'scallop', 'starfish']
9 | #!/usr/bin/env python
10 | # -*- coding: utf-8 -*-
11 | import os
12 | # 批量重命名文件
13 |
14 |
15 | def interpr_json():
16 | test_json_raw = json.load(open("../../data/train/annotations/testA.json", "r"))
17 | test_json = json.load(open("../../results/cas_r50.bbox.json" , "r"))
18 | img_dir='../../data/test-A-image'
19 | root = '../../data/persudo/'
20 | img = test_json_raw['images']
21 | images = []
22 | imgid2anno = {}
23 | imgid2name = {}
24 | for imageinfo in test_json_raw['images']:
25 | imgid = imageinfo['id']
26 | imgid2name[imgid] = imageinfo['file_name']
27 | for anno in test_json:
28 | img_id = anno['image_id']
29 | if img_id not in imgid2anno:
30 | imgid2anno[img_id] = []
31 | imgid2anno[img_id].append(anno)
32 | for imgid, annos in imgid2anno.items():
33 | image_name = imgid2name[imgid]
34 | image_id = image_name.split('.')[0]
35 | image_path = os.path.join(img_dir, image_id + '.jpg')
36 | img = cv2.imread(image_path)
37 | height, width ,depth= img.shape
38 | with codecs.open(root+ image_id + '_test.xml', 'w', 'utf-8') as xml:
39 | xml.write('\n')
40 | xml.write('\t' + image_id + '_test' + '\n')
41 | xml.write('\t\n')
42 | xml.write('\t\t' + str(width) + '\n')
43 | xml.write('\t\t' + str(height) + '\n')
44 | xml.write('\t\t' + str(depth) + '\n')
45 | xml.write('\t\n')
46 | cnt=0
47 | for anno in annos:
48 | xmin, ymin, w, h = anno['bbox']
49 | xmax = xmin + w
50 | ymax = ymin + h
51 | xmin = int(xmin)
52 | ymin = int(ymin)
53 | xmax = int(xmax)
54 | ymax = int(ymax)
55 | confidence = anno['score']
56 | class_id = int(anno['category_id'])
57 | class_name = underwater_classes[class_id - 1]
58 | image_name = imgid2name[imgid]
59 | image_id = image_name.split('.')[0]
60 | #
61 | if cnt==0:
62 | xml.write('\t\n')
71 | cnt+=1
72 | if confidence>0.4:
73 | cnt+=1
74 | xml.write('\t\n')
83 | assert cnt>0
84 | xml.write('')
85 |
86 | interpr_json()
87 |
--------------------------------------------------------------------------------
/coco_split_trainVal.py:
--------------------------------------------------------------------------------
1 | import json
2 | import os
3 | import shutil
4 | json_dir="demo/coco/annotations/annotations.json"
5 | with open(json_dir) as f:
6 | json_file = json.load(f)
7 | print('所有图片的数量:', len(json_file['images']))
8 | print('所有标注的数量:', len(json_file['annotations']))
9 |
10 |
11 | def get_key(images, image_id):
12 | for image in images:
13 | if image["id"] == image_id: # 根据anno的id反推图像的名称
14 | return image["file_name"]
15 |
16 | background=[]
17 | obj=[]
18 | # read box info for csv format
19 | annotations = json_file['annotations']
20 | images = json_file['images']
21 |
22 | all_images=[]
23 | for image in images:
24 | all_images.append(image["file_name"])
25 |
26 | for annotation in annotations:
27 | key = annotation["image_id"] # 图像的名字
28 | im_id=get_key(images,key)
29 | if im_id not in obj:
30 | obj.append(im_id)
31 |
32 | #value = annotation["bbox"] + annotation["category_id"]
33 |
34 | #删除背景图像
35 | print('原始图像数量:', len(images))
36 |
37 | print('有标注的图像数量:', len(obj))
38 |
39 | for img in images:
40 | if img["file_name"] not in obj:
41 | background.append(img)
42 |
43 | for i in background:
44 | images.remove(i)
45 | print('删除背景后的图像数量',len(images))#
46 | #根据obj筛选图片
47 | image_dir='demo/coco/images'
48 | #dst_dir='/home/limzero/clear_images'
49 | #for name in obj:
50 | #shutil.copy(os.path.join(image_dir,name),os.path.join(dst_dir,name))
51 |
52 | json_file['images']=images
53 | with open('demo/coco/annotations/annotations_washed.json', 'w') as f:
54 | json.dump(json_file, f)
55 |
56 | #分割训练集和验证集
57 | import random
58 | val = random.sample(obj, int(len(images)*0.1))
59 | train=[]
60 | for o in obj:
61 | if o not in val:
62 | train.append(o)
63 |
64 | #
65 | train_dir='demo/coco/train2017'
66 | val_dir='demo/coco/val2017'
67 | if not os.path.exists(train_dir):
68 | os.makedirs(train_dir)
69 | if not os.path.exists(val_dir):
70 | os.makedirs(val_dir)
71 | for v in val:
72 | shutil.copy(os.path.join(image_dir,v),os.path.join(val_dir,v))
73 | for t in train:
74 | shutil.copy(os.path.join(image_dir,t),os.path.join(train_dir,t))
75 |
76 |
77 | #annotations
78 |
79 | val_images=images[:]
80 | train_images=images[:]
81 | val_annotations=annotations[:]
82 | train_annotations=annotations[:]
83 |
84 | print('images:',len(images),'val:',len(val),'train',len(train))
85 | c=0
86 | for img in images:
87 | if img['file_name'] in train:
88 | c=c+1
89 | val_images.remove(img)
90 | else:
91 | train_images.remove(img)
92 | print('len(images):',len(images))
93 | print("c:",c)
94 | print('val_images:',len(val_images),'train_images:',len(train_images))
95 |
96 | def get_id(images,name):
97 | for image in images:
98 | if image['file_name']==name:
99 | return image['id']
100 | for t in train:
101 | id=get_id(images,t)
102 | for ann in annotations:
103 | if ann['image_id']==id:
104 | val_annotations.remove(ann)
105 | for v in val:
106 | id=get_id(images,v)
107 | for ann in annotations:
108 | if ann['image_id']==id:
109 | train_annotations.remove(ann)
110 | print('train_ann:',len(train_annotations),'val_ann:',len(val_annotations))
111 |
112 | json_train=json_file.copy()
113 | json_val=json_file.copy()
114 | json_train['images']=train_images
115 | json_train['annotations']=train_annotations
116 | json_val['images']=val_images
117 | json_val['annotations']=val_annotations
118 |
119 | #reindex
120 | for idx in range(len(json_train['annotations'])):
121 | json_train['annotations'][idx]['id'] = idx
122 |
123 | for idx in range(len(json_val['annotations'])):
124 | json_val['annotations'][idx]['id'] = idx
125 |
126 | #write in json file
127 | with open('demo/coco/annotations/train2017.json', 'w') as f:
128 | json.dump(json_train, f)
129 |
130 | with open('demo/coco/annotations/val2017.json', 'w') as f:
131 | json.dump(json_val, f)
132 |
133 |
134 |
--------------------------------------------------------------------------------
/voc_to_coco_v1.py:
--------------------------------------------------------------------------------
1 | # -*- coding=utf-8 -*-
2 | #!/usr/bin/python
3 |
4 | import sys
5 | import os
6 | import shutil
7 | import numpy as np
8 | import json
9 | import xml.etree.ElementTree as ET
10 | import mmcv
11 | # 检测框的ID起始值
12 | START_BOUNDING_BOX_ID = 1
13 | # 类别列表无必要预先创建,程序中会根据所有图像中包含的ID来创建并更新
14 | PRE_DEFINE_CATEGORIES = {}
15 | # If necessary, pre-define category and its id
16 | # PRE_DEFINE_CATEGORIES = {"aeroplane": 1, "bicycle": 2, "bird": 3, "boat": 4,
17 | # "bottle":5, "bus": 6, "car": 7, "cat": 8, "chair": 9,
18 | # "cow": 10, "diningtable": 11, "dog": 12, "horse": 13,
19 | # "motorbike": 14, "person": 15, "pottedplant": 16,
20 | # "sheep": 17, "sofa": 18, "train": 19, "tvmonitor": 20}
21 |
22 |
23 | def get(root, name):
24 | vars = root.findall(name)
25 | return vars
26 |
27 |
28 | def get_and_check(root, name, length):
29 | vars = root.findall(name)
30 | if len(vars) == 0:
31 | raise NotImplementedError('Can not find %s in %s.'%(name, root.tag))
32 | if length > 0 and len(vars) != length:
33 | raise NotImplementedError('The size of %s is supposed to be %d, but is %d.'%(name, length, len(vars)))
34 | if length == 1:
35 | vars = vars[0]
36 | return vars
37 |
38 |
39 |
40 | def convert(xml_list, xml_dir, json_file):
41 | '''
42 | :param xml_list: 需要转换的XML文件列表
43 | :param xml_dir: XML的存储文件夹
44 | :param json_file: 导出json文件的路径
45 | :return: None
46 | '''
47 | list_fp = xml_list
48 | image_id=1
49 | # 标注基本结构
50 | json_dict = {"images":[],
51 | "type": "instances",
52 | "annotations": [],
53 | "categories": []}
54 | categories = PRE_DEFINE_CATEGORIES
55 | bnd_id = START_BOUNDING_BOX_ID
56 | for line in list_fp:
57 | line = line.strip()
58 | print(" Processing {}".format(line))
59 | # 解析XML
60 | xml_f = os.path.join(xml_dir, line)
61 | tree = ET.parse(xml_f)
62 | root = tree.getroot()
63 | filename = root.find('filename').text
64 | # 取出图片名字
65 | image_id+=1
66 | size = get_and_check(root, 'size', 1)
67 | # 图片的基本信息
68 | width = int(get_and_check(size, 'width', 1).text)
69 | height = int(get_and_check(size, 'height', 1).text)
70 | image = {'file_name': filename,
71 | 'height': height,
72 | 'width': width,
73 | 'id':image_id}
74 | json_dict['images'].append(image)
75 | # 处理每个标注的检测框
76 | for obj in get(root, 'object'):
77 | # 取出检测框类别名称
78 | category = get_and_check(obj, 'name', 1).text
79 | # 更新类别ID字典
80 | if category not in categories:
81 | new_id = len(categories)
82 | categories[category] = new_id
83 | category_id = categories[category]
84 | bndbox = get_and_check(obj, 'bndbox', 1)
85 | xmin = int(get_and_check(bndbox, 'xmin', 1).text) - 1
86 | ymin = int(get_and_check(bndbox, 'ymin', 1).text) - 1
87 | xmax = int(get_and_check(bndbox, 'xmax', 1).text)
88 | ymax = int(get_and_check(bndbox, 'ymax', 1).text)
89 | assert(xmax > xmin)
90 | assert(ymax > ymin)
91 | o_width = abs(xmax - xmin)
92 | o_height = abs(ymax - ymin)
93 | annotation = dict()
94 | annotation['area'] = o_width*o_height
95 | annotation['iscrowd'] = 0
96 | annotation['image_id'] = image_id
97 | annotation['bbox'] = [xmin, ymin, o_width, o_height]
98 | annotation['category_id'] = category_id
99 | annotation['id'] = bnd_id
100 | annotation['ignore'] = 0
101 | # 设置分割数据,点的顺序为逆时针方向
102 | annotation['segmentation'] = [[xmin,ymin,xmin,ymax,xmax,ymax,xmax,ymin]]
103 |
104 | json_dict['annotations'].append(annotation)
105 | bnd_id = bnd_id + 1
106 |
107 | # 写入类别ID字典
108 | for cate, cid in categories.items():
109 | cat = {'supercategory': 'none', 'id': cid, 'name': cate}
110 | json_dict['categories'].append(cat)
111 | # 导出到json
112 | #mmcv.dump(json_dict, json_file)
113 | print(type(json_dict))
114 | json_data = json.dumps(json_dict)
115 | with open(json_file, 'w') as w:
116 | w.write(json_data)
117 |
118 |
119 | if __name__ == '__main__':
120 | root_path = './demo'
121 |
122 | if not os.path.exists(os.path.join(root_path,'coco/annotations')):
123 | os.makedirs(os.path.join(root_path,'coco/annotations'))
124 | if not os.path.exists(os.path.join(root_path, 'coco/train2014')):
125 | os.makedirs(os.path.join(root_path, 'coco/train2014'))
126 | if not os.path.exists(os.path.join(root_path, 'coco/val2014')):
127 | os.makedirs(os.path.join(root_path, 'coco/val2014'))
128 | xml_dir = os.path.join(root_path,'voc/Annotations') #已知的voc的标注
129 |
130 | xml_labels = os.listdir(xml_dir)
131 | np.random.shuffle(xml_labels)
132 | split_point = int(len(xml_labels)/10)
133 |
134 | # validation data
135 | xml_list = xml_labels[0:split_point]
136 | json_file = os.path.join(root_path,'coco/annotations/instances_val2014.json')
137 | convert(xml_list, xml_dir, json_file)
138 | for xml_file in xml_list:
139 | img_name = xml_file[:-4] + '.jpg'
140 | shutil.copy(os.path.join(root_path, 'voc/JPEGImages', img_name),
141 | os.path.join(root_path, 'coco/val2014', img_name))
142 | # train data
143 | xml_list = xml_labels[split_point:]
144 | json_file = os.path.join(root_path,'coco/annotations/instances_train2014.json')
145 | convert(xml_list, xml_dir, json_file)
146 | for xml_file in xml_list:
147 | img_name = xml_file[:-4] + '.jpg'
148 | shutil.copy(os.path.join(root_path, 'voc/JPEGImages', img_name),
149 | os.path.join(root_path, 'coco/train2014', img_name))
150 |
--------------------------------------------------------------------------------
/demo/coco/annotations/train2017.json:
--------------------------------------------------------------------------------
1 | {"images": [{"file_name": "train_30116.jpg", "height": 640, "width": 480, "id": 1}, {"file_name": "train_30147.jpg", "height": 640, "width": 480, "id": 2}, {"file_name": "train_30183.jpg", "height": 640, "width": 480, "id": 3}, {"file_name": "train_30156.jpg", "height": 720, "width": 1280, "id": 4}, {"file_name": "train_29641.jpg", "height": 640, "width": 480, "id": 6}, {"file_name": "train_30185.jpg", "height": 640, "width": 480, "id": 8}, {"file_name": "train_30190.jpg", "height": 480, "width": 640, "id": 9}, {"file_name": "train_30101.jpg", "height": 320, "width": 240, "id": 10}, {"file_name": "train_30090.jpg", "height": 640, "width": 480, "id": 11}, {"file_name": "train_30169.jpg", "height": 320, "width": 240, "id": 12}, {"file_name": "train_30209.jpg", "height": 640, "width": 480, "id": 13}, {"file_name": "train_29635.jpg", "height": 640, "width": 480, "id": 14}, {"file_name": "train_30138.jpg", "height": 640, "width": 480, "id": 15}, {"file_name": "train_30123.jpg", "height": 640, "width": 480, "id": 16}, {"file_name": "train_30131.jpg", "height": 640, "width": 480, "id": 17}, {"file_name": "train_30180.jpg", "height": 640, "width": 480, "id": 18}, {"file_name": "train_30126.jpg", "height": 480, "width": 640, "id": 19}, {"file_name": "train_30178.jpg", "height": 640, "width": 480, "id": 20}], "annotations": [{"segmentation": [28, 43, 154, 43, 154, 188, 28, 188], "area": 18270, "iscrowd": 0, "image_id": 1, "bbox": [28, 43, 126, 145], "category_id": 1, "id": 0, "ignore": 0}, {"segmentation": [171, 57, 205, 57, 205, 112, 171, 112], "area": 1870, "iscrowd": 0, "image_id": 1, "bbox": [171, 57, 34, 55], "category_id": 1, "id": 1, "ignore": 0}, {"segmentation": [149, 88, 220, 88, 220, 212, 149, 212], "area": 8804, "iscrowd": 0, "image_id": 1, "bbox": [149, 88, 71, 124], "category_id": 1, "id": 2, "ignore": 0}, {"segmentation": [217, 97, 238, 97, 238, 218, 217, 218], "area": 2541, "iscrowd": 0, "image_id": 1, "bbox": [217, 97, 21, 121], "category_id": 1, "id": 3, "ignore": 0}, {"segmentation": [129, 125, 262, 125, 262, 212, 129, 212], "area": 11571, "iscrowd": 0, "image_id": 2, "bbox": [129, 125, 133, 87], "category_id": 2, "id": 4, "ignore": 0}, {"segmentation": [59, 128, 133, 128, 133, 216, 59, 216], "area": 6512, "iscrowd": 0, "image_id": 2, "bbox": [59, 128, 74, 88], "category_id": 2, "id": 5, "ignore": 0}, {"segmentation": [148, 165, 256, 165, 256, 272, 148, 272], "area": 11556, "iscrowd": 0, "image_id": 3, "bbox": [148, 165, 108, 107], "category_id": 2, "id": 6, "ignore": 0}, {"segmentation": [108, 264, 134, 264, 134, 318, 108, 318], "area": 1404, "iscrowd": 0, "image_id": 3, "bbox": [108, 264, 26, 54], "category_id": 2, "id": 7, "ignore": 0}, {"segmentation": [111, 171, 144, 171, 144, 220, 111, 220], "area": 1617, "iscrowd": 0, "image_id": 3, "bbox": [111, 171, 33, 49], "category_id": 2, "id": 8, "ignore": 0}, {"segmentation": [846, 89, 1067, 89, 1067, 123, 846, 123], "area": 7514, "iscrowd": 0, "image_id": 4, "bbox": [846, 89, 221, 34], "category_id": 1, "id": 9, "ignore": 0}, {"segmentation": [451, 51, 525, 51, 525, 111, 451, 111], "area": 4440, "iscrowd": 0, "image_id": 4, "bbox": [451, 51, 74, 60], "category_id": 1, "id": 10, "ignore": 0}, {"segmentation": [412, 77, 456, 77, 456, 119, 412, 119], "area": 1848, "iscrowd": 0, "image_id": 4, "bbox": [412, 77, 44, 42], "category_id": 1, "id": 11, "ignore": 0}, {"segmentation": [347, 197, 474, 197, 474, 221, 347, 221], "area": 3048, "iscrowd": 0, "image_id": 6, "bbox": [347, 197, 127, 24], "category_id": 1, "id": 12, "ignore": 0}, {"segmentation": [53, 240, 162, 240, 162, 261, 53, 261], "area": 2289, "iscrowd": 0, "image_id": 6, "bbox": [53, 240, 109, 21], "category_id": 1, "id": 13, "ignore": 0}, {"segmentation": [282, 290, 339, 290, 339, 376, 282, 376], "area": 4902, "iscrowd": 0, "image_id": 6, "bbox": [282, 290, 57, 86], "category_id": 2, "id": 14, "ignore": 0}, {"segmentation": [235, 301, 277, 301, 277, 360, 235, 360], "area": 2478, "iscrowd": 0, "image_id": 6, "bbox": [235, 301, 42, 59], "category_id": 2, "id": 15, "ignore": 0}, {"segmentation": [367, 55, 480, 55, 480, 255, 367, 255], "area": 22600, "iscrowd": 0, "image_id": 8, "bbox": [367, 55, 113, 200], "category_id": 1, "id": 16, "ignore": 0}, {"segmentation": [181, 27, 640, 27, 640, 229, 181, 229], "area": 92718, "iscrowd": 0, "image_id": 9, "bbox": [181, 27, 459, 202], "category_id": 2, "id": 17, "ignore": 0}, {"segmentation": [183, 287, 238, 287, 238, 434, 183, 434], "area": 8085, "iscrowd": 0, "image_id": 9, "bbox": [183, 287, 55, 147], "category_id": 2, "id": 18, "ignore": 0}, {"segmentation": [21, 309, 85, 309, 85, 405, 21, 405], "area": 6144, "iscrowd": 0, "image_id": 9, "bbox": [21, 309, 64, 96], "category_id": 2, "id": 19, "ignore": 0}, {"segmentation": [105, 50, 173, 50, 173, 181, 105, 181], "area": 8908, "iscrowd": 0, "image_id": 10, "bbox": [105, 50, 68, 131], "category_id": 2, "id": 20, "ignore": 0}, {"segmentation": [146, 49, 217, 49, 217, 185, 146, 185], "area": 9656, "iscrowd": 0, "image_id": 10, "bbox": [146, 49, 71, 136], "category_id": 2, "id": 21, "ignore": 0}, {"segmentation": [183, 153, 273, 153, 273, 368, 183, 368], "area": 19350, "iscrowd": 0, "image_id": 11, "bbox": [183, 153, 90, 215], "category_id": 2, "id": 22, "ignore": 0}, {"segmentation": [157, 156, 193, 156, 193, 370, 157, 370], "area": 7704, "iscrowd": 0, "image_id": 11, "bbox": [157, 156, 36, 214], "category_id": 2, "id": 23, "ignore": 0}, {"segmentation": [185, 151, 273, 151, 273, 369, 185, 369], "area": 19184, "iscrowd": 0, "image_id": 11, "bbox": [185, 151, 88, 218], "category_id": 3, "id": 24, "ignore": 0}, {"segmentation": [156, 153, 193, 153, 193, 371, 156, 371], "area": 8066, "iscrowd": 0, "image_id": 11, "bbox": [156, 153, 37, 218], "category_id": 3, "id": 25, "ignore": 0}, {"segmentation": [62, 12, 240, 12, 240, 150, 62, 150], "area": 24564, "iscrowd": 0, "image_id": 12, "bbox": [62, 12, 178, 138], "category_id": 2, "id": 26, "ignore": 0}, {"segmentation": [0, 141, 223, 141, 223, 208, 0, 208], "area": 14941, "iscrowd": 0, "image_id": 12, "bbox": [0, 141, 223, 67], "category_id": 2, "id": 27, "ignore": 0}, {"segmentation": [131, 66, 195, 66, 195, 322, 131, 322], "area": 16384, "iscrowd": 0, "image_id": 13, "bbox": [131, 66, 64, 256], "category_id": 2, "id": 28, "ignore": 0}, {"segmentation": [312, 483, 385, 483, 385, 518, 312, 518], "area": 2555, "iscrowd": 0, "image_id": 13, "bbox": [312, 483, 73, 35], "category_id": 2, "id": 29, "ignore": 0}, {"segmentation": [154, 79, 475, 79, 475, 204, 154, 204], "area": 40125, "iscrowd": 0, "image_id": 14, "bbox": [154, 79, 321, 125], "category_id": 2, "id": 30, "ignore": 0}, {"segmentation": [81, 98, 155, 98, 155, 244, 81, 244], "area": 10804, "iscrowd": 0, "image_id": 14, "bbox": [81, 98, 74, 146], "category_id": 2, "id": 31, "ignore": 0}, {"segmentation": [230, 160, 479, 160, 479, 275, 230, 275], "area": 28635, "iscrowd": 0, "image_id": 15, "bbox": [230, 160, 249, 115], "category_id": 2, "id": 32, "ignore": 0}, {"segmentation": [225, 284, 480, 284, 480, 343, 225, 343], "area": 15045, "iscrowd": 0, "image_id": 15, "bbox": [225, 284, 255, 59], "category_id": 2, "id": 33, "ignore": 0}, {"segmentation": [1, 285, 210, 285, 210, 338, 1, 338], "area": 11077, "iscrowd": 0, "image_id": 15, "bbox": [1, 285, 209, 53], "category_id": 2, "id": 34, "ignore": 0}, {"segmentation": [154, 38, 413, 38, 413, 105, 154, 105], "area": 17353, "iscrowd": 0, "image_id": 16, "bbox": [154, 38, 259, 67], "category_id": 2, "id": 35, "ignore": 0}, {"segmentation": [0, 89, 39, 89, 39, 130, 0, 130], "area": 1599, "iscrowd": 0, "image_id": 16, "bbox": [0, 89, 39, 41], "category_id": 2, "id": 36, "ignore": 0}, {"segmentation": [154, 39, 410, 39, 410, 105, 154, 105], "area": 16896, "iscrowd": 0, "image_id": 16, "bbox": [154, 39, 256, 66], "category_id": 1, "id": 37, "ignore": 0}, {"segmentation": [278, 366, 470, 366, 470, 458, 278, 458], "area": 17664, "iscrowd": 0, "image_id": 17, "bbox": [278, 366, 192, 92], "category_id": 1, "id": 38, "ignore": 0}, {"segmentation": [202, 130, 343, 130, 343, 378, 202, 378], "area": 34968, "iscrowd": 0, "image_id": 18, "bbox": [202, 130, 141, 248], "category_id": 3, "id": 39, "ignore": 0}, {"segmentation": [495, 80, 553, 80, 553, 100, 495, 100], "area": 1160, "iscrowd": 0, "image_id": 19, "bbox": [495, 80, 58, 20], "category_id": 2, "id": 40, "ignore": 0}, {"segmentation": [416, 120, 606, 120, 606, 165, 416, 165], "area": 8550, "iscrowd": 0, "image_id": 19, "bbox": [416, 120, 190, 45], "category_id": 2, "id": 41, "ignore": 0}, {"segmentation": [104, 98, 480, 98, 480, 214, 104, 214], "area": 43616, "iscrowd": 0, "image_id": 20, "bbox": [104, 98, 376, 116], "category_id": 1, "id": 42, "ignore": 0}], "categories": [{"name": "window_shielding", "id": 1}, {"name": "multi_signs", "id": 2}, {"name": "non_traffic_sign", "id": 3}]}
--------------------------------------------------------------------------------
/demo/coco/annotations/annotations.json:
--------------------------------------------------------------------------------
1 | {"images": [{"file_name": "train_30116.jpg", "height": 640, "width": 480, "id": 1}, {"file_name": "train_30147.jpg", "height": 640, "width": 480, "id": 2}, {"file_name": "train_30183.jpg", "height": 640, "width": 480, "id": 3}, {"file_name": "train_30156.jpg", "height": 720, "width": 1280, "id": 4}, {"file_name": "train_30092.jpg", "height": 640, "width": 360, "id": 5}, {"file_name": "train_29641.jpg", "height": 640, "width": 480, "id": 6}, {"file_name": "train_30202.jpg", "height": 640, "width": 480, "id": 7}, {"file_name": "train_30185.jpg", "height": 640, "width": 480, "id": 8}, {"file_name": "train_30190.jpg", "height": 480, "width": 640, "id": 9}, {"file_name": "train_30101.jpg", "height": 320, "width": 240, "id": 10}, {"file_name": "train_30090.jpg", "height": 640, "width": 480, "id": 11}, {"file_name": "train_30169.jpg", "height": 320, "width": 240, "id": 12}, {"file_name": "train_30209.jpg", "height": 640, "width": 480, "id": 13}, {"file_name": "train_29635.jpg", "height": 640, "width": 480, "id": 14}, {"file_name": "train_30138.jpg", "height": 640, "width": 480, "id": 15}, {"file_name": "train_30123.jpg", "height": 640, "width": 480, "id": 16}, {"file_name": "train_30131.jpg", "height": 640, "width": 480, "id": 17}, {"file_name": "train_30180.jpg", "height": 640, "width": 480, "id": 18}, {"file_name": "train_30126.jpg", "height": 480, "width": 640, "id": 19}, {"file_name": "train_30178.jpg", "height": 640, "width": 480, "id": 20}], "annotations": [{"segmentation": [28, 43, 154, 43, 154, 188, 28, 188], "area": 18270, "iscrowd": 0, "image_id": 1, "bbox": [28, 43, 126, 145], "category_id": 1, "id": 1, "ignore": 0}, {"segmentation": [171, 57, 205, 57, 205, 112, 171, 112], "area": 1870, "iscrowd": 0, "image_id": 1, "bbox": [171, 57, 34, 55], "category_id": 1, "id": 2, "ignore": 0}, {"segmentation": [149, 88, 220, 88, 220, 212, 149, 212], "area": 8804, "iscrowd": 0, "image_id": 1, "bbox": [149, 88, 71, 124], "category_id": 1, "id": 3, "ignore": 0}, {"segmentation": [217, 97, 238, 97, 238, 218, 217, 218], "area": 2541, "iscrowd": 0, "image_id": 1, "bbox": [217, 97, 21, 121], "category_id": 1, "id": 4, "ignore": 0}, {"segmentation": [129, 125, 262, 125, 262, 212, 129, 212], "area": 11571, "iscrowd": 0, "image_id": 2, "bbox": [129, 125, 133, 87], "category_id": 2, "id": 5, "ignore": 0}, {"segmentation": [59, 128, 133, 128, 133, 216, 59, 216], "area": 6512, "iscrowd": 0, "image_id": 2, "bbox": [59, 128, 74, 88], "category_id": 2, "id": 6, "ignore": 0}, {"segmentation": [148, 165, 256, 165, 256, 272, 148, 272], "area": 11556, "iscrowd": 0, "image_id": 3, "bbox": [148, 165, 108, 107], "category_id": 2, "id": 7, "ignore": 0}, {"segmentation": [108, 264, 134, 264, 134, 318, 108, 318], "area": 1404, "iscrowd": 0, "image_id": 3, "bbox": [108, 264, 26, 54], "category_id": 2, "id": 8, "ignore": 0}, {"segmentation": [111, 171, 144, 171, 144, 220, 111, 220], "area": 1617, "iscrowd": 0, "image_id": 3, "bbox": [111, 171, 33, 49], "category_id": 2, "id": 9, "ignore": 0}, {"segmentation": [846, 89, 1067, 89, 1067, 123, 846, 123], "area": 7514, "iscrowd": 0, "image_id": 4, "bbox": [846, 89, 221, 34], "category_id": 1, "id": 10, "ignore": 0}, {"segmentation": [451, 51, 525, 51, 525, 111, 451, 111], "area": 4440, "iscrowd": 0, "image_id": 4, "bbox": [451, 51, 74, 60], "category_id": 1, "id": 11, "ignore": 0}, {"segmentation": [412, 77, 456, 77, 456, 119, 412, 119], "area": 1848, "iscrowd": 0, "image_id": 4, "bbox": [412, 77, 44, 42], "category_id": 1, "id": 12, "ignore": 0}, {"segmentation": [181, 26, 279, 26, 279, 186, 181, 186], "area": 15680, "iscrowd": 0, "image_id": 5, "bbox": [181, 26, 98, 160], "category_id": 2, "id": 13, "ignore": 0}, {"segmentation": [272, 180, 355, 180, 355, 243, 272, 243], "area": 5229, "iscrowd": 0, "image_id": 5, "bbox": [272, 180, 83, 63], "category_id": 2, "id": 14, "ignore": 0}, {"segmentation": [347, 197, 474, 197, 474, 221, 347, 221], "area": 3048, "iscrowd": 0, "image_id": 6, "bbox": [347, 197, 127, 24], "category_id": 1, "id": 15, "ignore": 0}, {"segmentation": [53, 240, 162, 240, 162, 261, 53, 261], "area": 2289, "iscrowd": 0, "image_id": 6, "bbox": [53, 240, 109, 21], "category_id": 1, "id": 16, "ignore": 0}, {"segmentation": [282, 290, 339, 290, 339, 376, 282, 376], "area": 4902, "iscrowd": 0, "image_id": 6, "bbox": [282, 290, 57, 86], "category_id": 2, "id": 17, "ignore": 0}, {"segmentation": [235, 301, 277, 301, 277, 360, 235, 360], "area": 2478, "iscrowd": 0, "image_id": 6, "bbox": [235, 301, 42, 59], "category_id": 2, "id": 18, "ignore": 0}, {"segmentation": [1, 8, 301, 8, 301, 212, 1, 212], "area": 61200, "iscrowd": 0, "image_id": 7, "bbox": [1, 8, 300, 204], "category_id": 2, "id": 19, "ignore": 0}, {"segmentation": [210, 272, 301, 272, 301, 294, 210, 294], "area": 2002, "iscrowd": 0, "image_id": 7, "bbox": [210, 272, 91, 22], "category_id": 2, "id": 20, "ignore": 0}, {"segmentation": [367, 55, 480, 55, 480, 255, 367, 255], "area": 22600, "iscrowd": 0, "image_id": 8, "bbox": [367, 55, 113, 200], "category_id": 1, "id": 21, "ignore": 0}, {"segmentation": [181, 27, 640, 27, 640, 229, 181, 229], "area": 92718, "iscrowd": 0, "image_id": 9, "bbox": [181, 27, 459, 202], "category_id": 2, "id": 22, "ignore": 0}, {"segmentation": [183, 287, 238, 287, 238, 434, 183, 434], "area": 8085, "iscrowd": 0, "image_id": 9, "bbox": [183, 287, 55, 147], "category_id": 2, "id": 23, "ignore": 0}, {"segmentation": [21, 309, 85, 309, 85, 405, 21, 405], "area": 6144, "iscrowd": 0, "image_id": 9, "bbox": [21, 309, 64, 96], "category_id": 2, "id": 24, "ignore": 0}, {"segmentation": [105, 50, 173, 50, 173, 181, 105, 181], "area": 8908, "iscrowd": 0, "image_id": 10, "bbox": [105, 50, 68, 131], "category_id": 2, "id": 25, "ignore": 0}, {"segmentation": [146, 49, 217, 49, 217, 185, 146, 185], "area": 9656, "iscrowd": 0, "image_id": 10, "bbox": [146, 49, 71, 136], "category_id": 2, "id": 26, "ignore": 0}, {"segmentation": [183, 153, 273, 153, 273, 368, 183, 368], "area": 19350, "iscrowd": 0, "image_id": 11, "bbox": [183, 153, 90, 215], "category_id": 2, "id": 27, "ignore": 0}, {"segmentation": [157, 156, 193, 156, 193, 370, 157, 370], "area": 7704, "iscrowd": 0, "image_id": 11, "bbox": [157, 156, 36, 214], "category_id": 2, "id": 28, "ignore": 0}, {"segmentation": [185, 151, 273, 151, 273, 369, 185, 369], "area": 19184, "iscrowd": 0, "image_id": 11, "bbox": [185, 151, 88, 218], "category_id": 3, "id": 29, "ignore": 0}, {"segmentation": [156, 153, 193, 153, 193, 371, 156, 371], "area": 8066, "iscrowd": 0, "image_id": 11, "bbox": [156, 153, 37, 218], "category_id": 3, "id": 30, "ignore": 0}, {"segmentation": [62, 12, 240, 12, 240, 150, 62, 150], "area": 24564, "iscrowd": 0, "image_id": 12, "bbox": [62, 12, 178, 138], "category_id": 2, "id": 31, "ignore": 0}, {"segmentation": [0, 141, 223, 141, 223, 208, 0, 208], "area": 14941, "iscrowd": 0, "image_id": 12, "bbox": [0, 141, 223, 67], "category_id": 2, "id": 32, "ignore": 0}, {"segmentation": [131, 66, 195, 66, 195, 322, 131, 322], "area": 16384, "iscrowd": 0, "image_id": 13, "bbox": [131, 66, 64, 256], "category_id": 2, "id": 33, "ignore": 0}, {"segmentation": [312, 483, 385, 483, 385, 518, 312, 518], "area": 2555, "iscrowd": 0, "image_id": 13, "bbox": [312, 483, 73, 35], "category_id": 2, "id": 34, "ignore": 0}, {"segmentation": [154, 79, 475, 79, 475, 204, 154, 204], "area": 40125, "iscrowd": 0, "image_id": 14, "bbox": [154, 79, 321, 125], "category_id": 2, "id": 35, "ignore": 0}, {"segmentation": [81, 98, 155, 98, 155, 244, 81, 244], "area": 10804, "iscrowd": 0, "image_id": 14, "bbox": [81, 98, 74, 146], "category_id": 2, "id": 36, "ignore": 0}, {"segmentation": [230, 160, 479, 160, 479, 275, 230, 275], "area": 28635, "iscrowd": 0, "image_id": 15, "bbox": [230, 160, 249, 115], "category_id": 2, "id": 37, "ignore": 0}, {"segmentation": [225, 284, 480, 284, 480, 343, 225, 343], "area": 15045, "iscrowd": 0, "image_id": 15, "bbox": [225, 284, 255, 59], "category_id": 2, "id": 38, "ignore": 0}, {"segmentation": [1, 285, 210, 285, 210, 338, 1, 338], "area": 11077, "iscrowd": 0, "image_id": 15, "bbox": [1, 285, 209, 53], "category_id": 2, "id": 39, "ignore": 0}, {"segmentation": [154, 38, 413, 38, 413, 105, 154, 105], "area": 17353, "iscrowd": 0, "image_id": 16, "bbox": [154, 38, 259, 67], "category_id": 2, "id": 40, "ignore": 0}, {"segmentation": [0, 89, 39, 89, 39, 130, 0, 130], "area": 1599, "iscrowd": 0, "image_id": 16, "bbox": [0, 89, 39, 41], "category_id": 2, "id": 41, "ignore": 0}, {"segmentation": [154, 39, 410, 39, 410, 105, 154, 105], "area": 16896, "iscrowd": 0, "image_id": 16, "bbox": [154, 39, 256, 66], "category_id": 1, "id": 42, "ignore": 0}, {"segmentation": [278, 366, 470, 366, 470, 458, 278, 458], "area": 17664, "iscrowd": 0, "image_id": 17, "bbox": [278, 366, 192, 92], "category_id": 1, "id": 43, "ignore": 0}, {"segmentation": [202, 130, 343, 130, 343, 378, 202, 378], "area": 34968, "iscrowd": 0, "image_id": 18, "bbox": [202, 130, 141, 248], "category_id": 3, "id": 44, "ignore": 0}, {"segmentation": [495, 80, 553, 80, 553, 100, 495, 100], "area": 1160, "iscrowd": 0, "image_id": 19, "bbox": [495, 80, 58, 20], "category_id": 2, "id": 45, "ignore": 0}, {"segmentation": [416, 120, 606, 120, 606, 165, 416, 165], "area": 8550, "iscrowd": 0, "image_id": 19, "bbox": [416, 120, 190, 45], "category_id": 2, "id": 46, "ignore": 0}, {"segmentation": [104, 98, 480, 98, 480, 214, 104, 214], "area": 43616, "iscrowd": 0, "image_id": 20, "bbox": [104, 98, 376, 116], "category_id": 1, "id": 47, "ignore": 0}], "categories": [{"name": "window_shielding", "id": 1}, {"name": "multi_signs", "id": 2}, {"name": "non_traffic_sign", "id": 3}]}
--------------------------------------------------------------------------------
/demo/coco/annotations/annotations_washed.json:
--------------------------------------------------------------------------------
1 | {"images": [{"file_name": "train_30116.jpg", "height": 640, "width": 480, "id": 1}, {"file_name": "train_30147.jpg", "height": 640, "width": 480, "id": 2}, {"file_name": "train_30183.jpg", "height": 640, "width": 480, "id": 3}, {"file_name": "train_30156.jpg", "height": 720, "width": 1280, "id": 4}, {"file_name": "train_30092.jpg", "height": 640, "width": 360, "id": 5}, {"file_name": "train_29641.jpg", "height": 640, "width": 480, "id": 6}, {"file_name": "train_30202.jpg", "height": 640, "width": 480, "id": 7}, {"file_name": "train_30185.jpg", "height": 640, "width": 480, "id": 8}, {"file_name": "train_30190.jpg", "height": 480, "width": 640, "id": 9}, {"file_name": "train_30101.jpg", "height": 320, "width": 240, "id": 10}, {"file_name": "train_30090.jpg", "height": 640, "width": 480, "id": 11}, {"file_name": "train_30169.jpg", "height": 320, "width": 240, "id": 12}, {"file_name": "train_30209.jpg", "height": 640, "width": 480, "id": 13}, {"file_name": "train_29635.jpg", "height": 640, "width": 480, "id": 14}, {"file_name": "train_30138.jpg", "height": 640, "width": 480, "id": 15}, {"file_name": "train_30123.jpg", "height": 640, "width": 480, "id": 16}, {"file_name": "train_30131.jpg", "height": 640, "width": 480, "id": 17}, {"file_name": "train_30180.jpg", "height": 640, "width": 480, "id": 18}, {"file_name": "train_30126.jpg", "height": 480, "width": 640, "id": 19}, {"file_name": "train_30178.jpg", "height": 640, "width": 480, "id": 20}], "annotations": [{"segmentation": [28, 43, 154, 43, 154, 188, 28, 188], "area": 18270, "iscrowd": 0, "image_id": 1, "bbox": [28, 43, 126, 145], "category_id": 1, "id": 1, "ignore": 0}, {"segmentation": [171, 57, 205, 57, 205, 112, 171, 112], "area": 1870, "iscrowd": 0, "image_id": 1, "bbox": [171, 57, 34, 55], "category_id": 1, "id": 2, "ignore": 0}, {"segmentation": [149, 88, 220, 88, 220, 212, 149, 212], "area": 8804, "iscrowd": 0, "image_id": 1, "bbox": [149, 88, 71, 124], "category_id": 1, "id": 3, "ignore": 0}, {"segmentation": [217, 97, 238, 97, 238, 218, 217, 218], "area": 2541, "iscrowd": 0, "image_id": 1, "bbox": [217, 97, 21, 121], "category_id": 1, "id": 4, "ignore": 0}, {"segmentation": [129, 125, 262, 125, 262, 212, 129, 212], "area": 11571, "iscrowd": 0, "image_id": 2, "bbox": [129, 125, 133, 87], "category_id": 2, "id": 5, "ignore": 0}, {"segmentation": [59, 128, 133, 128, 133, 216, 59, 216], "area": 6512, "iscrowd": 0, "image_id": 2, "bbox": [59, 128, 74, 88], "category_id": 2, "id": 6, "ignore": 0}, {"segmentation": [148, 165, 256, 165, 256, 272, 148, 272], "area": 11556, "iscrowd": 0, "image_id": 3, "bbox": [148, 165, 108, 107], "category_id": 2, "id": 7, "ignore": 0}, {"segmentation": [108, 264, 134, 264, 134, 318, 108, 318], "area": 1404, "iscrowd": 0, "image_id": 3, "bbox": [108, 264, 26, 54], "category_id": 2, "id": 8, "ignore": 0}, {"segmentation": [111, 171, 144, 171, 144, 220, 111, 220], "area": 1617, "iscrowd": 0, "image_id": 3, "bbox": [111, 171, 33, 49], "category_id": 2, "id": 9, "ignore": 0}, {"segmentation": [846, 89, 1067, 89, 1067, 123, 846, 123], "area": 7514, "iscrowd": 0, "image_id": 4, "bbox": [846, 89, 221, 34], "category_id": 1, "id": 10, "ignore": 0}, {"segmentation": [451, 51, 525, 51, 525, 111, 451, 111], "area": 4440, "iscrowd": 0, "image_id": 4, "bbox": [451, 51, 74, 60], "category_id": 1, "id": 11, "ignore": 0}, {"segmentation": [412, 77, 456, 77, 456, 119, 412, 119], "area": 1848, "iscrowd": 0, "image_id": 4, "bbox": [412, 77, 44, 42], "category_id": 1, "id": 12, "ignore": 0}, {"segmentation": [181, 26, 279, 26, 279, 186, 181, 186], "area": 15680, "iscrowd": 0, "image_id": 5, "bbox": [181, 26, 98, 160], "category_id": 2, "id": 13, "ignore": 0}, {"segmentation": [272, 180, 355, 180, 355, 243, 272, 243], "area": 5229, "iscrowd": 0, "image_id": 5, "bbox": [272, 180, 83, 63], "category_id": 2, "id": 14, "ignore": 0}, {"segmentation": [347, 197, 474, 197, 474, 221, 347, 221], "area": 3048, "iscrowd": 0, "image_id": 6, "bbox": [347, 197, 127, 24], "category_id": 1, "id": 15, "ignore": 0}, {"segmentation": [53, 240, 162, 240, 162, 261, 53, 261], "area": 2289, "iscrowd": 0, "image_id": 6, "bbox": [53, 240, 109, 21], "category_id": 1, "id": 16, "ignore": 0}, {"segmentation": [282, 290, 339, 290, 339, 376, 282, 376], "area": 4902, "iscrowd": 0, "image_id": 6, "bbox": [282, 290, 57, 86], "category_id": 2, "id": 17, "ignore": 0}, {"segmentation": [235, 301, 277, 301, 277, 360, 235, 360], "area": 2478, "iscrowd": 0, "image_id": 6, "bbox": [235, 301, 42, 59], "category_id": 2, "id": 18, "ignore": 0}, {"segmentation": [1, 8, 301, 8, 301, 212, 1, 212], "area": 61200, "iscrowd": 0, "image_id": 7, "bbox": [1, 8, 300, 204], "category_id": 2, "id": 19, "ignore": 0}, {"segmentation": [210, 272, 301, 272, 301, 294, 210, 294], "area": 2002, "iscrowd": 0, "image_id": 7, "bbox": [210, 272, 91, 22], "category_id": 2, "id": 20, "ignore": 0}, {"segmentation": [367, 55, 480, 55, 480, 255, 367, 255], "area": 22600, "iscrowd": 0, "image_id": 8, "bbox": [367, 55, 113, 200], "category_id": 1, "id": 21, "ignore": 0}, {"segmentation": [181, 27, 640, 27, 640, 229, 181, 229], "area": 92718, "iscrowd": 0, "image_id": 9, "bbox": [181, 27, 459, 202], "category_id": 2, "id": 22, "ignore": 0}, {"segmentation": [183, 287, 238, 287, 238, 434, 183, 434], "area": 8085, "iscrowd": 0, "image_id": 9, "bbox": [183, 287, 55, 147], "category_id": 2, "id": 23, "ignore": 0}, {"segmentation": [21, 309, 85, 309, 85, 405, 21, 405], "area": 6144, "iscrowd": 0, "image_id": 9, "bbox": [21, 309, 64, 96], "category_id": 2, "id": 24, "ignore": 0}, {"segmentation": [105, 50, 173, 50, 173, 181, 105, 181], "area": 8908, "iscrowd": 0, "image_id": 10, "bbox": [105, 50, 68, 131], "category_id": 2, "id": 25, "ignore": 0}, {"segmentation": [146, 49, 217, 49, 217, 185, 146, 185], "area": 9656, "iscrowd": 0, "image_id": 10, "bbox": [146, 49, 71, 136], "category_id": 2, "id": 26, "ignore": 0}, {"segmentation": [183, 153, 273, 153, 273, 368, 183, 368], "area": 19350, "iscrowd": 0, "image_id": 11, "bbox": [183, 153, 90, 215], "category_id": 2, "id": 27, "ignore": 0}, {"segmentation": [157, 156, 193, 156, 193, 370, 157, 370], "area": 7704, "iscrowd": 0, "image_id": 11, "bbox": [157, 156, 36, 214], "category_id": 2, "id": 28, "ignore": 0}, {"segmentation": [185, 151, 273, 151, 273, 369, 185, 369], "area": 19184, "iscrowd": 0, "image_id": 11, "bbox": [185, 151, 88, 218], "category_id": 3, "id": 29, "ignore": 0}, {"segmentation": [156, 153, 193, 153, 193, 371, 156, 371], "area": 8066, "iscrowd": 0, "image_id": 11, "bbox": [156, 153, 37, 218], "category_id": 3, "id": 30, "ignore": 0}, {"segmentation": [62, 12, 240, 12, 240, 150, 62, 150], "area": 24564, "iscrowd": 0, "image_id": 12, "bbox": [62, 12, 178, 138], "category_id": 2, "id": 31, "ignore": 0}, {"segmentation": [0, 141, 223, 141, 223, 208, 0, 208], "area": 14941, "iscrowd": 0, "image_id": 12, "bbox": [0, 141, 223, 67], "category_id": 2, "id": 32, "ignore": 0}, {"segmentation": [131, 66, 195, 66, 195, 322, 131, 322], "area": 16384, "iscrowd": 0, "image_id": 13, "bbox": [131, 66, 64, 256], "category_id": 2, "id": 33, "ignore": 0}, {"segmentation": [312, 483, 385, 483, 385, 518, 312, 518], "area": 2555, "iscrowd": 0, "image_id": 13, "bbox": [312, 483, 73, 35], "category_id": 2, "id": 34, "ignore": 0}, {"segmentation": [154, 79, 475, 79, 475, 204, 154, 204], "area": 40125, "iscrowd": 0, "image_id": 14, "bbox": [154, 79, 321, 125], "category_id": 2, "id": 35, "ignore": 0}, {"segmentation": [81, 98, 155, 98, 155, 244, 81, 244], "area": 10804, "iscrowd": 0, "image_id": 14, "bbox": [81, 98, 74, 146], "category_id": 2, "id": 36, "ignore": 0}, {"segmentation": [230, 160, 479, 160, 479, 275, 230, 275], "area": 28635, "iscrowd": 0, "image_id": 15, "bbox": [230, 160, 249, 115], "category_id": 2, "id": 37, "ignore": 0}, {"segmentation": [225, 284, 480, 284, 480, 343, 225, 343], "area": 15045, "iscrowd": 0, "image_id": 15, "bbox": [225, 284, 255, 59], "category_id": 2, "id": 38, "ignore": 0}, {"segmentation": [1, 285, 210, 285, 210, 338, 1, 338], "area": 11077, "iscrowd": 0, "image_id": 15, "bbox": [1, 285, 209, 53], "category_id": 2, "id": 39, "ignore": 0}, {"segmentation": [154, 38, 413, 38, 413, 105, 154, 105], "area": 17353, "iscrowd": 0, "image_id": 16, "bbox": [154, 38, 259, 67], "category_id": 2, "id": 40, "ignore": 0}, {"segmentation": [0, 89, 39, 89, 39, 130, 0, 130], "area": 1599, "iscrowd": 0, "image_id": 16, "bbox": [0, 89, 39, 41], "category_id": 2, "id": 41, "ignore": 0}, {"segmentation": [154, 39, 410, 39, 410, 105, 154, 105], "area": 16896, "iscrowd": 0, "image_id": 16, "bbox": [154, 39, 256, 66], "category_id": 1, "id": 42, "ignore": 0}, {"segmentation": [278, 366, 470, 366, 470, 458, 278, 458], "area": 17664, "iscrowd": 0, "image_id": 17, "bbox": [278, 366, 192, 92], "category_id": 1, "id": 43, "ignore": 0}, {"segmentation": [202, 130, 343, 130, 343, 378, 202, 378], "area": 34968, "iscrowd": 0, "image_id": 18, "bbox": [202, 130, 141, 248], "category_id": 3, "id": 44, "ignore": 0}, {"segmentation": [495, 80, 553, 80, 553, 100, 495, 100], "area": 1160, "iscrowd": 0, "image_id": 19, "bbox": [495, 80, 58, 20], "category_id": 2, "id": 45, "ignore": 0}, {"segmentation": [416, 120, 606, 120, 606, 165, 416, 165], "area": 8550, "iscrowd": 0, "image_id": 19, "bbox": [416, 120, 190, 45], "category_id": 2, "id": 46, "ignore": 0}, {"segmentation": [104, 98, 480, 98, 480, 214, 104, 214], "area": 43616, "iscrowd": 0, "image_id": 20, "bbox": [104, 98, 376, 116], "category_id": 1, "id": 47, "ignore": 0}], "categories": [{"name": "window_shielding", "id": 1}, {"name": "multi_signs", "id": 2}, {"name": "non_traffic_sign", "id": 3}]}
--------------------------------------------------------------------------------