├── README.md
├── calc_map.py
├── data
└── Annotations
│ ├── test100001.xml
│ ├── test100002.xml
│ ├── test100004.xml
│ ├── test100005.xml
│ ├── test100006.xml
│ ├── test100007.xml
│ ├── test100008.xml
│ ├── test100009.xml
│ ├── test100011.xml
│ ├── test100012.xml
│ ├── test100013.xml
│ ├── test100014.xml
│ ├── test100015.xml
│ ├── test100016.xml
│ ├── test100019.xml
│ ├── test100020.xml
│ ├── test100022.xml
│ ├── test100023.xml
│ ├── test100024.xml
│ ├── test100025.xml
│ ├── test100026.xml
│ ├── test100027.xml
│ ├── test100028.xml
│ ├── test100029.xml
│ ├── test100030.xml
│ ├── test100031.xml
│ ├── test100032.xml
│ ├── test100033.xml
│ ├── test100034.xml
│ ├── test100035.xml
│ ├── test100036.xml
│ ├── test100037.xml
│ ├── test100038.xml
│ ├── test100039.xml
│ ├── test100040.xml
│ ├── test100041.xml
│ ├── test100042.xml
│ ├── test100043.xml
│ ├── test100044.xml
│ ├── test100045.xml
│ ├── test100046.xml
│ ├── test100048.xml
│ ├── test100049.xml
│ ├── test100050.xml
│ ├── test100051.xml
│ ├── test100052.xml
│ ├── test100053.xml
│ ├── test100054.xml
│ ├── test100055.xml
│ ├── test100057.xml
│ ├── test100058.xml
│ ├── test100059.xml
│ ├── test100060.xml
│ ├── test100061.xml
│ ├── test100062.xml
│ ├── test100063.xml
│ ├── test100064.xml
│ ├── test100066.xml
│ ├── test100067.xml
│ ├── test100068.xml
│ ├── test100069.xml
│ ├── test100070.xml
│ ├── test100071.xml
│ ├── test100072.xml
│ ├── test100073.xml
│ ├── test100074.xml
│ ├── test100075.xml
│ ├── test100077.xml
│ ├── test100078.xml
│ ├── test100079.xml
│ ├── test100080.xml
│ ├── test100081.xml
│ ├── test100082.xml
│ ├── test100083.xml
│ ├── test100084.xml
│ ├── test100085.xml
│ ├── test100086.xml
│ ├── test100088.xml
│ ├── test100089.xml
│ ├── test100090.xml
│ ├── test100091.xml
│ ├── test100092.xml
│ ├── test100093.xml
│ ├── test100094.xml
│ ├── test100097.xml
│ ├── test100098.xml
│ ├── test100099.xml
│ └── test100100.xml
├── res.json
├── res.txt
└── voc_eval.py
/README.md:
--------------------------------------------------------------------------------
1 | ## 该工具用来评价目标检测模型的性能,主要计算mAP,检出率,漏检率;
2 | ## 需要准备的文件
3 | (1) 在dada/Annotations/ 文件夹里面存放标注数据,标注格式跟Pacal VOC相同
4 | (2)res.json, 检测的结果。
5 | ## res.json格式说明
6 | {
7 | "class_name1":[
8 | [img_name, score, x1, y1, x2, x2]
9 | [img_name, score, x1, y1, x2, x2]
10 | [img_name, score, x1, y1, x2, x2]
11 | ...
12 | ],
13 | "class_name2":[类别2],
14 | "class_name3":[类别3],
15 | ...
16 | }
17 | ## 运行python3 calc_map.py 测试结果保存在res.txt中。
18 | ### 详细说明请参考博客:https://blog.csdn.net/Guo_Python/article/details/113366278
19 |
--------------------------------------------------------------------------------
/calc_map.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 | import json
4 | import glob
5 | import numpy as np
6 | import xml.etree.ElementTree as ET
7 | from voc_eval import voc_eval
8 |
9 |
10 | def json_load(json_file):
11 | with open(json_file, "r") as f:
12 | data = json.load(f)
13 | return data
14 |
15 |
16 | def calc_map(class_names, annopath, json_res):
17 | datas = json_load(json_res)
18 | npos_list, recall_list, wujian_list, ap_list = [], [], [], []
19 | recall_num_list, wujian_num_list = [], []
20 | res = []
21 | for class_name in class_names:
22 | data = datas[class_name]
23 | npos, recall_num, wujian_num, recall, wujian, ap = voc_eval(data, annopath, class_name, ovthresh=0.5, use_07_metric=False)
24 | print('{}: recall {:.3f}, wujian {:.3f}, ap {:.3f}'.format(class_name, recall, wujian, ap))
25 | item = '{},{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f}\n'.format(class_name, npos, recall_num, wujian_num, recall, wujian, ap)
26 | #print('{}: ap {}'.format(class_name, ap))
27 | ap_list.append(ap)
28 | npos_list.append(npos)
29 | recall_list.append(recall)
30 | wujian_list.append(wujian)
31 | recall_num_list.append(recall_num)
32 | wujian_num_list.append(wujian_num)
33 |
34 | res.append(item)
35 | map_value = sum(ap_list)/len(ap_list)
36 | mean_call_rate = sum(recall_list)/len(recall_list)
37 | mean_wujian_rate = sum(wujian_list)/len(wujian_list)
38 | print('map:{:.3f}'.format(map_value))
39 | with open('res.txt', 'w') as f:
40 | line_head = "类别名称,类别数,检出数,误检数,检出率,误检率,AP\n"
41 | f.write(line_head)
42 | f.write(''.join(res))
43 | line = 'sum,{:.0f},{:.0f},{:.0f},{:.3f},{:.3f},{:.3f}\n'.format(sum(npos_list), sum(recall_num_list), sum(wujian_num_list), sum(recall_num_list)/(sum(npos_list)+1e-6), sum(wujian_num_list)/(sum(npos_list)+1e-6), map_value)
44 | print(line)
45 | f.write(line)
46 |
47 |
48 | def get_names(annopath, json_res):
49 | classes_name = []
50 | xmls = glob.glob(annopath + "*.xml")
51 | for xml in xmls:
52 | tree = ET.parse(xml)
53 | for obj in tree.findall('object'):
54 | name = obj.find("name").text
55 | if name not in classes_name:
56 | classes_name.append(name)
57 |
58 | datas = json_load(json_res)
59 | data_names = datas.keys()
60 | return [i for i in classes_name if i in data_names]
61 |
62 |
63 | if __name__ == "__main__":
64 | annopath = 'data/Annotations/'
65 | json_res = "res.json"
66 |
67 | classes = get_names(annopath, json_res) # Extracts class labels from xmls
68 | print(classes)
69 | print(len(classes))
70 | calc_map(classes, annopath, json_res)
71 |
72 |
--------------------------------------------------------------------------------
/data/Annotations/test100001.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100001
5 | /home/gp/dukto/Xray_match/data/test1/test100001.jpg
6 |
7 | Unknown
8 |
9 |
10 | 524
11 | 420
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100002.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100002
5 | /home/gp/dukto/Xray_match/data/test1/test100002.jpg
6 |
7 | Unknown
8 |
9 |
10 | 575
11 | 263
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
63 |
64 |
--------------------------------------------------------------------------------
/data/Annotations/test100004.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100004
5 | /home/gp/dukto/Xray_match/data/test1/test100004.jpg
6 |
7 | Unknown
8 |
9 |
10 | 804
11 | 556
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
52 |
--------------------------------------------------------------------------------
/data/Annotations/test100005.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100005
5 | /home/gp/dukto/Xray_match/data/test1/test100005.jpg
6 |
7 | Unknown
8 |
9 |
10 | 882
11 | 607
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
63 |
64 |
--------------------------------------------------------------------------------
/data/Annotations/test100006.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100006
5 | /home/gp/dukto/Xray_match/data/test1/test100006.jpg
6 |
7 | Unknown
8 |
9 |
10 | 558
11 | 317
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100007.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100007
5 | /home/gp/dukto/Xray_match/data/test1/test100007.jpg
6 |
7 | Unknown
8 |
9 |
10 | 584
11 | 447
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100008.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100008
5 | /home/gp/dukto/Xray_match/data/test1/test100008.jpg
6 |
7 | Unknown
8 |
9 |
10 | 638
11 | 621
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100009.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100009
5 | /home/gp/dukto/Xray_match/data/test1/test100009.jpg
6 |
7 | Unknown
8 |
9 |
10 | 614
11 | 333
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
52 |
--------------------------------------------------------------------------------
/data/Annotations/test100011.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100011
5 | /home/gp/dukto/Xray_match/data/test1/test100011.jpg
6 |
7 | Unknown
8 |
9 |
10 | 804
11 | 304
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100012.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100012
5 | /home/gp/dukto/Xray_match/data/test1/test100012.jpg
6 |
7 | Unknown
8 |
9 |
10 | 1184
11 | 700
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
63 |
64 |
--------------------------------------------------------------------------------
/data/Annotations/test100013.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100013
5 | /home/gp/dukto/Xray_match/data/test1/test100013.jpg
6 |
7 | Unknown
8 |
9 |
10 | 415
11 | 418
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100014.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100014
5 | /home/gp/dukto/Xray_match/data/test1/test100014.jpg
6 |
7 | Unknown
8 |
9 |
10 | 525
11 | 453
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100015.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100015
5 | /home/gp/dukto/Xray_match/data/test1/test100015.jpg
6 |
7 | Unknown
8 |
9 |
10 | 346
11 | 435
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
63 |
64 |
--------------------------------------------------------------------------------
/data/Annotations/test100016.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100016
5 | /home/gp/dukto/Xray_match/data/test1/test100016.jpg
6 |
7 | Unknown
8 |
9 |
10 | 804
11 | 452
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100019.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100019
5 | /home/gp/dukto/Xray_match/data/test1/test100019.jpg
6 |
7 | Unknown
8 |
9 |
10 | 272
11 | 447
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100020.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100020
5 | /home/gp/dukto/Xray_match/data/test1/test100020.jpg
6 |
7 | Unknown
8 |
9 |
10 | 807
11 | 560
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100022.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100022
5 | /home/gp/dukto/Xray_match/data/test1/test100022.jpg
6 |
7 | Unknown
8 |
9 |
10 | 247
11 | 230
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
52 |
--------------------------------------------------------------------------------
/data/Annotations/test100023.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100023
5 | /home/gp/dukto/Xray_match/data/test1/test100023.jpg
6 |
7 | Unknown
8 |
9 |
10 | 289
11 | 400
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100024.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100024
5 | /home/gp/dukto/Xray_match/data/test1/test100024.jpg
6 |
7 | Unknown
8 |
9 |
10 | 1100
11 | 700
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100025.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100025
5 | /home/gp/dukto/Xray_match/data/test1/test100025.jpg
6 |
7 | Unknown
8 |
9 |
10 | 468
11 | 268
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100026.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100026
5 | /home/gp/dukto/Xray_match/data/test1/test100026.jpg
6 |
7 | Unknown
8 |
9 |
10 | 628
11 | 352
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
63 |
75 |
76 |
--------------------------------------------------------------------------------
/data/Annotations/test100027.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100027
5 | /home/gp/dukto/Xray_match/data/test1/test100027.jpg
6 |
7 | Unknown
8 |
9 |
10 | 507
11 | 429
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100028.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100028
5 | /home/gp/dukto/Xray_match/data/test1/test100028.jpg
6 |
7 | Unknown
8 |
9 |
10 | 349
11 | 305
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100029.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100029
5 | /home/gp/dukto/Xray_match/data/test1/test100029.jpg
6 |
7 | Unknown
8 |
9 |
10 | 358
11 | 321
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100030.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100030
5 | /home/gp/dukto/Xray_match/data/test1/test100030.jpg
6 |
7 | Unknown
8 |
9 |
10 | 801
11 | 381
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
63 |
75 |
87 |
99 |
100 |
--------------------------------------------------------------------------------
/data/Annotations/test100031.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100031
5 | /home/gp/dukto/Xray_match/data/test1/test100031.jpg
6 |
7 | Unknown
8 |
9 |
10 | 858
11 | 700
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
52 |
--------------------------------------------------------------------------------
/data/Annotations/test100032.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100032
5 | /home/gp/dukto/Xray_match/data/test1/test100032.jpg
6 |
7 | Unknown
8 |
9 |
10 | 415
11 | 243
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100033.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100033
5 | /home/gp/dukto/Xray_match/data/test1/test100033.jpg
6 |
7 | Unknown
8 |
9 |
10 | 508
11 | 433
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100034.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100034
5 | /home/gp/dukto/Xray_match/data/test1/test100034.jpg
6 |
7 | Unknown
8 |
9 |
10 | 554
11 | 507
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100035.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100035
5 | /home/gp/dukto/Xray_match/data/test1/test100035.jpg
6 |
7 | Unknown
8 |
9 |
10 | 309
11 | 371
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100036.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100036
5 | /home/gp/dukto/Xray_match/data/test1/test100036.jpg
6 |
7 | Unknown
8 |
9 |
10 | 902
11 | 700
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
52 |
--------------------------------------------------------------------------------
/data/Annotations/test100037.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100037
5 | /home/gp/dukto/Xray_match/data/test1/test100037.jpg
6 |
7 | Unknown
8 |
9 |
10 | 1009
11 | 700
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
63 |
64 |
--------------------------------------------------------------------------------
/data/Annotations/test100038.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100038
5 | /home/gp/dukto/Xray_match/data/test1/test100038.jpg
6 |
7 | Unknown
8 |
9 |
10 | 212
11 | 187
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100039.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100039
5 | /home/gp/dukto/Xray_match/data/test1/test100039.jpg
6 |
7 | Unknown
8 |
9 |
10 | 1200
11 | 700
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100040.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100040
5 | /home/gp/dukto/Xray_match/data/test1/test100040.jpg
6 |
7 | Unknown
8 |
9 |
10 | 490
11 | 348
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
52 |
--------------------------------------------------------------------------------
/data/Annotations/test100041.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100041
5 | /home/gp/dukto/Xray_match/data/test1/test100041.jpg
6 |
7 | Unknown
8 |
9 |
10 | 679
11 | 416
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
52 |
--------------------------------------------------------------------------------
/data/Annotations/test100042.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100042
5 | /home/gp/dukto/Xray_match/data/test1/test100042.jpg
6 |
7 | Unknown
8 |
9 |
10 | 347
11 | 193
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100043.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100043
5 | /home/gp/dukto/Xray_match/data/test1/test100043.jpg
6 |
7 | Unknown
8 |
9 |
10 | 773
11 | 592
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100044.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100044
5 | /home/gp/dukto/Xray_match/data/test1/test100044.jpg
6 |
7 | Unknown
8 |
9 |
10 | 722
11 | 614
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100045.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100045
5 | /home/gp/dukto/Xray_match/data/test1/test100045.jpg
6 |
7 | Unknown
8 |
9 |
10 | 585
11 | 398
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100046.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100046
5 | /home/gp/dukto/Xray_match/data/test1/test100046.jpg
6 |
7 | Unknown
8 |
9 |
10 | 1033
11 | 700
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100048.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100048
5 | /home/gp/dukto/Xray_match/data/test1/test100048.jpg
6 |
7 | Unknown
8 |
9 |
10 | 532
11 | 444
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100049.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100049
5 | /home/gp/dukto/Xray_match/data/test1/test100049.jpg
6 |
7 | Unknown
8 |
9 |
10 | 552
11 | 344
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100050.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100050
5 | /home/gp/dukto/Xray_match/data/test1/test100050.jpg
6 |
7 | Unknown
8 |
9 |
10 | 1200
11 | 700
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100051.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100051
5 | /home/gp/dukto/Xray_match/data/test1/test100051.jpg
6 |
7 | Unknown
8 |
9 |
10 | 421
11 | 332
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100052.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100052
5 | /home/gp/dukto/Xray_match/data/test1/test100052.jpg
6 |
7 | Unknown
8 |
9 |
10 | 560
11 | 272
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100053.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100053
5 | /home/gp/dukto/Xray_match/data/test1/test100053.jpg
6 |
7 | Unknown
8 |
9 |
10 | 418
11 | 317
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100054.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100054
5 | /home/gp/dukto/Xray_match/data/test1/test100054.jpg
6 |
7 | Unknown
8 |
9 |
10 | 1376
11 | 480
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
63 |
64 |
--------------------------------------------------------------------------------
/data/Annotations/test100055.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100055
5 | /home/gp/dukto/Xray_match/data/test1/test100055.jpg
6 |
7 | Unknown
8 |
9 |
10 | 342
11 | 290
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100057.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100057
5 | /home/gp/dukto/Xray_match/data/test1/test100057.jpg
6 |
7 | Unknown
8 |
9 |
10 | 1026
11 | 621
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100058.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100058
5 | /home/gp/dukto/Xray_match/data/test1/test100058.jpg
6 |
7 | Unknown
8 |
9 |
10 | 1033
11 | 675
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100059.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100059
5 | /home/gp/dukto/Xray_match/data/test1/test100059.jpg
6 |
7 | Unknown
8 |
9 |
10 | 1200
11 | 700
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100060.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100060
5 | /home/gp/dukto/Xray_match/data/test1/test100060.jpg
6 |
7 | Unknown
8 |
9 |
10 | 467
11 | 563
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100061.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100061
5 | /home/gp/dukto/Xray_match/data/test1/test100061.jpg
6 |
7 | Unknown
8 |
9 |
10 | 192
11 | 152
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100062.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100062
5 | /home/gp/dukto/Xray_match/data/test1/test100062.jpg
6 |
7 | Unknown
8 |
9 |
10 | 468
11 | 300
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100063.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100063
5 | /home/gp/dukto/Xray_match/data/test1/test100063.jpg
6 |
7 | Unknown
8 |
9 |
10 | 817
11 | 379
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100064.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100064
5 | /home/gp/dukto/Xray_match/data/test1/test100064.jpg
6 |
7 | Unknown
8 |
9 |
10 | 735
11 | 350
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100066.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100066
5 | /home/gp/dukto/Xray_match/data/test1/test100066.jpg
6 |
7 | Unknown
8 |
9 |
10 | 459
11 | 259
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100067.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100067
5 | /home/gp/dukto/Xray_match/data/test1/test100067.jpg
6 |
7 | Unknown
8 |
9 |
10 | 1200
11 | 700
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100068.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100068
5 | /home/gp/dukto/Xray_match/data/test1/test100068.jpg
6 |
7 | Unknown
8 |
9 |
10 | 746
11 | 360
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100069.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100069
5 | /home/gp/dukto/Xray_match/data/test1/test100069.jpg
6 |
7 | Unknown
8 |
9 |
10 | 476
11 | 408
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100070.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100070
5 | /home/gp/dukto/Xray_match/data/test1/test100070.jpg
6 |
7 | Unknown
8 |
9 |
10 | 336
11 | 239
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100071.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100071
5 | /home/gp/dukto/Xray_match/data/test1/test100071.jpg
6 |
7 | Unknown
8 |
9 |
10 | 804
11 | 400
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
52 |
--------------------------------------------------------------------------------
/data/Annotations/test100072.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100072
5 | /home/gp/dukto/Xray_match/data/test1/test100072.jpg
6 |
7 | Unknown
8 |
9 |
10 | 625
11 | 390
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100073.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100073
5 | /home/gp/dukto/Xray_match/data/test1/test100073.jpg
6 |
7 | Unknown
8 |
9 |
10 | 680
11 | 336
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
63 |
75 |
76 |
--------------------------------------------------------------------------------
/data/Annotations/test100074.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100074
5 | /home/gp/dukto/Xray_match/data/test1/test100074.jpg
6 |
7 | Unknown
8 |
9 |
10 | 304
11 | 344
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100075.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100075
5 | /home/gp/dukto/Xray_match/data/test1/test100075.jpg
6 |
7 | Unknown
8 |
9 |
10 | 955
11 | 700
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100077.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100077
5 | /home/gp/dukto/Xray_match/data/test1/test100077.jpg
6 |
7 | Unknown
8 |
9 |
10 | 526
11 | 297
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
52 |
--------------------------------------------------------------------------------
/data/Annotations/test100078.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100078
5 | /home/gp/dukto/Xray_match/data/test1/test100078.jpg
6 |
7 | Unknown
8 |
9 |
10 | 867
11 | 294
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100079.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100079
5 | /home/gp/dukto/Xray_match/data/test1/test100079.jpg
6 |
7 | Unknown
8 |
9 |
10 | 360
11 | 456
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100080.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100080
5 | /home/gp/dukto/Xray_match/data/test1/test100080.jpg
6 |
7 | Unknown
8 |
9 |
10 | 750
11 | 432
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100081.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100081
5 | /home/gp/dukto/Xray_match/data/test1/test100081.jpg
6 |
7 | Unknown
8 |
9 |
10 | 468
11 | 332
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100082.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100082
5 | /home/gp/dukto/Xray_match/data/test1/test100082.jpg
6 |
7 | Unknown
8 |
9 |
10 | 528
11 | 276
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
63 |
64 |
--------------------------------------------------------------------------------
/data/Annotations/test100083.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100083
5 | /home/gp/dukto/Xray_match/data/test1/test100083.jpg
6 |
7 | Unknown
8 |
9 |
10 | 348
11 | 376
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100084.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100084
5 | /home/gp/dukto/Xray_match/data/test1/test100084.jpg
6 |
7 | Unknown
8 |
9 |
10 | 804
11 | 532
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100085.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100085
5 | /home/gp/dukto/Xray_match/data/test1/test100085.jpg
6 |
7 | Unknown
8 |
9 |
10 | 353
11 | 428
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100086.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100086
5 | /home/gp/dukto/Xray_match/data/test1/test100086.jpg
6 |
7 | Unknown
8 |
9 |
10 | 679
11 | 621
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100088.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100088
5 | /home/gp/dukto/Xray_match/data/test1/test100088.jpg
6 |
7 | Unknown
8 |
9 |
10 | 681
11 | 271
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
52 |
--------------------------------------------------------------------------------
/data/Annotations/test100089.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100089
5 | /home/gp/dukto/Xray_match/data/test1/test100089.jpg
6 |
7 | Unknown
8 |
9 |
10 | 1069
11 | 700
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/data/Annotations/test100090.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100090
5 | /home/gp/dukto/Xray_match/data/test1/test100090.jpg
6 |
7 | Unknown
8 |
9 |
10 | 804
11 | 432
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100091.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100091
5 | /home/gp/dukto/Xray_match/data/test1/test100091.jpg
6 |
7 | Unknown
8 |
9 |
10 | 559
11 | 322
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
52 |
--------------------------------------------------------------------------------
/data/Annotations/test100092.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100092
5 | /home/gp/dukto/Xray_match/data/test1/test100092.jpg
6 |
7 | Unknown
8 |
9 |
10 | 516
11 | 328
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100093.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100093
5 | /home/gp/dukto/Xray_match/data/test1/test100093.jpg
6 |
7 | Unknown
8 |
9 |
10 | 804
11 | 448
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100094.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100094
5 | /home/gp/dukto/Xray_match/data/test1/test100094.jpg
6 |
7 | Unknown
8 |
9 |
10 | 552
11 | 348
12 | 3
13 |
14 | 0
15 |
27 |
39 |
51 |
63 |
64 |
--------------------------------------------------------------------------------
/data/Annotations/test100097.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100097
5 | /home/gp/dukto/Xray_match/data/test1/test100097.jpg
6 |
7 | Unknown
8 |
9 |
10 | 515
11 | 379
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100098.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100098
5 | /home/gp/dukto/Xray_match/data/test1/test100098.jpg
6 |
7 | Unknown
8 |
9 |
10 | 681
11 | 656
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100099.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100099
5 | /home/gp/dukto/Xray_match/data/test1/test100099.jpg
6 |
7 | Unknown
8 |
9 |
10 | 442
11 | 421
12 | 3
13 |
14 | 0
15 |
27 |
39 |
40 |
--------------------------------------------------------------------------------
/data/Annotations/test100100.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Unknown
4 | test100100
5 | /home/gp/dukto/Xray_match/data/test1/test100100.jpg
6 |
7 | Unknown
8 |
9 |
10 | 452
11 | 595
12 | 3
13 |
14 | 0
15 |
27 |
28 |
--------------------------------------------------------------------------------
/res.json:
--------------------------------------------------------------------------------
1 | {
2 | "knife": [
3 | [
4 | "test100062",
5 | 0.02487616953122873,
6 | 105.0,
7 | 98.0,
8 | 344.0,
9 | 136.0
10 | ],
11 | [
12 | "test100044",
13 | 0.8946372067985146,
14 | 142.0,
15 | 298.0,
16 | 330.0,
17 | 525.0
18 | ],
19 | [
20 | "test100071",
21 | 0.06032161078591458,
22 | 376.0,
23 | 89.0,
24 | 412.0,
25 | 134.0
26 | ],
27 | [
28 | "test100071",
29 | 0.51323500371942,
30 | 694.0,
31 | 260.0,
32 | 707.0,
33 | 319.0
34 | ],
35 | [
36 | "test100071",
37 | 0.017955066189140223,
38 | 699.0,
39 | 283.0,
40 | 713.0,
41 | 344.0
42 | ],
43 | [
44 | "test100082",
45 | 0.3324332391380256,
46 | 109.0,
47 | 207.0,
48 | 276.0,
49 | 231.0
50 | ],
51 | [
52 | "test100098",
53 | 0.22205039376102575,
54 | 200.0,
55 | 219.0,
56 | 336.0,
57 | 289.0
58 | ],
59 | [
60 | "test100039",
61 | 0.182633388790285,
62 | 678.0,
63 | 329.0,
64 | 764.0,
65 | 502.0
66 | ],
67 | [
68 | "test100039",
69 | 0.303159717069551,
70 | 464.0,
71 | 295.0,
72 | 537.0,
73 | 402.0
74 | ],
75 | [
76 | "test100030",
77 | 0.6277034879040457,
78 | 557.0,
79 | 96.0,
80 | 622.0,
81 | 122.0
82 | ],
83 | [
84 | "test100030",
85 | 0.4873886791744282,
86 | 243.0,
87 | 124.0,
88 | 252.0,
89 | 234.0
90 | ],
91 | [
92 | "test100030",
93 | 0.27324525122009,
94 | 650.0,
95 | 288.0,
96 | 709.0,
97 | 321.0
98 | ],
99 | [
100 | "test100030",
101 | 0.5471659965228617,
102 | 688.0,
103 | 287.0,
104 | 748.0,
105 | 323.0
106 | ],
107 | [
108 | "test100052",
109 | 0.004799863461733667,
110 | 251.0,
111 | 44.0,
112 | 322.0,
113 | 85.0
114 | ],
115 | [
116 | "test100002",
117 | 0.6236462614497451,
118 | 305.0,
119 | 185.0,
120 | 376.0,
121 | 199.0
122 | ],
123 | [
124 | "test100002",
125 | 0.04876763521254812,
126 | 265.0,
127 | 194.0,
128 | 353.0,
129 | 220.0
130 | ],
131 | [
132 | "test100002",
133 | 0.1869686364686889,
134 | 168.0,
135 | 152.0,
136 | 264.0,
137 | 188.0
138 | ],
139 | [
140 | "test100008",
141 | 0.9832778111539465,
142 | 470.0,
143 | 146.0,
144 | 504.0,
145 | 427.0
146 | ],
147 | [
148 | "test100094",
149 | 0.6678982660104623,
150 | 75.0,
151 | 91.0,
152 | 128.0,
153 | 156.0
154 | ],
155 | [
156 | "test100094",
157 | 0.32848047428071403,
158 | 199.0,
159 | 155.0,
160 | 281.0,
161 | 223.0
162 | ],
163 | [
164 | "test100011",
165 | 0.27861823055790647,
166 | 352.0,
167 | 93.0,
168 | 403.0,
169 | 104.0
170 | ],
171 | [
172 | "test100012",
173 | 0.4688875505445531,
174 | 268.0,
175 | 258.0,
176 | 397.0,
177 | 396.0
178 | ],
179 | [
180 | "test100073",
181 | 0.5300239349675971,
182 | 376.0,
183 | 245.0,
184 | 424.0,
185 | 281.0
186 | ],
187 | [
188 | "test100073",
189 | 0.1465657881712622,
190 | 378.0,
191 | 136.0,
192 | 454.0,
193 | 268.0
194 | ],
195 | [
196 | "test100026",
197 | 0.559886322983828,
198 | 303.0,
199 | 84.0,
200 | 355.0,
201 | 207.0
202 | ],
203 | [
204 | "test100037",
205 | 0.19341994601321133,
206 | 295.0,
207 | 187.0,
208 | 393.0,
209 | 277.0
210 | ],
211 | [
212 | "test100004",
213 | 0.09453084659591116,
214 | 618.0,
215 | 217.0,
216 | 702.0,
217 | 291.0
218 | ],
219 | [
220 | "test100004",
221 | 0.4307437339033334,
222 | 163.0,
223 | 278.0,
224 | 197.0,
225 | 337.0
226 | ],
227 | [
228 | "test100091",
229 | 0.06901329741660889,
230 | 256.0,
231 | 128.0,
232 | 379.0,
233 | 157.0
234 | ],
235 | [
236 | "test100077",
237 | 0.337060300141786,
238 | 174.0,
239 | 73.0,
240 | 314.0,
241 | 155.0
242 | ],
243 | [
244 | "test100086",
245 | 0.5722760894393055,
246 | 212.0,
247 | 348.0,
248 | 385.0,
249 | 381.0
250 | ],
251 | [
252 | "test100058",
253 | 0.6572233800955424,
254 | 475.0,
255 | 335.0,
256 | 536.0,
257 | 436.0
258 | ],
259 | [
260 | "test100045",
261 | 0.09804307735127271,
262 | 244.0,
263 | 181.0,
264 | 330.0,
265 | 341.0
266 | ],
267 | [
268 | "test100054",
269 | 0.9942820661571375,
270 | 36.0,
271 | 98.0,
272 | 161.0,
273 | 168.0
274 | ],
275 | [
276 | "test100024",
277 | 0.47110442169070776,
278 | 458.0,
279 | 7.0,
280 | 666.0,
281 | 332.0
282 | ],
283 | [
284 | "test100090",
285 | 0.7639852439196759,
286 | 494.0,
287 | 155.0,
288 | 520.0,
289 | 201.0
290 | ],
291 | [
292 | "test100097",
293 | 0.2602158029840248,
294 | 175.0,
295 | 209.0,
296 | 238.0,
297 | 319.0
298 | ],
299 | [
300 | "test100005",
301 | 0.6707866816080242,
302 | 425.0,
303 | 435.0,
304 | 583.0,
305 | 470.0
306 | ],
307 | [
308 | "test100005",
309 | 0.14651097652816336,
310 | 558.0,
311 | 392.0,
312 | 582.0,
313 | 504.0
314 | ],
315 | [
316 | "test100005",
317 | 0.04167927658162485,
318 | 170.0,
319 | 468.0,
320 | 251.0,
321 | 590.0
322 | ],
323 | [
324 | "test100092",
325 | 0.4076508146095936,
326 | 72.0,
327 | 138.0,
328 | 321.0,
329 | 245.0
330 | ],
331 | [
332 | "test100046",
333 | 0.28895437646933597,
334 | 136.0,
335 | 372.0,
336 | 406.0,
337 | 504.0
338 | ],
339 | [
340 | "test100046",
341 | 0.5425545497738498,
342 | 945.0,
343 | 327.0,
344 | 1025.0,
345 | 405.0
346 | ],
347 | [
348 | "test100084",
349 | 0.5564064991120732,
350 | 233.0,
351 | 204.0,
352 | 259.0,
353 | 296.0
354 | ],
355 | [
356 | "test100067",
357 | 0.5877748573013332,
358 | 133.0,
359 | 133.0,
360 | 211.0,
361 | 352.0
362 | ]
363 | ],
364 | "powerbank": [
365 | [
366 | "test100079",
367 | 0.738282591814815,
368 | 78.0,
369 | 350.0,
370 | 190.0,
371 | 437.0
372 | ],
373 | [
374 | "test100001",
375 | 0.005828346089506997,
376 | 66.0,
377 | 57.0,
378 | 140.0,
379 | 250.0
380 | ],
381 | [
382 | "test100027",
383 | 0.29082790981020223,
384 | 244.0,
385 | 171.0,
386 | 352.0,
387 | 280.0
388 | ],
389 | [
390 | "test100082",
391 | 0.1643751911190574,
392 | 169.0,
393 | 174.0,
394 | 276.0,
395 | 228.0
396 | ],
397 | [
398 | "test100060",
399 | 0.5840758614857134,
400 | 380.0,
401 | 167.0,
402 | 458.0,
403 | 284.0
404 | ],
405 | [
406 | "test100031",
407 | 0.47037919687993357,
408 | 92.0,
409 | 213.0,
410 | 176.0,
411 | 392.0
412 | ],
413 | [
414 | "test100019",
415 | 0.7706821240500317,
416 | 55.0,
417 | 216.0,
418 | 108.0,
419 | 326.0
420 | ],
421 | [
422 | "test100075",
423 | 0.01749305244037369,
424 | 387.0,
425 | 403.0,
426 | 543.0,
427 | 530.0
428 | ],
429 | [
430 | "test100034",
431 | 0.8161420651641845,
432 | 99.0,
433 | 218.0,
434 | 209.0,
435 | 328.0
436 | ],
437 | [
438 | "test100015",
439 | 0.020176438809432207,
440 | 178.0,
441 | 319.0,
442 | 283.0,
443 | 362.0
444 | ],
445 | [
446 | "test100015",
447 | 0.09949713997950227,
448 | 181.0,
449 | 263.0,
450 | 283.0,
451 | 347.0
452 | ],
453 | [
454 | "test100015",
455 | 0.2670237978896852,
456 | 214.0,
457 | 422.0,
458 | 315.0,
459 | 429.0
460 | ],
461 | [
462 | "test100015",
463 | 0.8386054456892232,
464 | 33.0,
465 | 313.0,
466 | 101.0,
467 | 413.0
468 | ],
469 | [
470 | "test100012",
471 | 0.3372772749181401,
472 | 112.0,
473 | 112.0,
474 | 268.0,
475 | 315.0
476 | ],
477 | [
478 | "test100085",
479 | 0.13022302757569182,
480 | 18.0,
481 | 170.0,
482 | 114.0,
483 | 254.0
484 | ],
485 | [
486 | "test100009",
487 | 0.10942419022072392,
488 | 176.0,
489 | 60.0,
490 | 257.0,
491 | 153.0
492 | ],
493 | [
494 | "test100043",
495 | 0.8054978315221719,
496 | 462.0,
497 | 339.0,
498 | 554.0,
499 | 399.0
500 | ],
501 | [
502 | "test100037",
503 | 0.9034115648379837,
504 | 890.0,
505 | 241.0,
506 | 1002.0,
507 | 400.0
508 | ],
509 | [
510 | "test100088",
511 | 0.9186955624726616,
512 | 422.0,
513 | 61.0,
514 | 476.0,
515 | 145.0
516 | ],
517 | [
518 | "test100066",
519 | 0.4669999314348019,
520 | 298.0,
521 | 79.0,
522 | 391.0,
523 | 137.0
524 | ],
525 | [
526 | "test100004",
527 | 0.5666153521236179,
528 | 186.0,
529 | 206.0,
530 | 210.0,
531 | 290.0
532 | ],
533 | [
534 | "test100061",
535 | 0.7385262601127847,
536 | 24.0,
537 | 80.0,
538 | 153.0,
539 | 131.0
540 | ],
541 | [
542 | "test100023",
543 | 0.6164735077553435,
544 | 35.0,
545 | 160.0,
546 | 109.0,
547 | 323.0
548 | ],
549 | [
550 | "test100041",
551 | 0.8159213667792007,
552 | 192.0,
553 | 118.0,
554 | 305.0,
555 | 268.0
556 | ],
557 | [
558 | "test100069",
559 | 0.47565714736155007,
560 | 171.0,
561 | 205.0,
562 | 321.0,
563 | 304.0
564 | ],
565 | [
566 | "test100035",
567 | 0.30752719125289285,
568 | 15.0,
569 | 60.0,
570 | 79.0,
571 | 182.0
572 | ],
573 | [
574 | "test100074",
575 | 0.4709519204758885,
576 | 43.0,
577 | 8.0,
578 | 92.0,
579 | 130.0
580 | ],
581 | [
582 | "test100074",
583 | 0.48922794517029355,
584 | 99.0,
585 | 78.0,
586 | 144.0,
587 | 183.0
588 | ]
589 | ],
590 | "lighter": [
591 | [
592 | "test100082",
593 | 0.010681021456151574,
594 | 129.0,
595 | 192.0,
596 | 169.0,
597 | 202.0
598 | ],
599 | [
600 | "test100038",
601 | 0.4635933043831003,
602 | 157.0,
603 | 63.0,
604 | 204.0,
605 | 130.0
606 | ],
607 | [
608 | "test100030",
609 | 0.0770845619099555,
610 | 575.0,
611 | 273.0,
612 | 595.0,
613 | 314.0
614 | ],
615 | [
616 | "test100072",
617 | 0.18032654508102175,
618 | 418.0,
619 | 74.0,
620 | 478.0,
621 | 139.0
622 | ],
623 | [
624 | "test100053",
625 | 0.9606054333187342,
626 | 196.0,
627 | 134.0,
628 | 268.0,
629 | 187.0
630 | ],
631 | [
632 | "test100051",
633 | 0.9252599310534275,
634 | 229.0,
635 | 28.0,
636 | 354.0,
637 | 77.0
638 | ],
639 | [
640 | "test100083",
641 | 0.48542729332596013,
642 | 32.0,
643 | 111.0,
644 | 89.0,
645 | 188.0
646 | ],
647 | [
648 | "test100031",
649 | 0.9192164214731994,
650 | 201.0,
651 | 386.0,
652 | 236.0,
653 | 498.0
654 | ],
655 | [
656 | "test100031",
657 | 0.86307361623837,
658 | 228.0,
659 | 286.0,
660 | 296.0,
661 | 357.0
662 | ],
663 | [
664 | "test100094",
665 | 0.052248669918991575,
666 | 162.0,
667 | 148.0,
668 | 224.0,
669 | 169.0
670 | ],
671 | [
672 | "test100032",
673 | 0.981199636974751,
674 | 353.0,
675 | 102.0,
676 | 378.0,
677 | 155.0
678 | ],
679 | [
680 | "test100033",
681 | 0.7663489641035114,
682 | 83.0,
683 | 42.0,
684 | 122.0,
685 | 97.0
686 | ],
687 | [
688 | "test100085",
689 | 0.19059821882615546,
690 | 5.0,
691 | 257.0,
692 | 78.0,
693 | 298.0
694 | ],
695 | [
696 | "test100073",
697 | 0.2919242627012959,
698 | 316.0,
699 | 100.0,
700 | 373.0,
701 | 122.0
702 | ],
703 | [
704 | "test100009",
705 | 0.8360540692361065,
706 | 409.0,
707 | 208.0,
708 | 446.0,
709 | 246.0
710 | ],
711 | [
712 | "test100026",
713 | 0.028677763213866614,
714 | 379.0,
715 | 135.0,
716 | 435.0,
717 | 157.0
718 | ],
719 | [
720 | "test100026",
721 | 0.1403326348341457,
722 | 265.0,
723 | 171.0,
724 | 324.0,
725 | 180.0
726 | ],
727 | [
728 | "test100037",
729 | 0.9002381978565438,
730 | 294.0,
731 | 101.0,
732 | 372.0,
733 | 184.0
734 | ],
735 | [
736 | "test100088",
737 | 0.7384541993243771,
738 | 352.0,
739 | 39.0,
740 | 411.0,
741 | 47.0
742 | ],
743 | [
744 | "test100029",
745 | 0.81112441866387,
746 | 207.0,
747 | 215.0,
748 | 257.0,
749 | 251.0
750 | ],
751 | [
752 | "test100041",
753 | 0.8456522702958122,
754 | 132.0,
755 | 339.0,
756 | 221.0,
757 | 361.0
758 | ],
759 | [
760 | "test100041",
761 | 0.3698189674573157,
762 | 225.0,
763 | 8.0,
764 | 272.0,
765 | 56.0
766 | ],
767 | [
768 | "test100070",
769 | 0.30392706269489667,
770 | 294.0,
771 | 82.0,
772 | 312.0,
773 | 154.0
774 | ],
775 | [
776 | "test100070",
777 | 0.3202017976438032,
778 | 234.0,
779 | 142.0,
780 | 278.0,
781 | 196.0
782 | ],
783 | [
784 | "test100024",
785 | 0.4552950087841261,
786 | 702.0,
787 | 360.0,
788 | 744.0,
789 | 450.0
790 | ],
791 | [
792 | "test100063",
793 | 0.07477794670680782,
794 | 771.0,
795 | 134.0,
796 | 795.0,
797 | 208.0
798 | ],
799 | [
800 | "test100081",
801 | 0.7578052870124676,
802 | 63.0,
803 | 224.0,
804 | 102.0,
805 | 255.0
806 | ],
807 | [
808 | "test100059",
809 | 0.016616606432623415,
810 | 255.0,
811 | 503.0,
812 | 371.0,
813 | 524.0
814 | ],
815 | [
816 | "test100014",
817 | 0.305523718128735,
818 | 215.0,
819 | 55.0,
820 | 278.0,
821 | 85.0
822 | ],
823 | [
824 | "test100050",
825 | 0.023692446277815638,
826 | 1094.0,
827 | 602.0,
828 | 1194.0,
829 | 642.0
830 | ],
831 | [
832 | "test100089",
833 | 0.6675888100236647,
834 | 229.0,
835 | 534.0,
836 | 328.0,
837 | 550.0
838 | ],
839 | [
840 | "test100049",
841 | 0.32268338132938446,
842 | 305.0,
843 | 197.0,
844 | 330.0,
845 | 249.0
846 | ],
847 | [
848 | "test100092",
849 | 0.5883734417102561,
850 | 133.0,
851 | 224.0,
852 | 186.0,
853 | 255.0
854 | ],
855 | [
856 | "test100099",
857 | 0.9331477731076274,
858 | 293.0,
859 | 229.0,
860 | 327.0,
861 | 308.0
862 | ],
863 | [
864 | "test100099",
865 | 0.6051065675412708,
866 | 387.0,
867 | 200.0,
868 | 408.0,
869 | 277.0
870 | ],
871 | [
872 | "test100028",
873 | 0.4887724439170116,
874 | 112.0,
875 | 48.0,
876 | 194.0,
877 | 69.0
878 | ],
879 | [
880 | "test100042",
881 | 0.8873909661920596,
882 | 290.0,
883 | 91.0,
884 | 314.0,
885 | 163.0
886 | ],
887 | [
888 | "test100064",
889 | 0.9411837506939553,
890 | 654.0,
891 | 140.0,
892 | 681.0,
893 | 205.0
894 | ],
895 | [
896 | "test100064",
897 | 0.9393435563805355,
898 | 627.0,
899 | 274.0,
900 | 649.0,
901 | 333.0
902 | ]
903 | ],
904 | "zippooil": [
905 | [
906 | "test100082",
907 | 0.9565673744762963,
908 | 174.0,
909 | 171.0,
910 | 274.0,
911 | 227.0
912 | ],
913 | [
914 | "test100097",
915 | 0.044373971633218656,
916 | 224.0,
917 | 290.0,
918 | 328.0,
919 | 340.0
920 | ],
921 | [
922 | "test100005",
923 | 0.9298175545914049,
924 | 342.0,
925 | 87.0,
926 | 468.0,
927 | 156.0
928 | ]
929 | ],
930 | "pressure": [
931 | [
932 | "test100098",
933 | 0.21801968744809985,
934 | 175.0,
935 | 235.0,
936 | 489.0,
937 | 463.0
938 | ],
939 | [
940 | "test100052",
941 | 0.46669046816048043,
942 | 183.0,
943 | 166.0,
944 | 395.0,
945 | 245.0
946 | ],
947 | [
948 | "test100057",
949 | 0.22499235716872557,
950 | 134.0,
951 | 134.0,
952 | 248.0,
953 | 289.0
954 | ],
955 | [
956 | "test100002",
957 | 0.538076931170309,
958 | 212.0,
959 | 18.0,
960 | 361.0,
961 | 77.0
962 | ],
963 | [
964 | "test100040",
965 | 0.9941720790758143,
966 | 74.0,
967 | 141.0,
968 | 320.0,
969 | 240.0
970 | ],
971 | [
972 | "test100040",
973 | 0.7844180041653266,
974 | 137.0,
975 | 117.0,
976 | 384.0,
977 | 191.0
978 | ],
979 | [
980 | "test100040",
981 | 0.7499549270315198,
982 | 127.0,
983 | 89.0,
984 | 367.0,
985 | 142.0
986 | ],
987 | [
988 | "test100080",
989 | 0.13407522800551197,
990 | 254.0,
991 | 11.0,
992 | 338.0,
993 | 165.0
994 | ],
995 | [
996 | "test100020",
997 | 0.6524339410350494,
998 | 512.0,
999 | 280.0,
1000 | 725.0,
1001 | 430.0
1002 | ],
1003 | [
1004 | "test100094",
1005 | 0.14866900052919196,
1006 | 128.0,
1007 | 81.0,
1008 | 307.0,
1009 | 201.0
1010 | ],
1011 | [
1012 | "test100075",
1013 | 0.47543408711202495,
1014 | 226.0,
1015 | 222.0,
1016 | 610.0,
1017 | 395.0
1018 | ],
1019 | [
1020 | "test100012",
1021 | 0.6282222023822576,
1022 | 378.0,
1023 | 79.0,
1024 | 704.0,
1025 | 293.0
1026 | ],
1027 | [
1028 | "test100012",
1029 | 0.17453625608084167,
1030 | 1089.0,
1031 | 5.0,
1032 | 1176.0,
1033 | 285.0
1034 | ],
1035 | [
1036 | "test100073",
1037 | 0.04841880711794799,
1038 | 313.0,
1039 | 146.0,
1040 | 474.0,
1041 | 282.0
1042 | ],
1043 | [
1044 | "test100036",
1045 | 0.1983302287129678,
1046 | 259.0,
1047 | 302.0,
1048 | 513.0,
1049 | 570.0
1050 | ],
1051 | [
1052 | "test100037",
1053 | 0.1612166805696421,
1054 | 266.0,
1055 | 170.0,
1056 | 528.0,
1057 | 417.0
1058 | ],
1059 | [
1060 | "test100088",
1061 | 0.8889514821605365,
1062 | 360.0,
1063 | 57.0,
1064 | 448.0,
1065 | 200.0
1066 | ],
1067 | [
1068 | "test100091",
1069 | 0.9388392478985955,
1070 | 190.0,
1071 | 100.0,
1072 | 377.0,
1073 | 165.0
1074 | ],
1075 | [
1076 | "test100091",
1077 | 0.7552195137341169,
1078 | 341.0,
1079 | 129.0,
1080 | 424.0,
1081 | 186.0
1082 | ],
1083 | [
1084 | "test100077",
1085 | 0.1587559879695003,
1086 | 80.0,
1087 | 72.0,
1088 | 297.0,
1089 | 119.0
1090 | ],
1091 | [
1092 | "test100077",
1093 | 0.7015442682673679,
1094 | 165.0,
1095 | 113.0,
1096 | 348.0,
1097 | 156.0
1098 | ],
1099 | [
1100 | "test100045",
1101 | 0.5408784001810462,
1102 | 44.0,
1103 | 100.0,
1104 | 317.0,
1105 | 302.0
1106 | ],
1107 | [
1108 | "test100054",
1109 | 0.07278068529930082,
1110 | 30.0,
1111 | 219.0,
1112 | 179.0,
1113 | 375.0
1114 | ],
1115 | [
1116 | "test100054",
1117 | 0.33898175083394866,
1118 | 932.0,
1119 | 152.0,
1120 | 1110.0,
1121 | 231.0
1122 | ],
1123 | [
1124 | "test100054",
1125 | 0.22943723830520135,
1126 | 11.0,
1127 | 105.0,
1128 | 172.0,
1129 | 221.0
1130 | ],
1131 | [
1132 | "test100068",
1133 | 0.24165884887704425,
1134 | 228.0,
1135 | 188.0,
1136 | 388.0,
1137 | 263.0
1138 | ],
1139 | [
1140 | "test100006",
1141 | 0.0170947402456898,
1142 | 394.0,
1143 | 71.0,
1144 | 480.0,
1145 | 222.0
1146 | ],
1147 | [
1148 | "test100025",
1149 | 0.4891714863016624,
1150 | 119.0,
1151 | 103.0,
1152 | 187.0,
1153 | 219.0
1154 | ],
1155 | [
1156 | "test100025",
1157 | 0.9938431400068718,
1158 | 119.0,
1159 | 53.0,
1160 | 324.0,
1161 | 89.0
1162 | ],
1163 | [
1164 | "test100022",
1165 | 0.6324798630280941,
1166 | 45.0,
1167 | 182.0,
1168 | 242.0,
1169 | 224.0
1170 | ],
1171 | [
1172 | "test100022",
1173 | 0.6825260742168249,
1174 | 8.0,
1175 | 22.0,
1176 | 92.0,
1177 | 214.0
1178 | ],
1179 | [
1180 | "test100022",
1181 | 0.23208890879466315,
1182 | 118.0,
1183 | 10.0,
1184 | 237.0,
1185 | 207.0
1186 | ],
1187 | [
1188 | "test100055",
1189 | 0.18053980799676073,
1190 | 115.0,
1191 | 122.0,
1192 | 294.0,
1193 | 196.0
1194 | ],
1195 | [
1196 | "test100055",
1197 | 0.9380510247112293,
1198 | 275.0,
1199 | 28.0,
1200 | 335.0,
1201 | 146.0
1202 | ],
1203 | [
1204 | "test100048",
1205 | 0.6788604386591427,
1206 | 57.0,
1207 | 153.0,
1208 | 328.0,
1209 | 250.0
1210 | ],
1211 | [
1212 | "test100067",
1213 | 0.2729976513588316,
1214 | 250.0,
1215 | 367.0,
1216 | 661.0,
1217 | 511.0
1218 | ]
1219 | ],
1220 | "scissors": [
1221 | [
1222 | "test100030",
1223 | 0.3663969159597802,
1224 | 245.0,
1225 | 255.0,
1226 | 340.0,
1227 | 287.0
1228 | ],
1229 | [
1230 | "test100057",
1231 | 0.546429646134583,
1232 | 169.0,
1233 | 251.0,
1234 | 488.0,
1235 | 369.0
1236 | ],
1237 | [
1238 | "test100026",
1239 | 0.6858701533801085,
1240 | 196.0,
1241 | 105.0,
1242 | 281.0,
1243 | 229.0
1244 | ],
1245 | [
1246 | "test100013",
1247 | 0.9701293164400338,
1248 | 80.0,
1249 | 249.0,
1250 | 112.0,
1251 | 295.0
1252 | ],
1253 | [
1254 | "test100078",
1255 | 0.5857795086461002,
1256 | 602.0,
1257 | 125.0,
1258 | 635.0,
1259 | 226.0
1260 | ],
1261 | [
1262 | "test100100",
1263 | 0.43196510280177147,
1264 | 129.0,
1265 | 89.0,
1266 | 266.0,
1267 | 342.0
1268 | ],
1269 | [
1270 | "test100049",
1271 | 0.8324513036761776,
1272 | 336.0,
1273 | 173.0,
1274 | 435.0,
1275 | 266.0
1276 | ],
1277 | [
1278 | "test100007",
1279 | 0.7945898128992117,
1280 | 352.0,
1281 | 38.0,
1282 | 432.0,
1283 | 102.0
1284 | ],
1285 | [
1286 | "test100084",
1287 | 0.4550438754244679,
1288 | 10.0,
1289 | 380.0,
1290 | 68.0,
1291 | 465.0
1292 | ]
1293 | ],
1294 | "handcuffs": [
1295 | [
1296 | "test100030",
1297 | 0.10222143260917071,
1298 | 281.0,
1299 | 280.0,
1300 | 378.0,
1301 | 342.0
1302 | ],
1303 | [
1304 | "test100073",
1305 | 0.48788280321702615,
1306 | 401.0,
1307 | 160.0,
1308 | 473.0,
1309 | 237.0
1310 | ],
1311 | [
1312 | "test100009",
1313 | 0.07655009638240895,
1314 | 233.0,
1315 | 191.0,
1316 | 324.0,
1317 | 246.0
1318 | ],
1319 | [
1320 | "test100026",
1321 | 0.3547459542570758,
1322 | 330.0,
1323 | 97.0,
1324 | 390.0,
1325 | 157.0
1326 | ],
1327 | [
1328 | "test100036",
1329 | 0.11020765834300539,
1330 | 829.0,
1331 | 381.0,
1332 | 896.0,
1333 | 516.0
1334 | ],
1335 | [
1336 | "test100090",
1337 | 0.9524214124267874,
1338 | 73.0,
1339 | 161.0,
1340 | 148.0,
1341 | 236.0
1342 | ]
1343 | ],
1344 | "firecrackers": [
1345 | [
1346 | "test100036",
1347 | 0.6892215252788941,
1348 | 165.0,
1349 | 127.0,
1350 | 463.0,
1351 | 386.0
1352 | ],
1353 | [
1354 | "test100016",
1355 | 0.43867192652460507,
1356 | 461.0,
1357 | 53.0,
1358 | 581.0,
1359 | 158.0
1360 | ],
1361 | [
1362 | "test100093",
1363 | 0.19547175632214286,
1364 | 641.0,
1365 | 194.0,
1366 | 767.0,
1367 | 332.0
1368 | ],
1369 | [
1370 | "test100093",
1371 | 0.04535187187441825,
1372 | 371.0,
1373 | 176.0,
1374 | 389.0,
1375 | 214.0
1376 | ]
1377 | ]
1378 | }
--------------------------------------------------------------------------------
/res.txt:
--------------------------------------------------------------------------------
1 | 类别名称,类别数,检出数,误检数,检出率,误检率,AP
2 | knife,45,42,3,0.933,0.067,0.895
3 | powerbank,28,27,1,0.964,0.036,0.955
4 | lighter,39,36,3,0.923,0.077,0.903
5 | zippooil,3,3,0,1.000,0.000,1.000
6 | pressure,36,36,0,1.000,0.000,1.000
7 | scissors,9,9,0,1.000,0.000,1.000
8 | handcuffs,6,6,0,1.000,0.000,1.000
9 | firecrackers,4,4,0,1.000,0.000,1.000
10 | sum,170,163,7,0.959,0.041,0.969
11 |
--------------------------------------------------------------------------------
/voc_eval.py:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2017-present, Facebook, Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | ##############################################################################
15 | #
16 | # Based on:
17 | # --------------------------------------------------------
18 | # Fast/er R-CNN
19 | # Licensed under The MIT License [see LICENSE for details]
20 | # Written by Bharath Hariharan
21 | # --------------------------------------------------------
22 |
23 | """Python implementation of the PASCAL VOC devkit's AP evaluation code."""
24 |
25 | import _pickle as cPickle
26 | import logging
27 | import numpy as np
28 | import os
29 | import glob
30 | import xml.etree.ElementTree as ET
31 |
32 | logger = logging.getLogger(__name__)
33 |
34 |
35 | def parse_rec(filename):
36 | """Parse a PASCAL VOC xml file."""
37 | tree = ET.parse(filename)
38 | objects = []
39 | for obj in tree.findall('object'):
40 | obj_struct = {}
41 | obj_struct['difficult'] = 0
42 | name = obj.find('name').text
43 |
44 | obj_struct['name'] = name
45 |
46 | bbox = obj.find('bndbox')
47 | obj_struct['bbox'] = [int(bbox.find('xmin').text),
48 | int(bbox.find('ymin').text),
49 | int(bbox.find('xmax').text),
50 | int(bbox.find('ymax').text)]
51 | objects.append(obj_struct)
52 |
53 | return objects
54 |
55 |
56 | def voc_ap(rec, prec, use_07_metric=False):
57 | """Compute VOC AP given precision and recall. If use_07_metric is true, uses
58 | the VOC 07 11-point method (default:False).
59 | """
60 | if use_07_metric:
61 | # 11 point metric
62 | ap = 0.
63 | for t in np.arange(0., 1.1, 0.1):
64 | if np.sum(rec >= t) == 0:
65 | p = 0
66 | else:
67 | p = np.max(prec[rec >= t])
68 | ap = ap + p / 11.
69 | else:
70 | # correct AP calculation
71 | # first append sentinel values at the end
72 | mrec = np.concatenate(([0.], rec, [1.]))
73 | mpre = np.concatenate(([0.], prec, [0.]))
74 |
75 | # compute the precision envelope
76 | for i in range(mpre.size - 1, 0, -1):
77 | mpre[i - 1] = np.maximum(mpre[i - 1], mpre[i])
78 |
79 | # to calculate area under PR curve, look for points
80 | # where X axis (recall) changes value
81 | i = np.where(mrec[1:] != mrec[:-1])[0]
82 |
83 | # and sum (\Delta recall) * prec
84 | ap = np.sum((mrec[i + 1] - mrec[i]) * mpre[i + 1])
85 | return ap
86 |
87 |
88 | def voc_eval(data,
89 | annopath,
90 | classname,
91 | ovthresh=0.5,
92 | use_07_metric=False):
93 | """rec, prec, ap = voc_eval(detpath,
94 | annopath,
95 | imagesetfile,
96 | classname,
97 | [ovthresh],
98 | [use_07_metric])
99 |
100 | Top level function that does the PASCAL VOC evaluation.
101 |
102 | detpath: Path to detections
103 | detpath.format(classname) should produce the detection results file.
104 | annopath: Path to annotations
105 | annopath.format(imagename) should be the xml annotations file.
106 | imagesetfile: Text file containing the list of images, one image per line.
107 | classname: Category name (duh)
108 | cachedir: Directory for caching the annotations
109 | [ovthresh]: Overlap threshold (default = 0.5)
110 | [use_07_metric]: Whether to use VOC07's 11 point AP computation
111 | (default False)
112 | """
113 | # assumes detections are in detpath.format(classname)
114 | # assumes annotations are in annopath.format(imagename)
115 | # assumes imagesetfile is a text file with each line an image name
116 | # cachedir caches the annotations in a pickle file
117 |
118 | # read list of images
119 | xmls = glob.glob(annopath+"*.xml")
120 | imagenames = [x.strip().split('/')[-1].split('.')[0] for x in xmls]
121 |
122 | #if not os.path.isfile(cachefile):
123 | if 1:
124 | # load annots
125 | recs = {}
126 | for i, imagename in enumerate(imagenames):
127 | xml_path = os.path.join(annopath, "%s.xml" % imagename)
128 | recs[imagename] = parse_rec(xml_path)
129 | if i % 100 == 0:
130 | logger.info(
131 | 'Reading annotation for {:d}/{:d}'.format(
132 | i + 1, len(imagenames)))
133 |
134 | # extract gt objects for this class
135 | class_recs = {}
136 | npos = 0
137 | for imagename in imagenames:
138 | R = [obj for obj in recs[imagename] if obj['name'] == classname]
139 | bbox = np.array([x['bbox'] for x in R])
140 | difficult = np.array([x['difficult'] for x in R]).astype(np.bool)
141 | det = [False] * len(R)
142 | npos = npos + sum(~difficult)
143 | class_recs[imagename] = {'bbox': bbox,
144 | 'difficult': difficult,
145 | 'det': det}
146 |
147 | image_ids = [x[0] for x in data]
148 | confidence = np.array([float(x[1]) for x in data])
149 | BB = np.array([x[2:] for x in data])
150 |
151 |
152 | # sort by confidence
153 | try:
154 | sorted_ind = np.argsort(-confidence)
155 | BB = BB[sorted_ind, :]
156 | except:
157 | # 没有检测到任何东西
158 | return npos, 0, 0, 0, 0, 0
159 | image_ids = [image_ids[x] for x in sorted_ind]
160 |
161 | # go down dets and mark TPs and FPs
162 | nd = len(image_ids)
163 | tp = np.zeros(nd)
164 | fp = np.zeros(nd)
165 | for d in range(nd):
166 | R = class_recs[image_ids[d]]
167 | bb = BB[d, :].astype(float)
168 | ovmax = -np.inf
169 | BBGT = R['bbox'].astype(float)
170 |
171 | if BBGT.size > 0:
172 | # compute overlaps
173 | # intersection
174 | ixmin = np.maximum(BBGT[:, 0], bb[0])
175 | iymin = np.maximum(BBGT[:, 1], bb[1])
176 | ixmax = np.minimum(BBGT[:, 2], bb[2])
177 | iymax = np.minimum(BBGT[:, 3], bb[3])
178 | iw = np.maximum(ixmax - ixmin + 1., 0.)
179 | ih = np.maximum(iymax - iymin + 1., 0.)
180 | inters = iw * ih
181 |
182 | # union
183 | uni = ((bb[2] - bb[0] + 1.) * (bb[3] - bb[1] + 1.) +
184 | (BBGT[:, 2] - BBGT[:, 0] + 1.) *
185 | (BBGT[:, 3] - BBGT[:, 1] + 1.) - inters)
186 |
187 | overlaps = inters / uni
188 | ovmax = np.max(overlaps)
189 | jmax = np.argmax(overlaps)
190 |
191 | if ovmax > ovthresh:
192 | if not R['difficult'][jmax]:
193 | if not R['det'][jmax]:
194 | tp[d] = 1.
195 | R['det'][jmax] = 1
196 | else:
197 | fp[d] = 1.
198 | else:
199 | fp[d] = 1.
200 |
201 | # compute precision recall
202 | recall = sum(tp)/(npos + 1e-6)
203 | recall_num = sum(tp)
204 | # fp/(tp+fp)
205 | wujian = sum(fp)/(sum(fp) + sum(tp)+1e-6)
206 | wujian_num = sum(fp)
207 |
208 | fp = np.cumsum(fp)
209 | tp = np.cumsum(tp)
210 | rec = tp / (float(npos) + 1e-6)
211 | # avoid divide by zero in case the first detection matches a difficult
212 | # ground truth
213 | prec = tp / np.maximum(tp + fp, np.finfo(np.float64).eps)
214 | ap = voc_ap(rec, prec, use_07_metric)
215 |
216 | #return rec, prec, ap
217 | return npos, recall_num, wujian_num, recall, wujian, ap
218 |
219 |
--------------------------------------------------------------------------------