├── .gitignore
├── LICENSE
├── README.md
├── input
├── detection-results
│ ├── 2007_000027.txt
│ ├── 2007_000032.txt
│ ├── 2007_000033.txt
│ ├── 2007_000039.txt
│ ├── 2007_000042.txt
│ ├── 2007_000061.txt
│ ├── 2007_000063.txt
│ ├── 2007_000068.txt
│ ├── 2007_000121.txt
│ ├── 2007_000123.txt
│ ├── 2007_000129.txt
│ ├── 2007_000170.txt
│ ├── 2007_000175.txt
│ ├── 2007_000187.txt
│ ├── 2007_000241.txt
│ ├── 2007_000243.txt
│ ├── 2007_000250.txt
│ ├── 2007_000256.txt
│ ├── 2007_000272.txt
│ ├── 2007_000323.txt
│ ├── 2007_000332.txt
│ ├── 2007_000333.txt
│ ├── 2007_000346.txt
│ ├── 2007_000363.txt
│ ├── 2007_000364.txt
│ ├── 2007_000392.txt
│ ├── 2007_000423.txt
│ ├── 2007_000452.txt
│ ├── 2007_000464.txt
│ ├── 2007_000480.txt
│ ├── 2007_000491.txt
│ ├── 2007_000504.txt
│ ├── 2007_000515.txt
│ ├── 2007_000528.txt
│ ├── 2007_000529.txt
│ ├── 2007_000549.txt
│ ├── 2007_000559.txt
│ ├── 2007_000572.txt
│ ├── 2007_000584.txt
│ ├── 2007_000629.txt
│ ├── 2007_000636.txt
│ ├── 2007_000645.txt
│ ├── 2007_000648.txt
│ ├── 2007_000661.txt
│ ├── 2007_000663.txt
│ ├── 2007_000664.txt
│ ├── 2007_000676.txt
│ ├── 2007_000713.txt
│ ├── 2007_000720.txt
│ ├── 2007_000727.txt
│ ├── 2007_000733.txt
│ ├── 2007_000738.txt
│ ├── 2007_000762.txt
│ ├── 2007_000768.txt
│ ├── 2007_000783.txt
│ ├── 2007_000793.txt
│ ├── 2007_000799.txt
│ ├── 2007_000804.txt
│ ├── 2007_000807.txt
│ ├── 2007_000822.txt
│ ├── 2007_000830.txt
│ ├── 2007_000836.txt
│ ├── 2007_000837.txt
│ ├── 2007_000847.txt
│ ├── 2007_000862.txt
│ ├── 2007_000876.txt
│ ├── 2007_000904.txt
│ ├── 2007_000999.txt
│ ├── 2007_001073.txt
│ ├── 2007_001154.txt
│ ├── 2007_001175.txt
│ ├── 2007_001185.txt
│ ├── 2007_001225.txt
│ ├── 2007_001239.txt
│ ├── 2007_001284.txt
│ ├── 2007_001288.txt
│ ├── 2007_001289.txt
│ ├── 2007_001299.txt
│ ├── 2007_001311.txt
│ ├── 2007_001321.txt
│ ├── 2007_001340.txt
│ ├── 2007_001377.txt
│ ├── 2007_001397.txt
│ ├── 2007_001408.txt
│ └── 2007_001416.txt
├── ground-truth
│ ├── 2007_000027.txt
│ ├── 2007_000032.txt
│ ├── 2007_000033.txt
│ ├── 2007_000039.txt
│ ├── 2007_000042.txt
│ ├── 2007_000061.txt
│ ├── 2007_000063.txt
│ ├── 2007_000068.txt
│ ├── 2007_000121.txt
│ ├── 2007_000123.txt
│ ├── 2007_000129.txt
│ ├── 2007_000170.txt
│ ├── 2007_000175.txt
│ ├── 2007_000187.txt
│ ├── 2007_000241.txt
│ ├── 2007_000243.txt
│ ├── 2007_000250.txt
│ ├── 2007_000256.txt
│ ├── 2007_000272.txt
│ ├── 2007_000323.txt
│ ├── 2007_000332.txt
│ ├── 2007_000333.txt
│ ├── 2007_000346.txt
│ ├── 2007_000363.txt
│ ├── 2007_000364.txt
│ ├── 2007_000392.txt
│ ├── 2007_000423.txt
│ ├── 2007_000452.txt
│ ├── 2007_000464.txt
│ ├── 2007_000480.txt
│ ├── 2007_000491.txt
│ ├── 2007_000504.txt
│ ├── 2007_000515.txt
│ ├── 2007_000528.txt
│ ├── 2007_000529.txt
│ ├── 2007_000549.txt
│ ├── 2007_000559.txt
│ ├── 2007_000572.txt
│ ├── 2007_000584.txt
│ ├── 2007_000629.txt
│ ├── 2007_000636.txt
│ ├── 2007_000645.txt
│ ├── 2007_000648.txt
│ ├── 2007_000661.txt
│ ├── 2007_000663.txt
│ ├── 2007_000664.txt
│ ├── 2007_000676.txt
│ ├── 2007_000713.txt
│ ├── 2007_000720.txt
│ ├── 2007_000727.txt
│ ├── 2007_000733.txt
│ ├── 2007_000738.txt
│ ├── 2007_000762.txt
│ ├── 2007_000768.txt
│ ├── 2007_000783.txt
│ ├── 2007_000793.txt
│ ├── 2007_000799.txt
│ ├── 2007_000804.txt
│ ├── 2007_000807.txt
│ ├── 2007_000822.txt
│ ├── 2007_000830.txt
│ ├── 2007_000836.txt
│ ├── 2007_000837.txt
│ ├── 2007_000847.txt
│ ├── 2007_000862.txt
│ ├── 2007_000876.txt
│ ├── 2007_000904.txt
│ ├── 2007_000999.txt
│ ├── 2007_001073.txt
│ ├── 2007_001154.txt
│ ├── 2007_001175.txt
│ ├── 2007_001185.txt
│ ├── 2007_001225.txt
│ ├── 2007_001239.txt
│ ├── 2007_001284.txt
│ ├── 2007_001288.txt
│ ├── 2007_001289.txt
│ ├── 2007_001299.txt
│ ├── 2007_001311.txt
│ ├── 2007_001321.txt
│ ├── 2007_001340.txt
│ ├── 2007_001377.txt
│ ├── 2007_001397.txt
│ ├── 2007_001408.txt
│ └── 2007_001416.txt
└── images-optional
│ ├── 2007_000027.jpg
│ ├── 2007_000032.jpg
│ ├── 2007_000033.jpg
│ ├── 2007_000039.jpg
│ ├── 2007_000042.jpg
│ ├── 2007_000061.jpg
│ ├── 2007_000063.jpg
│ ├── 2007_000068.jpg
│ ├── 2007_000121.jpg
│ ├── 2007_000123.jpg
│ ├── 2007_000129.jpg
│ ├── 2007_000170.jpg
│ ├── 2007_000175.jpg
│ ├── 2007_000187.jpg
│ ├── 2007_000241.jpg
│ ├── 2007_000243.jpg
│ ├── 2007_000250.jpg
│ ├── 2007_000256.jpg
│ ├── 2007_000272.jpg
│ ├── 2007_000323.jpg
│ ├── 2007_000332.jpg
│ ├── 2007_000333.jpg
│ ├── 2007_000346.jpg
│ ├── 2007_000363.jpg
│ ├── 2007_000364.jpg
│ ├── 2007_000392.jpg
│ ├── 2007_000423.jpg
│ ├── 2007_000452.jpg
│ ├── 2007_000464.jpg
│ ├── 2007_000480.jpg
│ ├── 2007_000491.jpg
│ ├── 2007_000504.jpg
│ ├── 2007_000515.jpg
│ ├── 2007_000528.jpg
│ ├── 2007_000529.jpg
│ ├── 2007_000549.jpg
│ ├── 2007_000559.jpg
│ ├── 2007_000572.jpg
│ ├── 2007_000584.jpg
│ ├── 2007_000629.jpg
│ ├── 2007_000636.jpg
│ ├── 2007_000645.jpg
│ ├── 2007_000648.jpg
│ ├── 2007_000661.jpg
│ ├── 2007_000663.jpg
│ ├── 2007_000664.jpg
│ ├── 2007_000676.jpg
│ ├── 2007_000713.jpg
│ ├── 2007_000720.jpg
│ ├── 2007_000727.jpg
│ ├── 2007_000733.jpg
│ ├── 2007_000738.jpg
│ ├── 2007_000762.jpg
│ ├── 2007_000768.jpg
│ ├── 2007_000783.jpg
│ ├── 2007_000793.jpg
│ ├── 2007_000799.jpg
│ ├── 2007_000804.jpg
│ ├── 2007_000807.jpg
│ ├── 2007_000822.jpg
│ ├── 2007_000830.jpg
│ ├── 2007_000836.jpg
│ ├── 2007_000837.jpg
│ ├── 2007_000847.jpg
│ ├── 2007_000862.jpg
│ ├── 2007_000876.jpg
│ ├── 2007_000904.jpg
│ ├── 2007_000999.jpg
│ ├── 2007_001073.jpg
│ ├── 2007_001154.jpg
│ ├── 2007_001175.jpg
│ ├── 2007_001185.jpg
│ ├── 2007_001225.jpg
│ ├── 2007_001239.jpg
│ ├── 2007_001284.jpg
│ ├── 2007_001288.jpg
│ ├── 2007_001289.jpg
│ ├── 2007_001299.jpg
│ ├── 2007_001311.jpg
│ ├── 2007_001321.jpg
│ ├── 2007_001340.jpg
│ ├── 2007_001377.jpg
│ ├── 2007_001397.jpg
│ ├── 2007_001408.jpg
│ └── 2007_001416.jpg
├── main.py
└── scripts
└── extra
├── README.md
├── class_list.txt
├── convert_dr_darkflow_json.py
├── convert_dr_yolo.py
├── convert_gt_xml.py
├── convert_gt_yolo.py
├── convert_keras-yolo3.py
├── find_class.py
├── intersect-gt-and-dr.py
└── result.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | output/
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # mAP (mean Average Precision)
2 |
3 | [](https://github.com/Cartucho/mAP)
4 |
5 | This code will evaluate the performance of your neural net for object recognition.
6 |
7 |
8 |
9 |
10 |
11 | In practice, a **higher mAP** value indicates a **better performance** of your neural net, given your ground-truth and set of classes.
12 |
13 | ## Citation
14 |
15 | This project was developed for the following paper, please consider citing it:
16 |
17 | ```bibtex
18 | @INPROCEEDINGS{8594067,
19 | author={J. {Cartucho} and R. {Ventura} and M. {Veloso}},
20 | booktitle={2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
21 | title={Robust Object Recognition Through Symbiotic Deep Learning In Mobile Robots},
22 | year={2018},
23 | pages={2336-2341},
24 | }
25 | ```
26 |
27 | ## Table of contents
28 |
29 | - [Explanation](#explanation)
30 | - [Prerequisites](#prerequisites)
31 | - [Quick start](#quick-start)
32 | - [Running the code](#running-the-code)
33 | - [Authors](#authors)
34 |
35 | ## Explanation
36 | The performance of your neural net will be judged using the mAP criterium defined in the [PASCAL VOC 2012 competition](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/). We simply adapted the [official Matlab code](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/#devkit) into Python (in our tests they both give the same results).
37 |
38 | First (**1.**), we calculate the Average Precision (AP), for each of the classes present in the ground-truth. Finally (**2.**), we calculate the mAP (mean Average Precision) value.
39 |
40 | #### 1. Calculate AP
41 |
42 | For each class:
43 |
44 | First, your neural net **detection-results** are sorted by decreasing confidence and are assigned to **ground-truth objects**. We have "a match" when they share the **same label and an IoU >= 0.5** (Intersection over Union greater than 50%). This "match" is considered a true positive if that ground-truth object has not been already used (to avoid multiple detections of the same object).
45 |
46 |
47 |
48 | Using this criterium, we calculate the precision/recall curve. E.g:
49 |
50 |
51 |
52 | Then we compute a version of the measured precision/recall curve with **precision monotonically decreasing** (shown in light red), by setting the precision for recall `r` to the maximum precision obtained for any recall `r' > r`.
53 |
54 | Finally, we compute the AP as the **area under this curve** (shown in light blue) by numerical integration.
55 | No approximation is involved since the curve is piecewise constant.
56 |
57 | #### 2. Calculate mAP
58 |
59 | We calculate the mean of all the AP's, resulting in an mAP value from 0 to 100%. E.g:
60 |
61 |
62 |
63 |
64 |
65 | ## Prerequisites
66 |
67 | You need to install:
68 | - [Python](https://www.python.org/downloads/)
69 |
70 | Optional:
71 | - **plot** the results by [installing Matplotlib](https://matplotlib.org/users/installing.html) - Linux, macOS and Windows:
72 | 1. `python -mpip install -U pip`
73 | 2. `python -mpip install -U matplotlib`
74 | - show **animation** by installing [OpenCV](https://www.opencv.org/):
75 | 1. `python -mpip install -U pip`
76 | 2. `python -mpip install -U opencv-python`
77 |
78 | ## Quick-start
79 | To start using the mAP you need to clone the repo:
80 |
81 | ```
82 | git clone https://github.com/Cartucho/mAP
83 | ```
84 |
85 | ## Running the code
86 |
87 | Step by step:
88 |
89 | 1. [Create the ground-truth files](#create-the-ground-truth-files)
90 | 2. Copy the ground-truth files into the folder **input/ground-truth/**
91 | 3. [Create the detection-results files](#create-the-detection-results-files)
92 | 4. Copy the detection-results files into the folder **input/detection-results/**
93 | 5. Run the code:
94 | ```
95 | python main.py
96 | ```
97 |
98 | Optional (if you want to see the **animation**):
99 |
100 | 6. Insert the images into the folder **input/images-optional/**
101 |
102 |
103 | #### PASCAL VOC, Darkflow and YOLO users
104 |
105 | In the [scripts/extra](https://github.com/Cartucho/mAP/tree/master/scripts/extra) folder you can find additional scripts to convert **PASCAL VOC**, **darkflow** and **YOLO** files into the required format.
106 |
107 | #### Create the ground-truth files
108 |
109 | - Create a separate ground-truth text file for each image.
110 | - Use **matching names** for the files (e.g. image: "image_1.jpg", ground-truth: "image_1.txt").
111 | - In these files, each line should be in the following format:
112 | ```
113 | []
114 | ```
115 | - The `difficult` parameter is optional, use it if you want the calculation to ignore a specific detection.
116 | - E.g. "image_1.txt":
117 | ```
118 | tvmonitor 2 10 173 238
119 | book 439 157 556 241
120 | book 437 246 518 351 difficult
121 | pottedplant 272 190 316 259
122 | ```
123 |
124 | #### Create the detection-results files
125 |
126 | - Create a separate detection-results text file for each image.
127 | - Use **matching names** for the files (e.g. image: "image_1.jpg", detection-results: "image_1.txt").
128 | - In these files, each line should be in the following format:
129 | ```
130 |
131 | ```
132 | - E.g. "image_1.txt":
133 | ```
134 | tvmonitor 0.471781 0 13 174 244
135 | cup 0.414941 274 226 301 265
136 | book 0.460851 429 219 528 247
137 | chair 0.292345 0 199 88 436
138 | book 0.269833 433 260 506 336
139 | ```
140 | ## Authors:
141 | * **João Cartucho**
142 |
143 | Feel free to contribute
144 |
145 | [](https://github.com/Cartucho/mAP/graphs/contributors)
146 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000027.txt:
--------------------------------------------------------------------------------
1 | tvmonitor 0.471781 0 13 174 244
2 | cup 0.414941 274 226 301 265
3 | book 0.460851 429 219 528 247
4 | bottle 0.287150 336 231 376 305
5 | chair 0.292345 0 199 88 436
6 | book 0.269833 433 260 506 336
7 | book 0.462608 518 314 603 369
8 | book 0.298196 592 310 634 388
9 | book 0.382881 403 384 517 461
10 | book 0.369369 405 429 519 470
11 | pottedplant 0.297364 259 183 304 239
12 | pottedplant 0.510713 279 178 340 248
13 | pictureframe 0.261096 187 206 237 258
14 | book 0.272826 433 272 499 341
15 | book 0.619459 413 390 515 459
16 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000032.txt:
--------------------------------------------------------------------------------
1 | tvmonitor 0.452213 503 4 639 127
2 | refrigerator 0.283500 14 18 257 240
3 | book 0.325701 508 167 625 246
4 | book 0.473745 501 225 610 259
5 | bottle 0.569329 417 235 452 311
6 | book 0.352939 503 257 552 350
7 | book 0.356840 531 262 584 356
8 | book 0.271981 585 326 639 384
9 | book 0.354973 466 427 585 470
10 | tvmonitor 0.342337 81 27 227 247
11 | pottedplant 0.521316 341 178 391 251
12 | pictureframe 0.260571 247 205 305 260
13 | book 0.354335 481 400 570 460
14 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000033.txt:
--------------------------------------------------------------------------------
1 | pottedplant 0.529134 3 12 78 153
2 | tvmonitor 0.523199 92 37 193 121
3 | refrigerator 0.386569 63 77 560 477
4 | tvmonitor 0.374142 292 6 438 99
5 | windowblind 0.273336 436 0 564 105
6 | pottedplant 0.346044 13 20 124 173
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000039.txt:
--------------------------------------------------------------------------------
1 | refrigerator 0.537946 482 0 638 275
2 | wastecontainer 0.313999 529 201 593 309
3 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000042.txt:
--------------------------------------------------------------------------------
1 | pottedplant 0.586544 509 1 632 179
2 | tvmonitor 0.338835 555 144 635 204
3 | sofa 0.833625 10 150 209 475
4 | diningtable 0.570301 494 283 638 475
5 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000061.txt:
--------------------------------------------------------------------------------
1 | chair 0.627778 493 111 561 239
2 | diningtable 0.340181 504 102 634 243
3 | chair 0.675353 564 142 639 265
4 | sofa 0.292752 54 82 588 471
5 | remote 0.785086 194 313 312 433
6 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000063.txt:
--------------------------------------------------------------------------------
1 | pottedplant 0.819480 14 52 309 425
2 | pottedplant 0.613840 438 209 539 281
3 | vase 0.551992 214 257 251 295
4 | vase 0.264438 458 256 491 283
5 | windowblind 0.339878 247 0 507 112
6 | pictureframe 0.540837 237 204 418 290
7 | pottedplant 0.728262 426 210 528 286
8 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000068.txt:
--------------------------------------------------------------------------------
1 | tvmonitor 0.355530 0 14 125 147
2 | pottedplant 0.726746 475 0 633 447
3 | vase 0.261603 504 240 623 443
4 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000121.txt:
--------------------------------------------------------------------------------
1 | chair 0.429933 157 154 290 479
2 | diningtable 0.712185 158 154 502 479
3 | cup 0.285480 100 72 119 93
4 | countertop 0.499608 0 87 178 296
5 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000123.txt:
--------------------------------------------------------------------------------
1 | person 0.408621 157 42 193 65
2 | bed 0.363359 1 63 133 215
3 | chair 0.343155 237 121 310 204
4 | bed 0.710099 19 90 143 182
5 | wastecontainer 0.393610 392 228 468 324
6 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000129.txt:
--------------------------------------------------------------------------------
1 | chair 0.459296 267 75 340 135
2 | refrigerator 0.486051 0 12 155 246
3 | chair 0.678557 252 78 352 342
4 | chair 0.616418 396 93 639 335
5 | diningtable 0.485140 260 111 490 369
6 | diningtable 0.537489 244 119 405 355
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000170.txt:
--------------------------------------------------------------------------------
1 | refrigerator 0.303672 0 27 45 154
2 | bowl 0.503095 12 161 105 198
3 | chair 0.631600 313 60 409 285
4 | diningtable 0.306721 0 125 189 294
5 | diningtable 0.401212 300 90 509 302
6 | chair 0.706046 0 154 188 479
7 | door 0.704533 33 14 181 172
8 | cabinetry 0.253778 289 47 452 225
9 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000175.txt:
--------------------------------------------------------------------------------
1 | sofa 0.841393 345 69 624 479
2 | chair 0.342367 297 86 380 222
3 | pillow 0.282579 423 140 526 260
4 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000187.txt:
--------------------------------------------------------------------------------
1 | pottedplant 0.765009 222 4 325 178
2 | pottedplant 0.491541 344 130 369 160
3 | tvmonitor 0.786197 428 42 639 210
4 | sofa 0.791896 3 183 636 460
5 | remote 0.679025 356 311 421 336
6 | pictureframe 0.295145 299 115 349 160
7 | pottedplant 0.312138 352 130 381 181
8 | coffeetable 0.362789 403 166 549 305
9 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000241.txt:
--------------------------------------------------------------------------------
1 | bowl 0.252750 190 96 272 138
2 | bowl 0.774696 215 115 322 153
3 | cup 0.459554 315 94 381 137
4 | sink 0.674897 0 133 235 186
5 | tap 0.361740 111 37 227 143
6 | cabinetry 0.321016 497 55 639 337
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000243.txt:
--------------------------------------------------------------------------------
1 | refrigerator 0.463334 316 75 441 334
2 | windowblind 0.449150 236 0 380 85
3 | bookcase 0.648869 95 0 219 211
4 | coffeetable 0.472681 6 136 134 274
5 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000250.txt:
--------------------------------------------------------------------------------
1 | bottle 0.506194 322 57 341 120
2 | chair 0.250874 462 72 489 120
3 | cup 0.666443 247 130 291 173
4 | diningtable 0.600672 165 129 489 227
5 | chair 0.384535 478 115 556 229
6 | chair 0.420201 489 91 624 254
7 | chair 0.268141 582 113 631 235
8 | chair 0.861616 168 153 357 420
9 | chair 0.765259 394 152 503 401
10 | cabinetry 0.424704 435 63 575 204
11 | chair 0.402742 461 86 555 232
12 | chair 0.676397 155 127 304 445
13 | chair 0.770853 353 161 495 403
14 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000256.txt:
--------------------------------------------------------------------------------
1 | sink 0.553823 397 138 639 222
2 | tap 0.293102 557 34 639 169
3 | wastecontainer 0.314123 205 380 346 479
4 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000272.txt:
--------------------------------------------------------------------------------
1 | chair 0.533144 467 249 593 470
2 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000323.txt:
--------------------------------------------------------------------------------
1 | bottle 0.280955 458 48 494 134
2 | refrigerator 0.356081 434 16 622 243
3 | refrigerator 0.535987 376 94 439 246
4 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000332.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/detection-results/2007_000332.txt
--------------------------------------------------------------------------------
/input/detection-results/2007_000333.txt:
--------------------------------------------------------------------------------
1 | pottedplant 0.426336 511 17 608 108
2 | chair 0.256416 337 95 356 158
3 | chair 0.336040 476 99 585 227
4 | sofa 0.573717 564 120 639 280
5 | diningtable 0.633977 3 95 340 454
6 | chair 0.654364 15 149 205 471
7 | chair 0.720733 474 61 579 261
8 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000346.txt:
--------------------------------------------------------------------------------
1 | bottle 0.739925 359 15 445 263
2 | refrigerator 0.499644 0 4 279 469
3 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000363.txt:
--------------------------------------------------------------------------------
1 | pottedplant 0.542316 3 17 56 91
2 | tvmonitor 0.277761 471 3 566 76
3 | tvmonitor 0.275542 172 48 296 129
4 | sofa 0.316454 0 63 80 274
5 | sofa 0.620831 50 115 467 301
6 | chair 0.306937 446 100 591 278
7 | pottedplant 0.319877 0 13 29 99
8 | tvmonitor 0.385547 179 39 291 144
9 | chair 0.841719 474 89 593 266
10 | chair 0.275912 12 98 131 290
11 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000364.txt:
--------------------------------------------------------------------------------
1 | pottedplant 0.334868 519 9 622 89
2 | chair 0.256941 304 100 346 179
3 | refrigerator 0.332695 360 76 545 230
4 | refrigerator 0.707666 66 86 316 332
5 | chair 0.450818 504 107 639 307
6 | oven 0.536102 0 226 262 479
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000392.txt:
--------------------------------------------------------------------------------
1 | bottle 0.279499 350 41 398 135
2 | bottle 0.419682 0 72 23 173
3 | sink 0.685773 14 128 225 177
4 | cup 0.285873 251 56 306 133
5 | cup 0.417154 291 66 339 132
6 | cabinetry 0.326669 519 29 633 319
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000423.txt:
--------------------------------------------------------------------------------
1 | bottle 0.486727 315 53 367 153
2 | cabinetry 0.272065 364 30 578 228
3 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000452.txt:
--------------------------------------------------------------------------------
1 | bed 0.936491 1 88 599 473
2 | pictureframe 0.374300 199 120 252 153
3 | pictureframe 0.654368 336 113 400 151
4 | nightstand 0.369957 189 141 271 181
5 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000464.txt:
--------------------------------------------------------------------------------
1 | chair 0.606796 44 75 117 194
2 | chair 0.464106 77 80 170 196
3 | chair 0.262397 125 88 211 183
4 | chair 0.375377 184 80 247 174
5 | refrigerator 0.252112 492 75 639 245
6 | remote 0.292862 159 220 217 252
7 | remote 0.440775 178 225 226 246
8 | sofa 0.862613 46 85 521 479
9 | chair 0.284735 25 46 155 228
10 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000480.txt:
--------------------------------------------------------------------------------
1 | refrigerator 0.361779 405 131 638 478
2 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000491.txt:
--------------------------------------------------------------------------------
1 | bottle 0.431028 109 1 151 109
2 | cup 0.444660 58 76 116 123
3 | bowl 0.403386 1 94 63 131
4 | refrigerator 0.466671 0 103 222 469
5 | chair 0.523154 480 169 634 478
6 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000504.txt:
--------------------------------------------------------------------------------
1 | tvmonitor 0.526273 4 9 218 308
2 | book 0.468295 207 251 272 332
3 | oven 0.290283 0 235 134 474
4 | book 0.258227 329 330 419 385
5 | pottedplant 0.269495 347 243 398 297
6 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000515.txt:
--------------------------------------------------------------------------------
1 | bed 0.870608 0 92 442 448
2 | pictureframe 0.286726 497 135 536 172
3 | nightstand 0.432110 470 149 561 268
4 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000528.txt:
--------------------------------------------------------------------------------
1 | pottedplant 0.374484 83 245 159 315
2 | vase 0.486235 102 299 136 341
3 | bottle 0.359365 210 299 267 399
4 | book 0.405094 87 363 198 400
5 | book 0.265792 454 361 549 432
6 | pottedplant 0.533443 74 209 183 333
7 | vase 0.351264 101 279 152 346
8 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000529.txt:
--------------------------------------------------------------------------------
1 | pottedplant 0.869161 385 7 488 182
2 | tvmonitor 0.710095 493 68 639 255
3 | cup 0.257235 438 197 476 230
4 | keyboard 0.431013 492 194 639 255
5 | sofa 0.864148 0 123 153 479
6 | pillow 0.340144 10 145 117 260
7 | coffeetable 0.420287 393 217 568 411
8 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000549.txt:
--------------------------------------------------------------------------------
1 | chair 0.285392 520 81 582 123
2 | chair 0.311403 387 116 446 216
3 | diningtable 0.304130 405 102 540 243
4 | chair 0.389888 486 102 559 234
5 | chair 0.595409 505 87 605 251
6 | chair 0.809926 50 135 192 362
7 | diningtable 0.456562 152 141 284 348
8 | diningtable 0.378174 57 131 385 349
9 | chair 0.784999 245 147 373 379
10 | diningtable 0.478472 456 95 581 220
11 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000559.txt:
--------------------------------------------------------------------------------
1 | chair 0.287470 1 123 80 336
2 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000572.txt:
--------------------------------------------------------------------------------
1 | chair 0.262165 165 72 249 138
2 | pottedplant 0.480055 583 4 639 192
3 | sofa 0.770797 0 99 335 474
4 | chair 0.297908 3 298 176 477
5 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000584.txt:
--------------------------------------------------------------------------------
1 | pottedplant 0.386980 25 243 123 317
2 | book 0.372790 515 238 628 306
3 | book 0.412792 57 373 150 410
4 | book 0.332800 425 377 522 445
5 | pottedplant 0.450679 25 214 135 344
6 | vase 0.377953 47 266 97 352
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000629.txt:
--------------------------------------------------------------------------------
1 | chair 0.315143 105 109 172 206
2 | diningtable 0.264715 523 160 625 234
3 | chair 0.524567 507 195 631 479
4 | countertop 0.489387 252 81 507 275
5 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000636.txt:
--------------------------------------------------------------------------------
1 | book 0.280358 40 0 100 54
2 | chair 0.255882 209 118 266 199
3 | bed 0.263161 33 57 117 194
4 | countertop 0.485044 353 88 601 316
5 | wastecontainer 0.328650 310 202 361 271
6 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000645.txt:
--------------------------------------------------------------------------------
1 | person 0.497034 200 44 234 67
2 | refrigerator 0.490569 99 59 212 252
3 | chair 0.301474 256 115 307 201
4 | bed 0.438210 0 78 140 184
5 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000648.txt:
--------------------------------------------------------------------------------
1 | toilet 0.259917 0 72 456 479
2 | sofa 0.618909 210 127 639 479
3 | chair 0.279172 32 197 500 479
4 | chair 0.360461 209 75 343 202
5 | pillow 0.278384 349 156 502 232
6 | backpack 0.552256 126 249 332 455
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000661.txt:
--------------------------------------------------------------------------------
1 | chair 0.442548 289 68 335 99
2 | chair 0.280312 371 85 443 193
3 | chair 0.287597 13 95 54 247
4 | chair 0.608093 15 104 114 244
5 | chair 0.392649 89 103 153 228
6 | sofa 0.583354 376 133 639 479
7 | chair 0.453748 122 201 622 479
8 | diningtable 0.257117 316 75 446 185
9 | chair 0.366008 353 79 470 191
10 | diningtable 0.351905 10 83 136 250
11 | pillow 0.320190 480 154 555 225
12 | pillow 0.288370 493 165 622 229
13 | sofa 0.305575 432 183 602 392
14 | backpack 0.374395 287 230 466 470
15 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000663.txt:
--------------------------------------------------------------------------------
1 | pottedplant 0.588823 158 0 246 134
2 | tvmonitor 0.667867 306 47 413 138
3 | chair 0.331138 10 87 231 244
4 | chair 0.657345 11 122 327 424
5 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000664.txt:
--------------------------------------------------------------------------------
1 | chair 0.581617 219 78 298 192
2 | chair 0.346867 343 77 402 167
3 | remote 0.537004 337 221 410 257
4 | chair 0.556317 0 84 361 477
5 | sofa 0.737236 200 121 639 455
6 | pillow 0.421205 345 196 502 280
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000676.txt:
--------------------------------------------------------------------------------
1 | refrigerator 0.395208 10 62 241 428
2 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000713.txt:
--------------------------------------------------------------------------------
1 | chair 0.684118 29 81 115 198
2 | diningtable 0.344975 71 92 175 174
3 | chair 0.402527 144 90 202 174
4 | refrigerator 0.396334 491 69 639 247
5 | remote 0.644244 162 234 240 266
6 | sofa 0.843951 27 104 507 466
7 | chair 0.298137 15 118 201 479
8 | diningtable 0.340024 4 82 147 246
9 | pillow 0.399261 330 134 428 269
10 | pillow 0.469166 203 189 360 284
11 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000720.txt:
--------------------------------------------------------------------------------
1 | refrigerator 0.598137 0 98 220 474
2 | chair 0.288888 506 18 624 245
3 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000727.txt:
--------------------------------------------------------------------------------
1 | bottle 0.414083 358 76 378 114
2 | refrigerator 0.283587 4 65 148 284
3 | chair 0.683264 285 97 360 232
4 | toilet 0.616908 359 100 632 468
5 | cabinetry 0.308908 120 10 305 181
6 | countertop 0.560036 16 51 159 297
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000733.txt:
--------------------------------------------------------------------------------
1 | bottle 0.481664 542 44 600 130
2 | refrigerator 0.327573 86 10 547 471
3 | wastecontainer 0.290803 335 329 475 473
4 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000738.txt:
--------------------------------------------------------------------------------
1 | chair 0.697611 31 72 114 197
2 | chair 0.385118 129 88 196 164
3 | remote 0.634198 170 226 238 260
4 | sofa 0.839692 36 103 495 471
5 | pillow 0.278028 385 144 439 206
6 | pillow 0.317325 321 140 430 255
7 | pillow 0.431206 185 196 355 272
8 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000762.txt:
--------------------------------------------------------------------------------
1 | chair 0.300086 422 76 521 186
2 | chair 0.730814 95 106 169 245
3 | diningtable 0.659045 104 109 253 245
4 | chair 0.788522 190 107 279 240
5 | chair 0.253207 301 88 616 466
6 | sofa 0.421262 491 156 639 383
7 | pillow 0.270063 593 169 634 227
8 | backpack 0.411606 374 231 568 466
9 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000768.txt:
--------------------------------------------------------------------------------
1 | refrigerator 0.712861 283 94 639 468
2 | windowblind 0.319139 102 0 345 110
3 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000783.txt:
--------------------------------------------------------------------------------
1 | toothbrush 0.452562 359 74 405 204
2 | chair 0.665166 7 200 126 294
3 | diningtable 0.471159 28 197 302 298
4 | cup 0.312791 413 232 486 301
5 | diningtable 0.285083 19 208 622 479
6 | chair 0.268750 10 237 120 397
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000793.txt:
--------------------------------------------------------------------------------
1 | refrigerator 0.326107 6 49 163 278
2 | refrigerator 0.579474 236 86 411 295
3 | chair 0.517205 544 110 624 267
4 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000799.txt:
--------------------------------------------------------------------------------
1 | person 0.383060 516 31 587 86
2 | bed 0.848061 5 96 478 456
3 | pictureframe 0.253355 151 123 202 150
4 | nightstand 0.344821 139 137 218 178
5 | pictureframe 0.330341 552 134 596 171
6 | nightstand 0.595493 515 149 630 277
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000804.txt:
--------------------------------------------------------------------------------
1 | chair 0.407449 528 189 630 273
2 | diningtable 0.704756 490 212 637 477
3 | tap 0.450086 152 66 205 126
4 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000807.txt:
--------------------------------------------------------------------------------
1 | diningtable 0.319920 229 96 307 175
2 | chair 0.609371 277 87 357 182
3 | chair 0.397800 329 77 377 173
4 | chair 0.743866 0 88 365 479
5 | sofa 0.780272 205 101 627 472
6 | chair 0.285667 202 45 361 218
7 | pillow 0.338145 410 202 534 291
8 | pillow 0.291803 441 195 579 336
9 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000822.txt:
--------------------------------------------------------------------------------
1 | chair 0.364822 7 93 227 466
2 | chair 0.467128 3 218 134 479
3 | backpack 0.350580 20 133 121 333
4 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000830.txt:
--------------------------------------------------------------------------------
1 | refrigerator 0.455136 223 3 410 209
2 | chair 0.776692 196 167 339 199
3 | refrigerator 0.522709 413 72 582 245
4 | cup 0.723936 25 191 93 257
5 | cup 0.323463 122 215 184 257
6 | diningtable 0.619161 12 211 511 471
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000836.txt:
--------------------------------------------------------------------------------
1 | chair 0.447598 103 95 168 177
2 | diningtable 0.258219 139 93 226 178
3 | chair 0.588726 183 84 246 175
4 | sofa 0.888695 84 111 526 460
5 | chair 0.581266 1 124 243 476
6 | pottedplant 0.430453 146 57 273 201
7 | pillow 0.266013 231 168 297 222
8 | pillow 0.403415 319 201 421 282
9 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000837.txt:
--------------------------------------------------------------------------------
1 | bed 0.930039 12 91 586 467
2 | heater 0.340766 151 112 204 162
3 | pictureframe 0.287067 208 123 253 155
4 | pictureframe 0.265741 334 118 385 151
5 | heater 0.399949 139 136 213 174
6 | nightstand 0.440801 187 141 268 183
7 | backpack 0.552314 45 216 220 313
8 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000847.txt:
--------------------------------------------------------------------------------
1 | pottedplant 0.794246 334 3 432 175
2 | tvmonitor 0.739287 465 10 639 312
3 | cup 0.257921 418 223 451 258
4 | bowl 0.575326 412 253 496 305
5 | diningtable 0.630522 275 212 627 475
6 | pictureframe 0.378338 408 132 448 200
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000862.txt:
--------------------------------------------------------------------------------
1 | pottedplant 0.728396 362 3 480 177
2 | tvmonitor 0.515889 478 51 639 274
3 | laptop 0.369974 562 203 639 285
4 | sofa 0.682094 0 122 75 444
5 | bowl 0.392438 438 250 532 303
6 | book 0.464414 460 290 561 329
7 | diningtable 0.545966 300 208 630 478
8 | lamp 0.299307 422 7 491 187
9 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000876.txt:
--------------------------------------------------------------------------------
1 | vase 0.601586 277 96 325 253
2 | chair 0.567982 0 174 111 282
3 | book 0.252957 6 191 294 291
4 | diningtable 0.397695 62 205 552 342
5 | refrigerator 0.551441 498 69 638 474
6 | chair 0.684243 0 193 132 436
7 | chair 0.302830 137 328 526 473
8 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000904.txt:
--------------------------------------------------------------------------------
1 | chair 0.556269 451 68 514 201
2 | chair 0.256938 479 79 543 221
3 | chair 0.508078 189 108 294 281
4 | diningtable 0.651619 235 104 418 280
5 | chair 0.661377 294 113 415 275
6 | cabinetry 0.253241 414 21 542 170
7 | chair 0.530137 307 114 421 269
8 |
--------------------------------------------------------------------------------
/input/detection-results/2007_000999.txt:
--------------------------------------------------------------------------------
1 | bowl 0.273927 272 97 332 149
2 | cup 0.383205 330 95 385 139
3 | sink 0.600430 0 124 279 191
4 | tap 0.385225 157 33 274 155
5 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001073.txt:
--------------------------------------------------------------------------------
1 | diningtable 0.427094 234 110 388 164
2 | chair 0.752864 476 95 569 238
3 | diningtable 0.340147 492 86 624 228
4 | chair 0.706263 180 124 304 338
5 | diningtable 0.737078 187 116 444 339
6 | chair 0.811449 315 125 441 337
7 | door 0.265961 255 12 360 116
8 | cabinetry 0.632075 455 55 580 199
9 | chair 0.851917 161 130 288 352
10 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001154.txt:
--------------------------------------------------------------------------------
1 | refrigerator 0.258286 572 41 616 136
2 | chair 0.702139 373 142 496 343
3 | diningtable 0.655770 399 123 625 359
4 | oven 0.332659 0 82 147 479
5 | chair 0.625771 515 171 638 371
6 | refrigerator 0.463671 2 140 145 469
7 | door 0.299166 446 14 575 119
8 | cabinetry 0.283256 163 16 382 229
9 | chair 0.741752 362 126 486 378
10 | chair 0.297665 567 157 634 397
11 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001175.txt:
--------------------------------------------------------------------------------
1 | chair 0.333591 0 97 272 231
2 | refrigerator 0.274440 385 62 553 286
3 | chair 0.695876 1 70 278 479
4 | chair 0.251675 223 12 319 232
5 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001185.txt:
--------------------------------------------------------------------------------
1 | chair 0.263912 11 29 214 215
2 | laptop 0.572785 140 106 432 216
3 | chair 0.268733 138 76 423 479
4 | sofa 0.436822 0 165 210 469
5 | tvmonitor 0.708856 36 26 184 174
6 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001225.txt:
--------------------------------------------------------------------------------
1 | oven 0.461092 187 182 325 279
2 | pottedplant 0.483013 456 238 515 314
3 | vase 0.380704 463 289 492 334
4 | diningtable 0.392470 304 290 639 479
5 | pictureframe 0.415511 328 247 411 335
6 | coffeetable 0.423677 45 257 210 445
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001239.txt:
--------------------------------------------------------------------------------
1 | pottedplant 0.431331 120 59 221 145
2 | chair 0.279715 434 112 638 443
3 | sofa 0.809609 16 140 456 460
4 | tvmonitor 0.842078 320 25 449 171
5 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001284.txt:
--------------------------------------------------------------------------------
1 | chair 0.508290 452 90 565 250
2 | chair 0.272149 525 105 613 234
3 | chair 0.672911 131 140 301 354
4 | diningtable 0.758570 137 123 399 360
5 | chair 0.752356 294 134 407 356
6 | door 0.370938 212 8 316 122
7 | cabinetry 0.553859 425 57 545 198
8 | diningtable 0.503265 456 87 558 232
9 | chair 0.734819 114 132 244 373
10 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001288.txt:
--------------------------------------------------------------------------------
1 | bottle 0.345662 218 55 237 121
2 | bottle 0.408759 478 109 494 142
3 | chair 0.550121 354 81 468 267
4 | chair 0.252585 395 86 546 260
5 | diningtable 0.558273 0 138 322 260
6 | chair 0.353948 0 193 141 439
7 | diningtable 0.635992 12 133 338 479
8 | chair 0.733928 184 177 329 455
9 | door 0.778941 56 34 196 142
10 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001289.txt:
--------------------------------------------------------------------------------
1 | bottle 0.324319 190 52 226 132
2 | bottle 0.698600 238 29 270 130
3 | cup 0.406768 105 95 153 143
4 | sink 0.591608 0 135 93 172
5 | cup 0.378816 152 44 203 135
6 | cup 0.452174 193 52 233 126
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001299.txt:
--------------------------------------------------------------------------------
1 | bottle 0.452056 310 42 336 86
2 | bottle 0.302484 218 64 256 136
3 | bottle 0.533752 268 55 300 133
4 | bottle 0.587681 299 36 333 129
5 | cup 0.552031 173 100 214 147
6 | sink 0.679296 1 130 161 180
7 | cup 0.353450 207 49 254 133
8 | cup 0.534974 245 51 288 133
9 | cabinetry 0.329424 458 59 603 325
10 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001311.txt:
--------------------------------------------------------------------------------
1 | cup 0.290321 142 61 180 128
2 | sink 0.523856 21 124 227 165
3 | cup 0.427046 147 53 183 129
4 | cabinetry 0.290274 344 19 518 245
5 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001321.txt:
--------------------------------------------------------------------------------
1 | cup 0.375738 183 61 220 124
2 | cup 0.400132 12 88 80 159
3 | sink 0.340414 60 123 269 159
4 | cup 0.350947 196 52 231 125
5 | cabinetry 0.334059 387 12 572 259
6 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001340.txt:
--------------------------------------------------------------------------------
1 | refrigerator 0.464590 3 111 126 448
2 | chair 0.700177 421 159 630 475
3 | cabinetry 0.282210 100 44 268 279
4 | chair 0.553875 432 193 596 438
5 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001377.txt:
--------------------------------------------------------------------------------
1 | cup 0.406530 540 159 581 196
2 | cup 0.301408 543 164 607 223
3 | chair 0.407069 364 189 561 451
4 | diningtable 0.588653 358 172 639 467
5 | chair 0.615548 502 286 639 479
6 | chair 0.343976 358 204 483 429
7 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001397.txt:
--------------------------------------------------------------------------------
1 | refrigerator 0.317886 344 2 511 196
2 | knife 0.289666 421 179 450 225
3 | cup 0.328248 434 164 490 230
4 | bowl 0.400904 547 174 612 203
5 | chair 0.463983 267 182 316 297
6 | diningtable 0.703826 297 167 639 299
7 | diningtable 0.737026 288 188 639 454
8 | chair 0.815706 257 199 460 479
9 | chair 0.380250 477 302 639 478
10 | door 0.380337 518 50 639 206
11 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001408.txt:
--------------------------------------------------------------------------------
1 | refrigerator 0.354066 382 5 539 189
2 | bowl 0.686128 532 170 614 207
3 | chair 0.272917 234 185 287 300
4 | diningtable 0.686113 283 178 639 301
5 | chair 0.871721 230 188 427 479
6 | diningtable 0.762118 249 192 639 479
7 | chair 0.380538 420 312 637 476
8 | tincan 0.276966 408 171 456 226
9 | bowl 0.475870 481 177 549 226
10 |
--------------------------------------------------------------------------------
/input/detection-results/2007_001416.txt:
--------------------------------------------------------------------------------
1 | diningtable 0.287053 503 91 626 249
2 | chair 0.604232 588 97 638 244
3 | chair 0.760756 174 134 286 333
4 | diningtable 0.444395 241 128 399 336
5 | chair 0.766452 348 137 456 353
6 | chair 0.773860 168 111 294 364
7 | chair 0.644847 281 115 470 368
8 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000027.txt:
--------------------------------------------------------------------------------
1 | pictureframe 176 206 225 266
2 | heater 170 156 350 240
3 | pottedplant 272 190 316 259
4 | book 439 157 556 241
5 | book 437 246 518 351
6 | book 515 306 595 375
7 | book 407 386 531 476
8 | book 544 419 621 476
9 | book 609 297 636 392
10 | coffeetable 172 251 406 476
11 | coffeetable 2 236 102 395
12 | tvmonitor 2 10 173 238
13 | bookcase 395 2 639 470
14 | doll 482 83 515 107
15 | vase 276 233 304 259
16 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000032.txt:
--------------------------------------------------------------------------------
1 | pictureframe 247 205 292 265
2 | heater 241 157 418 245
3 | pottedplant 339 192 385 264
4 | tvmonitor 33 18 242 231
5 | book 506 254 599 361
6 | book 514 159 639 251
7 | book 477 401 592 476
8 | book 593 330 637 387
9 | bookcase 464 2 637 473
10 | vase 343 235 368 259
11 | coffeetable 245 249 483 476
12 | coffeetable 1 215 172 455
13 | doll 563 87 597 113
14 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000033.txt:
--------------------------------------------------------------------------------
1 | pottedplant 4 13 79 154
2 | tvmonitor 93 37 194 121
3 | shelf 277 2 444 101
4 | windowblind 469 4 552 91
5 | coffeetable 11 152 84 250
6 | door 516 5 638 410
7 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000039.txt:
--------------------------------------------------------------------------------
1 | wastecontainer 528 213 602 300
2 | nightstand 47 115 84 199
3 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000042.txt:
--------------------------------------------------------------------------------
1 | pottedplant 510 2 633 179
2 | pictureframe 556 145 636 205
3 | sofa 11 151 210 476
4 | coffeetable 495 283 639 475
5 | pillow 3 145 90 301
6 | coffeetable 518 177 636 271
7 | chair 3 79 90 183
8 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000061.txt:
--------------------------------------------------------------------------------
1 | chair 494 111 562 239
2 | diningtable 505 103 635 244
3 | chair 565 142 640 265
4 | remote 195 313 313 433
5 | chair 30 97 415 481
6 | pillow 117 226 338 406
7 | cup 311 62 330 97
8 | cabinetry 353 2 629 200
9 | sofa 146 229 636 481
10 | cup 328 67 343 90
11 | tap 291 65 302 88
12 | cup 603 112 628 130
13 | shelf 233 1 353 49
14 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000063.txt:
--------------------------------------------------------------------------------
1 | pottedplant 4 12 297 382
2 | pottedplant 439 210 540 282
3 | vase 215 257 252 296
4 | pictureframe 266 207 397 303
5 | coffeetable 185 256 530 447
6 | windowblind 165 4 483 91
7 | vase 474 260 504 299
8 | vase 110 341 189 440
9 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000068.txt:
--------------------------------------------------------------------------------
1 | tvmonitor 1 14 126 147
2 | pottedplant 476 1 634 448
3 | tvmonitor 360 31 437 115
4 | vase 527 356 603 446
5 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000121.txt:
--------------------------------------------------------------------------------
1 | chair 158 155 291 479
2 | diningtable 159 155 503 479
3 | tincan 313 133 352 209
4 | countertop 3 87 190 263
5 | cup 91 70 119 98
6 | sink 3 59 101 102
7 | cabinetry 181 1 635 272
8 | cup 258 154 292 190
9 | cup 288 144 316 177
10 | tap 3 67 27 94
11 | chair 163 180 334 468
12 | chair 359 145 505 407
13 | chair 192 140 305 388
14 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000123.txt:
--------------------------------------------------------------------------------
1 | person 158 42 194 65
2 | bed 2 63 134 215
3 | wastecontainer 390 228 480 329
4 | tincan 494 68 538 113
5 | countertop 461 104 638 350
6 | tap 571 74 605 110
7 | person 324 47 352 71
8 | pillow 2 96 36 114
9 | pillow 42 94 103 116
10 | cup 622 73 640 116
11 | sink 510 102 622 120
12 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000129.txt:
--------------------------------------------------------------------------------
1 | door 1 13 156 247
2 | chair 253 79 402 333
3 | diningtable 261 112 491 370
4 | cabinetry 209 4 504 228
5 | bottle 393 82 442 154
6 | cup 316 114 366 149
7 | doll 433 131 448 164
8 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000170.txt:
--------------------------------------------------------------------------------
1 | bowl 13 161 106 198
2 | chair 314 61 410 286
3 | diningtable 1 125 190 294
4 | diningtable 301 90 510 302
5 | chair 1 155 189 479
6 | door 20 1 189 196
7 | doll 89 147 112 176
8 | cabinetry 237 4 471 188
9 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000175.txt:
--------------------------------------------------------------------------------
1 | sofa 346 172 625 479
2 | chair 291 87 421 196
3 | backpack 468 211 635 316
4 | backpack 356 129 409 182
5 | pottedplant 625 92 639 150
6 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000187.txt:
--------------------------------------------------------------------------------
1 | pottedplant 223 4 326 178
2 | pottedplant 345 130 370 160
3 | tvmonitor 429 43 640 211
4 | sofa 4 184 637 461
5 | remote 351 299 424 341
6 | pictureframe 279 114 339 161
7 | backpack 66 209 281 322
8 | tvmonitor 21 56 107 74
9 | vase 250 170 278 198
10 | windowblind 304 7 432 73
11 | coffeetable 282 147 376 213
12 | coffeetable 386 175 611 304
13 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000241.txt:
--------------------------------------------------------------------------------
1 | cabinetry 451 8 639 317
2 | cup 320 93 390 152
3 | countertop 1 116 498 479
4 | bowl 222 113 316 155
5 | bowl 193 95 268 138
6 | tap 103 64 174 134
7 | sink 7 125 379 194
8 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000243.txt:
--------------------------------------------------------------------------------
1 | shelf 76 1 230 254
2 | coffeetable 6 156 88 260
3 | book 99 197 164 234
4 | windowblind 204 1 364 82
5 | door 508 2 578 199
6 | door 373 2 455 218
7 | windowblind 600 3 637 84
8 | book 91 95 144 126
9 | book 167 107 215 125
10 | book 169 145 223 175
11 | book 100 134 136 175
12 | book 141 157 167 175
13 | book 168 205 209 229
14 | pottedplant 3 125 24 167
15 | bookcase 80 3 225 237
16 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000250.txt:
--------------------------------------------------------------------------------
1 | cup 248 131 292 173
2 | chair 462 76 557 229
3 | chair 169 154 358 421
4 | diningtable 156 139 500 421
5 | chair 395 153 504 402
6 | tincan 381 116 412 170
7 | tincan 354 115 376 177
8 | diningtable 458 104 635 264
9 | bowl 290 134 335 152
10 | door 206 4 290 130
11 | cabinetry 5 8 175 226
12 | doll 577 112 599 133
13 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000256.txt:
--------------------------------------------------------------------------------
1 | sink 398 139 640 223
2 | wastecontainer 182 390 335 481
3 | tap 569 51 634 179
4 | countertop 319 97 635 481
5 | person 108 34 144 65
6 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000272.txt:
--------------------------------------------------------------------------------
1 | cabinetry 5 1 635 324
2 | chair 457 225 635 481
3 | diningtable 494 208 635 338
4 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000323.txt:
--------------------------------------------------------------------------------
1 | cabinetry 3 1 386 421
2 | door 376 1 445 259
3 | cabinetry 480 2 637 228
4 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000332.txt:
--------------------------------------------------------------------------------
1 | cabinetry 5 2 637 476
2 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000333.txt:
--------------------------------------------------------------------------------
1 | pottedplant 512 17 609 108
2 | chair 477 75 586 227
3 | sofa 565 121 640 281
4 | diningtable 4 95 341 455
5 | chair 16 149 206 471
6 | chair 338 92 358 171
7 | pictureframe 576 107 603 134
8 | windowblind 561 4 633 70
9 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000346.txt:
--------------------------------------------------------------------------------
1 | door 3 1 299 475
2 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000363.txt:
--------------------------------------------------------------------------------
1 | pottedplant 4 17 57 92
2 | sofa 51 115 468 301
3 | chair 455 89 600 284
4 | chair 3 67 113 319
5 | tvmonitor 168 43 320 147
6 | pillow 130 105 228 164
7 | pillow 228 115 329 159
8 | pillow 330 125 416 155
9 | shelf 391 1 499 151
10 | windowblind 485 1 558 85
11 | pottedplant 89 107 121 144
12 | book 450 98 479 105
13 | book 411 91 432 110
14 | book 441 118 478 139
15 | windowblind 8 1 131 70
16 | pictureframe 319 115 338 139
17 | pictureframe 47 107 72 137
18 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000364.txt:
--------------------------------------------------------------------------------
1 | pottedplant 520 9 623 89
2 | chair 501 88 636 308
3 | diningtable 1 227 263 479
4 | chair 312 87 356 196
5 | tvmonitor 425 58 468 79
6 | tvmonitor 483 51 511 74
7 | windowblind 576 3 638 84
8 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000392.txt:
--------------------------------------------------------------------------------
1 | cabinetry 452 18 633 327
2 | cup 261 60 302 156
3 | cup 300 48 345 147
4 | countertop 8 115 490 476
5 | tap 116 69 186 138
6 | tincan 228 62 270 148
7 | bottle 2 28 27 169
8 | sink 14 115 365 179
9 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000423.txt:
--------------------------------------------------------------------------------
1 | cabinetry 391 6 638 225
2 | door 92 1 279 245
3 | diningtable 70 209 639 461
4 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000452.txt:
--------------------------------------------------------------------------------
1 | bed 3 91 603 479
2 | pictureframe 249 126 286 153
3 | nightstand 200 141 302 185
4 | heater 147 130 237 179
5 | windowblind 5 2 152 77
6 | pillow 312 86 420 170
7 | pillow 433 112 589 202
8 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000464.txt:
--------------------------------------------------------------------------------
1 | pillow 161 170 331 261
2 | pillow 278 134 364 259
3 | pillow 349 110 426 236
4 | cabinetry 43 11 228 152
5 | chair 2 105 257 480
6 | chair 364 77 438 152
7 | chair 50 67 153 193
8 | diningtable 86 99 204 191
9 | sofa 59 141 522 471
10 | remote 153 214 230 259
11 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000480.txt:
--------------------------------------------------------------------------------
1 | cabinetry 8 8 284 271
2 | diningtable 3 186 233 468
3 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000491.txt:
--------------------------------------------------------------------------------
1 | cabinetry 144 5 636 245
2 | chair 457 187 638 475
3 | cup 61 72 123 120
4 | countertop 2 103 214 475
5 | bowl 4 91 58 134
6 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000504.txt:
--------------------------------------------------------------------------------
1 | pictureframe 206 248 278 335
2 | heater 205 173 424 296
3 | pottedplant 330 231 396 330
4 | tvmonitor 2 10 205 293
5 | vase 335 281 376 329
6 | coffeetable 205 305 563 476
7 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000515.txt:
--------------------------------------------------------------------------------
1 | bed 2 94 441 457
2 | person 471 46 525 88
3 | pictureframe 489 140 529 167
4 | pictureframe 159 125 186 146
5 | nightstand 469 157 565 284
6 | nightstand 116 138 205 179
7 | heater 58 125 153 164
8 | windowblind 2 1 60 82
9 | pillow 213 90 299 157
10 | pillow 316 111 426 173
11 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000528.txt:
--------------------------------------------------------------------------------
1 | heater 3 198 196 299
2 | pottedplant 82 246 160 345
3 | book 329 191 506 302
4 | book 344 318 441 432
5 | book 450 363 543 453
6 | book 568 236 630 316
7 | book 557 348 631 462
8 | bookcase 318 3 635 471
9 | vase 95 292 142 346
10 | coffeetable 18 324 314 477
11 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000529.txt:
--------------------------------------------------------------------------------
1 | pictureframe 425 125 473 160
2 | heater 454 111 498 159
3 | pillow 5 151 75 223
4 | pottedplant 391 5 492 146
5 | tvmonitor 506 20 639 242
6 | sofa 3 143 154 476
7 | coffeetable 363 209 611 414
8 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000549.txt:
--------------------------------------------------------------------------------
1 | cabinetry 346 11 546 167
2 | door 183 14 284 129
3 | chair 54 151 209 337
4 | chair 150 119 272 276
5 | chair 240 154 380 364
6 | chair 512 73 595 235
7 | diningtable 104 134 352 328
8 | diningtable 397 108 566 252
9 | cup 152 119 185 156
10 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000559.txt:
--------------------------------------------------------------------------------
1 | chair 576 93 635 419
2 | diningtable 2 141 82 317
3 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000572.txt:
--------------------------------------------------------------------------------
1 | pillow 41 144 172 240
2 | pillow 128 132 226 237
3 | pillow 191 140 277 219
4 | pottedplant 596 1 636 217
5 | chair 175 76 253 136
6 | chair 14 318 193 477
7 | sofa 14 137 339 474
8 | coffeetable 543 224 635 446
9 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000584.txt:
--------------------------------------------------------------------------------
1 | heater 5 210 164 308
2 | pottedplant 33 250 122 353
3 | book 293 185 453 317
4 | book 318 325 413 436
5 | book 427 370 524 449
6 | book 521 204 639 312
7 | book 509 333 638 465
8 | bookcase 280 4 635 472
9 | vase 54 306 107 360
10 | coffeetable 19 332 283 477
11 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000629.txt:
--------------------------------------------------------------------------------
1 | chair 448 211 634 475
2 | chair 542 130 633 448
3 | diningtable 519 173 638 443
4 | cup 393 59 409 98
5 | cup 407 53 429 101
6 | countertop 259 83 504 288
7 | tap 330 63 365 96
8 | wastecontainer 203 188 262 258
9 | tincan 372 61 385 97
10 | bottle 429 46 457 92
11 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000636.txt:
--------------------------------------------------------------------------------
1 | bed 1 73 98 196
2 | person 149 44 189 67
3 | shelf 372 3 549 54
4 | cup 515 65 533 107
5 | cup 534 59 559 114
6 | countertop 362 96 631 290
7 | tap 451 70 489 104
8 | wastecontainer 307 207 369 273
9 | tincan 493 67 513 106
10 | bottle 562 52 594 106
11 | bottle 401 47 422 107
12 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000645.txt:
--------------------------------------------------------------------------------
1 | bed 2 73 99 199
2 | person 200 43 237 70
3 | pictureframe 7 85 28 103
4 | pillow 39 67 101 106
5 | cup 531 87 580 122
6 | countertop 390 98 629 335
7 | tap 475 69 525 110
8 | wastecontainer 307 218 376 296
9 | sink 425 85 607 131
10 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000648.txt:
--------------------------------------------------------------------------------
1 | pillow 347 144 453 239
2 | pillow 423 138 509 243
3 | pillow 486 143 566 232
4 | cabinetry 109 4 297 119
5 | door 2 8 69 102
6 | chair 1 95 454 476
7 | chair 470 82 532 148
8 | chair 158 64 205 106
9 | diningtable 228 94 284 194
10 | backpack 199 206 347 413
11 | backpack 68 250 264 476
12 | sofa 235 143 633 476
13 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000661.txt:
--------------------------------------------------------------------------------
1 | pillow 469 151 594 251
2 | pillow 548 148 638 262
3 | cabinetry 1 5 109 155
4 | cabinetry 244 5 416 122
5 | door 115 8 194 98
6 | chair 152 100 577 476
7 | chair 10 106 99 241
8 | chair 105 113 157 248
9 | chair 288 59 331 98
10 | diningtable 22 101 149 247
11 | diningtable 354 96 402 197
12 | backpack 203 239 376 468
13 | backpack 324 206 463 419
14 | tincan 81 87 103 122
15 | tincan 107 88 125 124
16 | sofa 388 140 638 471
17 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000663.txt:
--------------------------------------------------------------------------------
1 | pictureframe 412 130 439 157
2 | pictureframe 205 100 244 127
3 | heater 414 115 500 157
4 | windowblind 246 4 317 64
5 | pottedplant 168 8 236 152
6 | pottedplant 242 106 266 130
7 | pottedplant 460 123 480 162
8 | chair 8 86 324 449
9 | tvmonitor 283 42 418 144
10 | sofa 2 115 232 364
11 | coffeetable 235 136 374 227
12 | coffeetable 423 153 529 249
13 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000664.txt:
--------------------------------------------------------------------------------
1 | pillow 377 190 529 295
2 | pillow 378 151 513 239
3 | pillow 490 140 613 234
4 | cabinetry 205 10 384 124
5 | door 84 4 172 88
6 | chair 2 91 373 475
7 | chair 211 68 295 191
8 | chair 520 77 603 158
9 | diningtable 246 92 355 177
10 | sofa 226 135 636 471
11 | remote 322 212 419 260
12 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000676.txt:
--------------------------------------------------------------------------------
1 | cabinetry 471 5 637 173
2 | countertop 387 75 527 303
3 | wastecontainer 362 220 423 298
4 | bowl 468 84 496 104
5 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000713.txt:
--------------------------------------------------------------------------------
1 | pillow 202 186 355 284
2 | pillow 210 144 353 240
3 | pillow 318 139 427 220
4 | cabinetry 33 6 220 143
5 | chair 3 138 220 476
6 | chair 20 66 121 200
7 | chair 348 72 514 249
8 | diningtable 56 97 193 200
9 | sofa 46 145 506 442
10 | remote 150 225 246 272
11 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000720.txt:
--------------------------------------------------------------------------------
1 | tvmonitor 101 46 163 67
2 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000727.txt:
--------------------------------------------------------------------------------
1 | cabinetry 89 11 390 171
2 | door 400 7 493 97
3 | chair 358 104 638 476
4 | diningtable 319 97 375 193
5 | countertop 12 80 170 286
6 | tap 40 61 75 88
7 | wastecontainer 3 230 64 314
8 | bottle 362 64 381 118
9 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000733.txt:
--------------------------------------------------------------------------------
1 | countertop 390 100 623 475
2 | tap 469 70 529 121
3 | wastecontainer 325 355 464 476
4 | sink 415 105 614 146
5 | bottle 559 41 609 131
6 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000738.txt:
--------------------------------------------------------------------------------
1 | pillow 209 184 362 289
2 | pillow 217 148 361 236
3 | pillow 326 134 442 216
4 | cabinetry 35 7 239 130
5 | chair 2 101 224 476
6 | chair 28 64 124 190
7 | chair 354 77 514 259
8 | diningtable 79 94 196 181
9 | sofa 31 147 506 480
10 | remote 163 218 256 260
11 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000762.txt:
--------------------------------------------------------------------------------
1 | pillow 588 167 635 231
2 | cabinetry 5 9 186 158
3 | cabinetry 306 8 483 109
4 | door 179 9 259 135
5 | chair 297 101 637 476
6 | chair 93 107 190 231
7 | chair 183 111 286 240
8 | chair 351 55 390 103
9 | chair 158 97 213 230
10 | diningtable 112 104 265 236
11 | backpack 353 240 503 465
12 | backpack 447 212 593 431
13 | tincan 164 84 177 120
14 | tincan 187 85 204 116
15 | sofa 504 152 638 387
16 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000768.txt:
--------------------------------------------------------------------------------
1 | windowblind 121 6 377 87
2 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000783.txt:
--------------------------------------------------------------------------------
1 | cabinetry 4 2 449 265
2 | door 494 5 636 248
3 | chair 10 200 226 475
4 | chair 220 385 635 473
5 | diningtable 18 190 634 464
6 | cup 424 222 476 306
7 | cup 143 183 217 239
8 | bottle 283 73 333 244
9 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000793.txt:
--------------------------------------------------------------------------------
1 | cabinetry 374 4 635 160
2 | shelf 247 3 334 57
3 | chair 544 116 636 262
4 | countertop 249 92 415 281
5 | tap 302 66 339 96
6 | wastecontainer 245 226 309 305
7 | bottle 366 49 394 95
8 | tincan 356 56 380 101
9 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000799.txt:
--------------------------------------------------------------------------------
1 | bed 4 87 492 476
2 | person 521 35 596 86
3 | pictureframe 542 138 593 170
4 | pictureframe 191 120 223 144
5 | nightstand 518 160 631 301
6 | nightstand 149 138 242 176
7 | heater 93 125 174 166
8 | windowblind 3 1 98 79
9 | pillow 246 83 345 156
10 | pillow 350 107 469 178
11 | backpack 59 189 228 288
12 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000804.txt:
--------------------------------------------------------------------------------
1 | cabinetry 393 7 631 253
2 | chair 483 199 636 476
3 | diningtable 486 223 631 346
4 | cup 224 80 262 120
5 | countertop 24 97 399 389
6 | tap 138 62 197 107
7 | wastecontainer 2 273 42 381
8 | sink 92 95 255 131
9 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000807.txt:
--------------------------------------------------------------------------------
1 | pillow 375 175 491 308
2 | pillow 314 171 417 231
3 | pillow 412 160 527 257
4 | cabinetry 206 14 381 145
5 | door 71 4 165 97
6 | chair 4 87 368 470
7 | chair 501 83 593 167
8 | chair 291 65 366 170
9 | diningtable 227 92 348 180
10 | sofa 214 142 636 469
11 | remote 498 240 562 270
12 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000822.txt:
--------------------------------------------------------------------------------
1 | cabinetry 18 4 341 175
2 | chair 9 83 140 476
3 | diningtable 14 200 214 478
4 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000830.txt:
--------------------------------------------------------------------------------
1 | door 416 7 597 233
2 | chair 202 166 361 409
3 | chair 18 408 489 477
4 | diningtable 7 192 518 459
5 | cup 28 183 94 263
6 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000836.txt:
--------------------------------------------------------------------------------
1 | pillow 247 168 373 300
2 | pillow 190 162 296 219
3 | pillow 296 149 400 239
4 | cabinetry 79 5 264 153
5 | chair 4 97 259 476
6 | chair 389 77 545 263
7 | diningtable 107 93 231 176
8 | sofa 85 137 521 473
9 | remote 378 229 436 257
10 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000837.txt:
--------------------------------------------------------------------------------
1 | bed 2 94 589 478
2 | pictureframe 235 128 274 152
3 | nightstand 189 144 293 194
4 | heater 135 123 220 182
5 | windowblind 2 4 141 79
6 | pillow 300 85 408 166
7 | pillow 426 111 569 200
8 | backpack 65 212 274 330
9 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000847.txt:
--------------------------------------------------------------------------------
1 | pictureframe 367 130 419 172
2 | pottedplant 329 2 441 212
3 | tvmonitor 460 19 638 284
4 | tvmonitor 119 50 204 80
5 | coffeetable 288 217 589 466
6 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000862.txt:
--------------------------------------------------------------------------------
1 | pictureframe 402 128 453 171
2 | heater 423 120 485 170
3 | pottedplant 371 6 468 180
4 | tvmonitor 492 2 640 271
5 | sofa 5 155 75 412
6 | coffeetable 317 224 622 473
7 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000876.txt:
--------------------------------------------------------------------------------
1 | cabinetry 6 5 468 217
2 | door 501 8 639 257
3 | chair 314 164 457 206
4 | chair 150 331 539 472
5 | chair 6 184 158 466
6 | diningtable 22 192 613 474
7 | tincan 323 172 366 262
8 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000904.txt:
--------------------------------------------------------------------------------
1 | cabinetry 5 5 253 204
2 | cabinetry 388 11 570 152
3 | door 256 14 335 100
4 | chair 186 114 288 264
5 | chair 316 124 411 274
6 | chair 452 66 525 204
7 | diningtable 221 100 389 274
8 | diningtable 452 95 593 218
9 | tincan 274 90 297 129
10 | tincan 306 86 324 131
11 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_000999.txt:
--------------------------------------------------------------------------------
1 | cabinetry 482 5 640 319
2 | cup 264 97 326 161
3 | cup 330 91 403 161
4 | countertop 9 121 526 475
5 | tap 145 65 215 136
6 | sink 22 116 407 184
7 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001073.txt:
--------------------------------------------------------------------------------
1 | cabinetry 7 2 253 191
2 | cabinetry 395 10 592 139
3 | door 252 10 339 119
4 | chair 177 131 310 332
5 | chair 322 144 453 324
6 | chair 255 116 360 278
7 | chair 472 65 571 221
8 | diningtable 193 119 426 327
9 | diningtable 474 102 633 240
10 | tincan 280 103 298 146
11 | tincan 315 106 332 148
12 | bowl 259 111 284 132
13 | bowl 302 110 347 129
14 | doll 589 99 612 128
15 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001154.txt:
--------------------------------------------------------------------------------
1 | cabinetry 38 4 456 200
2 | door 467 8 561 128
3 | chair 364 142 502 328
4 | chair 439 120 554 288
5 | chair 497 151 637 383
6 | diningtable 389 131 633 350
7 | countertop 7 103 147 470
8 | tincan 493 112 520 160
9 | tincan 533 111 557 162
10 | sink 10 107 81 151
11 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001175.txt:
--------------------------------------------------------------------------------
1 | bed 589 135 636 225
2 | windowblind 316 5 404 65
3 | chair 8 112 293 470
4 | book 194 96 244 105
5 | book 260 100 303 125
6 | book 266 130 304 167
7 | bookcase 196 5 311 215
8 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001185.txt:
--------------------------------------------------------------------------------
1 | windowblind 459 4 577 64
2 | chair 155 102 437 465
3 | tvmonitor 24 38 207 150
4 | bookcase 357 10 455 221
5 | sofa 6 164 235 461
6 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001225.txt:
--------------------------------------------------------------------------------
1 | pictureframe 324 249 395 332
2 | pictureframe 23 125 75 174
3 | heater 326 170 557 306
4 | pottedplant 3 5 88 196
5 | pottedplant 455 242 515 337
6 | pottedplant 67 137 104 187
7 | tvmonitor 104 1 324 286
8 | vase 456 290 496 335
9 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001239.txt:
--------------------------------------------------------------------------------
1 | pictureframe 191 113 238 142
2 | pillow 223 185 369 225
3 | pottedplant 135 37 214 184
4 | chair 424 114 636 477
5 | tvmonitor 313 46 482 145
6 | sofa 5 150 453 450
7 | vase 155 149 197 184
8 | coffeetable 289 151 443 205
9 | coffeetable 177 134 279 193
10 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001284.txt:
--------------------------------------------------------------------------------
1 | cabinetry 2 4 213 208
2 | cabinetry 362 6 555 153
3 | door 212 14 304 131
4 | chair 125 138 274 350
5 | chair 292 148 421 356
6 | chair 438 68 538 237
7 | chair 208 119 314 295
8 | diningtable 142 125 418 336
9 | diningtable 438 107 603 250
10 | tincan 248 111 266 150
11 | tincan 276 106 296 154
12 | bowl 269 120 311 131
13 | doll 559 102 578 123
14 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001288.txt:
--------------------------------------------------------------------------------
1 | cabinetry 251 5 446 164
2 | door 52 2 186 158
3 | chair 158 183 349 477
4 | chair 1 149 148 451
5 | chair 340 64 447 253
6 | diningtable 347 120 529 282
7 | diningtable 7 143 318 458
8 | tincan 71 124 109 193
9 | tincan 127 122 159 187
10 | bowl 124 140 183 158
11 | doll 474 106 501 134
12 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001289.txt:
--------------------------------------------------------------------------------
1 | cabinetry 359 3 637 332
2 | cup 98 91 147 160
3 | cup 144 53 194 146
4 | cup 184 45 236 143
5 | countertop 3 117 389 474
6 | tap 1 69 65 134
7 | bottle 243 31 276 134
8 | sink 11 118 234 178
9 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001299.txt:
--------------------------------------------------------------------------------
1 | cabinetry 413 4 636 316
2 | cup 174 95 214 144
3 | cup 205 59 258 146
4 | cup 250 52 295 140
5 | countertop 5 110 427 471
6 | tap 64 61 137 136
7 | bottle 305 36 334 143
8 | sink 8 125 203 169
9 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001311.txt:
--------------------------------------------------------------------------------
1 | cabinetry 261 4 634 250
2 | cup 129 52 186 133
3 | cup 1 92 37 173
4 | countertop 10 94 344 478
5 | tap 64 64 93 134
6 | sink 14 107 255 164
7 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001321.txt:
--------------------------------------------------------------------------------
1 | cabinetry 319 4 637 271
2 | cup 172 56 231 130
3 | cup 6 83 91 171
4 | countertop 5 110 378 471
5 | tap 99 61 144 136
6 | sink 66 103 249 176
7 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001340.txt:
--------------------------------------------------------------------------------
1 | cabinetry 8 7 563 247
2 | door 571 7 640 172
3 | chair 393 174 616 456
4 | diningtable 446 165 635 462
5 | countertop 1 116 128 479
6 | bowl 589 153 635 195
7 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001377.txt:
--------------------------------------------------------------------------------
1 | cabinetry 8 5 562 259
2 | door 552 3 636 158
3 | chair 339 180 552 447
4 | chair 506 163 637 400
5 | diningtable 418 158 635 461
6 | tincan 555 154 603 229
7 | bowl 529 153 596 201
8 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001397.txt:
--------------------------------------------------------------------------------
1 | cabinetry 5 6 502 270
2 | door 509 3 636 162
3 | chair 260 187 455 473
4 | chair 480 278 635 472
5 | diningtable 305 163 636 461
6 | tincan 443 158 488 242
7 | tincan 509 155 561 247
8 | bowl 548 173 610 211
9 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001408.txt:
--------------------------------------------------------------------------------
1 | cabinetry 2 2 520 268
2 | door 524 2 638 175
3 | chair 223 181 440 479
4 | chair 470 307 640 479
5 | chair 423 161 607 447
6 | diningtable 281 180 636 473
7 | tincan 423 161 459 242
8 | tincan 492 161 535 242
9 | bowl 530 171 608 213
10 | bowl 455 164 497 208
11 |
--------------------------------------------------------------------------------
/input/ground-truth/2007_001416.txt:
--------------------------------------------------------------------------------
1 | cabinetry 3 2 269 227
2 | cabinetry 435 10 631 164
3 | door 286 5 383 125
4 | chair 172 137 297 328
5 | chair 342 152 457 336
6 | chair 260 116 354 271
7 | chair 584 86 638 240
8 | diningtable 234 116 453 324
9 | diningtable 485 104 627 272
10 | cup 256 113 287 149
11 |
--------------------------------------------------------------------------------
/input/images-optional/2007_000027.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000027.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000032.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000032.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000033.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000033.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000039.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000039.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000042.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000042.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000061.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000061.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000063.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000063.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000068.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000068.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000121.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000121.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000123.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000123.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000129.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000129.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000170.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000170.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000175.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000175.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000187.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000187.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000241.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000241.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000243.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000243.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000250.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000250.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000256.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000256.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000272.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000272.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000323.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000323.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000332.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000332.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000333.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000333.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000346.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000346.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000363.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000363.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000364.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000364.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000392.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000392.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000423.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000423.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000452.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000452.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000464.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000464.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000480.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000480.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000491.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000491.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000504.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000504.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000515.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000515.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000528.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000528.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000529.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000529.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000549.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000549.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000559.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000559.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000572.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000572.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000584.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000584.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000629.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000629.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000636.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000636.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000645.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000645.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000648.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000648.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000661.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000661.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000663.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000663.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000664.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000664.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000676.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000676.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000713.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000713.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000720.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000720.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000727.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000727.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000733.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000733.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000738.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000738.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000762.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000762.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000768.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000768.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000783.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000783.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000793.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000793.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000799.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000799.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000804.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000804.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000807.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000807.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000822.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000822.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000830.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000830.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000836.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000836.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000837.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000837.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000847.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000847.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000862.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000862.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000876.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000876.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000904.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000904.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_000999.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_000999.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001073.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001073.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001154.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001154.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001175.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001175.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001185.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001185.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001225.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001225.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001239.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001239.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001284.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001284.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001288.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001288.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001289.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001289.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001299.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001299.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001311.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001311.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001321.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001321.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001340.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001340.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001377.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001377.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001397.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001397.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001408.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001408.jpg
--------------------------------------------------------------------------------
/input/images-optional/2007_001416.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cartucho/mAP/3605865a350859e60c7b711838d09c4e0012c774/input/images-optional/2007_001416.jpg
--------------------------------------------------------------------------------
/main.py:
--------------------------------------------------------------------------------
1 | import glob
2 | import json
3 | import os
4 | import shutil
5 | import operator
6 | import sys
7 | import argparse
8 | import math
9 |
10 | import numpy as np
11 |
12 | MINOVERLAP = 0.5 # default value (defined in the PASCAL VOC2012 challenge)
13 |
14 | parser = argparse.ArgumentParser()
15 | parser.add_argument('-na', '--no-animation', help="no animation is shown.", action="store_true")
16 | parser.add_argument('-np', '--no-plot', help="no plot is shown.", action="store_true")
17 | parser.add_argument('-q', '--quiet', help="minimalistic console output.", action="store_true")
18 | # argparse receiving list of classes to be ignored (e.g., python main.py --ignore person book)
19 | parser.add_argument('-i', '--ignore', nargs='+', type=str, help="ignore a list of classes.")
20 | # argparse receiving list of classes with specific IoU (e.g., python main.py --set-class-iou person 0.7)
21 | parser.add_argument('--set-class-iou', nargs='+', type=str, help="set IoU for a specific class.")
22 | args = parser.parse_args()
23 |
24 | '''
25 | 0,0 ------> x (width)
26 | |
27 | | (Left,Top)
28 | | *_________
29 | | | |
30 | | |
31 | y |_________|
32 | (height) *
33 | (Right,Bottom)
34 | '''
35 |
36 | # if there are no classes to ignore then replace None by empty list
37 | if args.ignore is None:
38 | args.ignore = []
39 |
40 | specific_iou_flagged = False
41 | if args.set_class_iou is not None:
42 | specific_iou_flagged = True
43 |
44 | # make sure that the cwd() is the location of the python script (so that every path makes sense)
45 | os.chdir(os.path.dirname(os.path.abspath(__file__)))
46 |
47 | GT_PATH = os.path.join(os.getcwd(), 'input', 'ground-truth')
48 | DR_PATH = os.path.join(os.getcwd(), 'input', 'detection-results')
49 | # if there are no images then no animation can be shown
50 | IMG_PATH = os.path.join(os.getcwd(), 'input', 'images-optional')
51 | if os.path.exists(IMG_PATH):
52 | for dirpath, dirnames, files in os.walk(IMG_PATH):
53 | if not files:
54 | # no image files found
55 | args.no_animation = True
56 | else:
57 | args.no_animation = True
58 |
59 | # try to import OpenCV if the user didn't choose the option --no-animation
60 | show_animation = False
61 | if not args.no_animation:
62 | try:
63 | import cv2
64 | show_animation = True
65 | except ImportError:
66 | print("\"opencv-python\" not found, please install to visualize the results.")
67 | args.no_animation = True
68 |
69 | # try to import Matplotlib if the user didn't choose the option --no-plot
70 | draw_plot = False
71 | if not args.no_plot:
72 | try:
73 | import matplotlib.pyplot as plt
74 | draw_plot = True
75 | except ImportError:
76 | print("\"matplotlib\" not found, please install it to get the resulting plots.")
77 | args.no_plot = True
78 |
79 |
80 | def log_average_miss_rate(prec, rec, num_images):
81 | """
82 | log-average miss rate:
83 | Calculated by averaging miss rates at 9 evenly spaced FPPI points
84 | between 10e-2 and 10e0, in log-space.
85 |
86 | output:
87 | lamr | log-average miss rate
88 | mr | miss rate
89 | fppi | false positives per image
90 |
91 | references:
92 | [1] Dollar, Piotr, et al. "Pedestrian Detection: An Evaluation of the
93 | State of the Art." Pattern Analysis and Machine Intelligence, IEEE
94 | Transactions on 34.4 (2012): 743 - 761.
95 | """
96 |
97 | # if there were no detections of that class
98 | if prec.size == 0:
99 | lamr = 0
100 | mr = 1
101 | fppi = 0
102 | return lamr, mr, fppi
103 |
104 | fppi = (1 - prec)
105 | mr = (1 - rec)
106 |
107 | fppi_tmp = np.insert(fppi, 0, -1.0)
108 | mr_tmp = np.insert(mr, 0, 1.0)
109 |
110 | # Use 9 evenly spaced reference points in log-space
111 | ref = np.logspace(-2.0, 0.0, num = 9)
112 | for i, ref_i in enumerate(ref):
113 | # np.where() will always find at least 1 index, since min(ref) = 0.01 and min(fppi_tmp) = -1.0
114 | j = np.where(fppi_tmp <= ref_i)[-1][-1]
115 | ref[i] = mr_tmp[j]
116 |
117 | # log(0) is undefined, so we use the np.maximum(1e-10, ref)
118 | lamr = math.exp(np.mean(np.log(np.maximum(1e-10, ref))))
119 |
120 | return lamr, mr, fppi
121 |
122 | """
123 | throw error and exit
124 | """
125 | def error(msg):
126 | print(msg)
127 | sys.exit(0)
128 |
129 | """
130 | check if the number is a float between 0.0 and 1.0
131 | """
132 | def is_float_between_0_and_1(value):
133 | try:
134 | val = float(value)
135 | if val > 0.0 and val < 1.0:
136 | return True
137 | else:
138 | return False
139 | except ValueError:
140 | return False
141 |
142 | """
143 | Calculate the AP given the recall and precision array
144 | 1st) We compute a version of the measured precision/recall curve with
145 | precision monotonically decreasing
146 | 2nd) We compute the AP as the area under this curve by numerical integration.
147 | """
148 | def voc_ap(rec, prec):
149 | """
150 | --- Official matlab code VOC2012---
151 | mrec=[0 ; rec ; 1];
152 | mpre=[0 ; prec ; 0];
153 | for i=numel(mpre)-1:-1:1
154 | mpre(i)=max(mpre(i),mpre(i+1));
155 | end
156 | i=find(mrec(2:end)~=mrec(1:end-1))+1;
157 | ap=sum((mrec(i)-mrec(i-1)).*mpre(i));
158 | """
159 | rec.insert(0, 0.0) # insert 0.0 at begining of list
160 | rec.append(1.0) # insert 1.0 at end of list
161 | mrec = rec[:]
162 | prec.insert(0, 0.0) # insert 0.0 at begining of list
163 | prec.append(0.0) # insert 0.0 at end of list
164 | mpre = prec[:]
165 | """
166 | This part makes the precision monotonically decreasing
167 | (goes from the end to the beginning)
168 | matlab: for i=numel(mpre)-1:-1:1
169 | mpre(i)=max(mpre(i),mpre(i+1));
170 | """
171 | # matlab indexes start in 1 but python in 0, so I have to do:
172 | # range(start=(len(mpre) - 2), end=0, step=-1)
173 | # also the python function range excludes the end, resulting in:
174 | # range(start=(len(mpre) - 2), end=-1, step=-1)
175 | for i in range(len(mpre)-2, -1, -1):
176 | mpre[i] = max(mpre[i], mpre[i+1])
177 | """
178 | This part creates a list of indexes where the recall changes
179 | matlab: i=find(mrec(2:end)~=mrec(1:end-1))+1;
180 | """
181 | i_list = []
182 | for i in range(1, len(mrec)):
183 | if mrec[i] != mrec[i-1]:
184 | i_list.append(i) # if it was matlab would be i + 1
185 | """
186 | The Average Precision (AP) is the area under the curve
187 | (numerical integration)
188 | matlab: ap=sum((mrec(i)-mrec(i-1)).*mpre(i));
189 | """
190 | ap = 0.0
191 | for i in i_list:
192 | ap += ((mrec[i]-mrec[i-1])*mpre[i])
193 | return ap, mrec, mpre
194 |
195 |
196 | """
197 | Convert the lines of a file to a list
198 | """
199 | def file_lines_to_list(path):
200 | # open txt file lines to a list
201 | with open(path) as f:
202 | content = f.readlines()
203 | # remove whitespace characters like `\n` at the end of each line
204 | content = [x.strip() for x in content]
205 | return content
206 |
207 | """
208 | Draws text in image
209 | """
210 | def draw_text_in_image(img, text, pos, color, line_width):
211 | font = cv2.FONT_HERSHEY_PLAIN
212 | fontScale = 1
213 | lineType = 1
214 | bottomLeftCornerOfText = pos
215 | cv2.putText(img, text,
216 | bottomLeftCornerOfText,
217 | font,
218 | fontScale,
219 | color,
220 | lineType)
221 | text_width, _ = cv2.getTextSize(text, font, fontScale, lineType)[0]
222 | return img, (line_width + text_width)
223 |
224 | """
225 | Plot - adjust axes
226 | """
227 | def adjust_axes(r, t, fig, axes):
228 | # get text width for re-scaling
229 | bb = t.get_window_extent(renderer=r)
230 | text_width_inches = bb.width / fig.dpi
231 | # get axis width in inches
232 | current_fig_width = fig.get_figwidth()
233 | new_fig_width = current_fig_width + text_width_inches
234 | propotion = new_fig_width / current_fig_width
235 | # get axis limit
236 | x_lim = axes.get_xlim()
237 | axes.set_xlim([x_lim[0], x_lim[1]*propotion])
238 |
239 | """
240 | Draw plot using Matplotlib
241 | """
242 | def draw_plot_func(dictionary, n_classes, window_title, plot_title, x_label, output_path, to_show, plot_color, true_p_bar):
243 | # sort the dictionary by decreasing value, into a list of tuples
244 | sorted_dic_by_value = sorted(dictionary.items(), key=operator.itemgetter(1))
245 | # unpacking the list of tuples into two lists
246 | sorted_keys, sorted_values = zip(*sorted_dic_by_value)
247 | #
248 | if true_p_bar != "":
249 | """
250 | Special case to draw in:
251 | - green -> TP: True Positives (object detected and matches ground-truth)
252 | - red -> FP: False Positives (object detected but does not match ground-truth)
253 | - pink -> FN: False Negatives (object not detected but present in the ground-truth)
254 | """
255 | fp_sorted = []
256 | tp_sorted = []
257 | for key in sorted_keys:
258 | fp_sorted.append(dictionary[key] - true_p_bar[key])
259 | tp_sorted.append(true_p_bar[key])
260 | plt.barh(range(n_classes), fp_sorted, align='center', color='crimson', label='False Positive')
261 | plt.barh(range(n_classes), tp_sorted, align='center', color='forestgreen', label='True Positive', left=fp_sorted)
262 | # add legend
263 | plt.legend(loc='lower right')
264 | """
265 | Write number on side of bar
266 | """
267 | fig = plt.gcf() # gcf - get current figure
268 | axes = plt.gca()
269 | r = fig.canvas.get_renderer()
270 | for i, val in enumerate(sorted_values):
271 | fp_val = fp_sorted[i]
272 | tp_val = tp_sorted[i]
273 | fp_str_val = " " + str(fp_val)
274 | tp_str_val = fp_str_val + " " + str(tp_val)
275 | # trick to paint multicolor with offset:
276 | # first paint everything and then repaint the first number
277 | t = plt.text(val, i, tp_str_val, color='forestgreen', va='center', fontweight='bold')
278 | plt.text(val, i, fp_str_val, color='crimson', va='center', fontweight='bold')
279 | if i == (len(sorted_values)-1): # largest bar
280 | adjust_axes(r, t, fig, axes)
281 | else:
282 | plt.barh(range(n_classes), sorted_values, color=plot_color)
283 | """
284 | Write number on side of bar
285 | """
286 | fig = plt.gcf() # gcf - get current figure
287 | axes = plt.gca()
288 | r = fig.canvas.get_renderer()
289 | for i, val in enumerate(sorted_values):
290 | str_val = " " + str(val) # add a space before
291 | if val < 1.0:
292 | str_val = " {0:.2f}".format(val)
293 | t = plt.text(val, i, str_val, color=plot_color, va='center', fontweight='bold')
294 | # re-set axes to show number inside the figure
295 | if i == (len(sorted_values)-1): # largest bar
296 | adjust_axes(r, t, fig, axes)
297 | # set window title
298 | fig.canvas.set_window_title(window_title)
299 | # write classes in y axis
300 | tick_font_size = 12
301 | plt.yticks(range(n_classes), sorted_keys, fontsize=tick_font_size)
302 | """
303 | Re-scale height accordingly
304 | """
305 | init_height = fig.get_figheight()
306 | # comput the matrix height in points and inches
307 | dpi = fig.dpi
308 | height_pt = n_classes * (tick_font_size * 1.4) # 1.4 (some spacing)
309 | height_in = height_pt / dpi
310 | # compute the required figure height
311 | top_margin = 0.15 # in percentage of the figure height
312 | bottom_margin = 0.05 # in percentage of the figure height
313 | figure_height = height_in / (1 - top_margin - bottom_margin)
314 | # set new height
315 | if figure_height > init_height:
316 | fig.set_figheight(figure_height)
317 |
318 | # set plot title
319 | plt.title(plot_title, fontsize=14)
320 | # set axis titles
321 | # plt.xlabel('classes')
322 | plt.xlabel(x_label, fontsize='large')
323 | # adjust size of window
324 | fig.tight_layout()
325 | # save the plot
326 | fig.savefig(output_path)
327 | # show image
328 | if to_show:
329 | plt.show()
330 | # close the plot
331 | plt.close()
332 |
333 | """
334 | Create a ".temp_files/" and "output/" directory
335 | """
336 | TEMP_FILES_PATH = ".temp_files"
337 | if not os.path.exists(TEMP_FILES_PATH): # if it doesn't exist already
338 | os.makedirs(TEMP_FILES_PATH)
339 | output_files_path = "output"
340 | if os.path.exists(output_files_path): # if it exist already
341 | # reset the output directory
342 | shutil.rmtree(output_files_path)
343 |
344 | os.makedirs(output_files_path)
345 | if draw_plot:
346 | os.makedirs(os.path.join(output_files_path, "classes"))
347 | if show_animation:
348 | os.makedirs(os.path.join(output_files_path, "images", "detections_one_by_one"))
349 |
350 | """
351 | ground-truth
352 | Load each of the ground-truth files into a temporary ".json" file.
353 | Create a list of all the class names present in the ground-truth (gt_classes).
354 | """
355 | # get a list with the ground-truth files
356 | ground_truth_files_list = glob.glob(GT_PATH + '/*.txt')
357 | if len(ground_truth_files_list) == 0:
358 | error("Error: No ground-truth files found!")
359 | ground_truth_files_list.sort()
360 | # dictionary with counter per class
361 | gt_counter_per_class = {}
362 | counter_images_per_class = {}
363 |
364 | gt_files = []
365 | for txt_file in ground_truth_files_list:
366 | #print(txt_file)
367 | file_id = txt_file.split(".txt", 1)[0]
368 | file_id = os.path.basename(os.path.normpath(file_id))
369 | # check if there is a correspondent detection-results file
370 | temp_path = os.path.join(DR_PATH, (file_id + ".txt"))
371 | if not os.path.exists(temp_path):
372 | error_msg = "Error. File not found: {}\n".format(temp_path)
373 | error_msg += "(You can avoid this error message by running extra/intersect-gt-and-dr.py)"
374 | error(error_msg)
375 | lines_list = file_lines_to_list(txt_file)
376 | # create ground-truth dictionary
377 | bounding_boxes = []
378 | is_difficult = False
379 | already_seen_classes = []
380 | for line in lines_list:
381 | try:
382 | if "difficult" in line:
383 | class_name, left, top, right, bottom, _difficult = line.split()
384 | is_difficult = True
385 | else:
386 | class_name, left, top, right, bottom = line.split()
387 | except ValueError:
388 | error_msg = "Error: File " + txt_file + " in the wrong format.\n"
389 | error_msg += " Expected: ['difficult']\n"
390 | error_msg += " Received: " + line
391 | error_msg += "\n\nIf you have a with spaces between words you should remove them\n"
392 | error_msg += "by running the script \"remove_space.py\" or \"rename_class.py\" in the \"extra/\" folder."
393 | error(error_msg)
394 | # check if class is in the ignore list, if yes skip
395 | if class_name in args.ignore:
396 | continue
397 | bbox = left + " " + top + " " + right + " " +bottom
398 | if is_difficult:
399 | bounding_boxes.append({"class_name":class_name, "bbox":bbox, "used":False, "difficult":True})
400 | is_difficult = False
401 | else:
402 | bounding_boxes.append({"class_name":class_name, "bbox":bbox, "used":False})
403 | # count that object
404 | if class_name in gt_counter_per_class:
405 | gt_counter_per_class[class_name] += 1
406 | else:
407 | # if class didn't exist yet
408 | gt_counter_per_class[class_name] = 1
409 |
410 | if class_name not in already_seen_classes:
411 | if class_name in counter_images_per_class:
412 | counter_images_per_class[class_name] += 1
413 | else:
414 | # if class didn't exist yet
415 | counter_images_per_class[class_name] = 1
416 | already_seen_classes.append(class_name)
417 |
418 |
419 | # dump bounding_boxes into a ".json" file
420 | new_temp_file = TEMP_FILES_PATH + "/" + file_id + "_ground_truth.json"
421 | gt_files.append(new_temp_file)
422 | with open(new_temp_file, 'w') as outfile:
423 | json.dump(bounding_boxes, outfile)
424 |
425 | gt_classes = list(gt_counter_per_class.keys())
426 | # let's sort the classes alphabetically
427 | gt_classes = sorted(gt_classes)
428 | n_classes = len(gt_classes)
429 | #print(gt_classes)
430 | #print(gt_counter_per_class)
431 |
432 | """
433 | Check format of the flag --set-class-iou (if used)
434 | e.g. check if class exists
435 | """
436 | if specific_iou_flagged:
437 | n_args = len(args.set_class_iou)
438 | error_msg = \
439 | '\n --set-class-iou [class_1] [IoU_1] [class_2] [IoU_2] [...]'
440 | if n_args % 2 != 0:
441 | error('Error, missing arguments. Flag usage:' + error_msg)
442 | # [class_1] [IoU_1] [class_2] [IoU_2]
443 | # specific_iou_classes = ['class_1', 'class_2']
444 | specific_iou_classes = args.set_class_iou[::2] # even
445 | # iou_list = ['IoU_1', 'IoU_2']
446 | iou_list = args.set_class_iou[1::2] # odd
447 | if len(specific_iou_classes) != len(iou_list):
448 | error('Error, missing arguments. Flag usage:' + error_msg)
449 | for tmp_class in specific_iou_classes:
450 | if tmp_class not in gt_classes:
451 | error('Error, unknown class \"' + tmp_class + '\". Flag usage:' + error_msg)
452 | for num in iou_list:
453 | if not is_float_between_0_and_1(num):
454 | error('Error, IoU must be between 0.0 and 1.0. Flag usage:' + error_msg)
455 |
456 | """
457 | detection-results
458 | Load each of the detection-results files into a temporary ".json" file.
459 | """
460 | # get a list with the detection-results files
461 | dr_files_list = glob.glob(DR_PATH + '/*.txt')
462 | dr_files_list.sort()
463 |
464 | for class_index, class_name in enumerate(gt_classes):
465 | bounding_boxes = []
466 | for txt_file in dr_files_list:
467 | #print(txt_file)
468 | # the first time it checks if all the corresponding ground-truth files exist
469 | file_id = txt_file.split(".txt",1)[0]
470 | file_id = os.path.basename(os.path.normpath(file_id))
471 | temp_path = os.path.join(GT_PATH, (file_id + ".txt"))
472 | if class_index == 0:
473 | if not os.path.exists(temp_path):
474 | error_msg = "Error. File not found: {}\n".format(temp_path)
475 | error_msg += "(You can avoid this error message by running extra/intersect-gt-and-dr.py)"
476 | error(error_msg)
477 | lines = file_lines_to_list(txt_file)
478 | for line in lines:
479 | try:
480 | tmp_class_name, confidence, left, top, right, bottom = line.split()
481 | except ValueError:
482 | error_msg = "Error: File " + txt_file + " in the wrong format.\n"
483 | error_msg += " Expected: \n"
484 | error_msg += " Received: " + line
485 | error(error_msg)
486 | if tmp_class_name == class_name:
487 | #print("match")
488 | bbox = left + " " + top + " " + right + " " +bottom
489 | bounding_boxes.append({"confidence":confidence, "file_id":file_id, "bbox":bbox})
490 | #print(bounding_boxes)
491 | # sort detection-results by decreasing confidence
492 | bounding_boxes.sort(key=lambda x:float(x['confidence']), reverse=True)
493 | with open(TEMP_FILES_PATH + "/" + class_name + "_dr.json", 'w') as outfile:
494 | json.dump(bounding_boxes, outfile)
495 |
496 | """
497 | Calculate the AP for each class
498 | """
499 | sum_AP = 0.0
500 | ap_dictionary = {}
501 | lamr_dictionary = {}
502 | # open file to store the output
503 | with open(output_files_path + "/output.txt", 'w') as output_file:
504 | output_file.write("# AP and precision/recall per class\n")
505 | count_true_positives = {}
506 | for class_index, class_name in enumerate(gt_classes):
507 | count_true_positives[class_name] = 0
508 | """
509 | Load detection-results of that class
510 | """
511 | dr_file = TEMP_FILES_PATH + "/" + class_name + "_dr.json"
512 | dr_data = json.load(open(dr_file))
513 |
514 | """
515 | Assign detection-results to ground-truth objects
516 | """
517 | nd = len(dr_data)
518 | tp = [0] * nd # creates an array of zeros of size nd
519 | fp = [0] * nd
520 | for idx, detection in enumerate(dr_data):
521 | file_id = detection["file_id"]
522 | if show_animation:
523 | # find ground truth image
524 | ground_truth_img = glob.glob1(IMG_PATH, file_id + ".*")
525 | #tifCounter = len(glob.glob1(myPath,"*.tif"))
526 | if len(ground_truth_img) == 0:
527 | error("Error. Image not found with id: " + file_id)
528 | elif len(ground_truth_img) > 1:
529 | error("Error. Multiple image with id: " + file_id)
530 | else: # found image
531 | #print(IMG_PATH + "/" + ground_truth_img[0])
532 | # Load image
533 | img = cv2.imread(IMG_PATH + "/" + ground_truth_img[0])
534 | # load image with draws of multiple detections
535 | img_cumulative_path = output_files_path + "/images/" + ground_truth_img[0]
536 | if os.path.isfile(img_cumulative_path):
537 | img_cumulative = cv2.imread(img_cumulative_path)
538 | else:
539 | img_cumulative = img.copy()
540 | # Add bottom border to image
541 | bottom_border = 60
542 | BLACK = [0, 0, 0]
543 | img = cv2.copyMakeBorder(img, 0, bottom_border, 0, 0, cv2.BORDER_CONSTANT, value=BLACK)
544 | # assign detection-results to ground truth object if any
545 | # open ground-truth with that file_id
546 | gt_file = TEMP_FILES_PATH + "/" + file_id + "_ground_truth.json"
547 | ground_truth_data = json.load(open(gt_file))
548 | ovmax = -1
549 | gt_match = -1
550 | # load detected object bounding-box
551 | bb = [ float(x) for x in detection["bbox"].split() ]
552 | for obj in ground_truth_data:
553 | # look for a class_name match
554 | if obj["class_name"] == class_name:
555 | bbgt = [ float(x) for x in obj["bbox"].split() ]
556 | bi = [max(bb[0],bbgt[0]), max(bb[1],bbgt[1]), min(bb[2],bbgt[2]), min(bb[3],bbgt[3])]
557 | iw = bi[2] - bi[0] + 1
558 | ih = bi[3] - bi[1] + 1
559 | if iw > 0 and ih > 0:
560 | # compute overlap (IoU) = area of intersection / area of union
561 | ua = (bb[2] - bb[0] + 1) * (bb[3] - bb[1] + 1) + (bbgt[2] - bbgt[0]
562 | + 1) * (bbgt[3] - bbgt[1] + 1) - iw * ih
563 | ov = iw * ih / ua
564 | if ov > ovmax:
565 | ovmax = ov
566 | gt_match = obj
567 |
568 | # assign detection as true positive/don't care/false positive
569 | if show_animation:
570 | status = "NO MATCH FOUND!" # status is only used in the animation
571 | # set minimum overlap
572 | min_overlap = MINOVERLAP
573 | if specific_iou_flagged:
574 | if class_name in specific_iou_classes:
575 | index = specific_iou_classes.index(class_name)
576 | min_overlap = float(iou_list[index])
577 | if ovmax >= min_overlap:
578 | if "difficult" not in gt_match:
579 | if not bool(gt_match["used"]):
580 | # true positive
581 | tp[idx] = 1
582 | gt_match["used"] = True
583 | count_true_positives[class_name] += 1
584 | # update the ".json" file
585 | with open(gt_file, 'w') as f:
586 | f.write(json.dumps(ground_truth_data))
587 | if show_animation:
588 | status = "MATCH!"
589 | else:
590 | # false positive (multiple detection)
591 | fp[idx] = 1
592 | if show_animation:
593 | status = "REPEATED MATCH!"
594 | else:
595 | # false positive
596 | fp[idx] = 1
597 | if ovmax > 0:
598 | status = "INSUFFICIENT OVERLAP"
599 |
600 | """
601 | Draw image to show animation
602 | """
603 | if show_animation:
604 | height, widht = img.shape[:2]
605 | # colors (OpenCV works with BGR)
606 | white = (255,255,255)
607 | light_blue = (255,200,100)
608 | green = (0,255,0)
609 | light_red = (30,30,255)
610 | # 1st line
611 | margin = 10
612 | v_pos = int(height - margin - (bottom_border / 2.0))
613 | text = "Image: " + ground_truth_img[0] + " "
614 | img, line_width = draw_text_in_image(img, text, (margin, v_pos), white, 0)
615 | text = "Class [" + str(class_index) + "/" + str(n_classes) + "]: " + class_name + " "
616 | img, line_width = draw_text_in_image(img, text, (margin + line_width, v_pos), light_blue, line_width)
617 | if ovmax != -1:
618 | color = light_red
619 | if status == "INSUFFICIENT OVERLAP":
620 | text = "IoU: {0:.2f}% ".format(ovmax*100) + "< {0:.2f}% ".format(min_overlap*100)
621 | else:
622 | text = "IoU: {0:.2f}% ".format(ovmax*100) + ">= {0:.2f}% ".format(min_overlap*100)
623 | color = green
624 | img, _ = draw_text_in_image(img, text, (margin + line_width, v_pos), color, line_width)
625 | # 2nd line
626 | v_pos += int(bottom_border / 2.0)
627 | rank_pos = str(idx+1) # rank position (idx starts at 0)
628 | text = "Detection #rank: " + rank_pos + " confidence: {0:.2f}% ".format(float(detection["confidence"])*100)
629 | img, line_width = draw_text_in_image(img, text, (margin, v_pos), white, 0)
630 | color = light_red
631 | if status == "MATCH!":
632 | color = green
633 | text = "Result: " + status + " "
634 | img, line_width = draw_text_in_image(img, text, (margin + line_width, v_pos), color, line_width)
635 |
636 | font = cv2.FONT_HERSHEY_SIMPLEX
637 | if ovmax > 0: # if there is intersections between the bounding-boxes
638 | bbgt = [ int(round(float(x))) for x in gt_match["bbox"].split() ]
639 | cv2.rectangle(img,(bbgt[0],bbgt[1]),(bbgt[2],bbgt[3]),light_blue,2)
640 | cv2.rectangle(img_cumulative,(bbgt[0],bbgt[1]),(bbgt[2],bbgt[3]),light_blue,2)
641 | cv2.putText(img_cumulative, class_name, (bbgt[0],bbgt[1] - 5), font, 0.6, light_blue, 1, cv2.LINE_AA)
642 | bb = [int(i) for i in bb]
643 | cv2.rectangle(img,(bb[0],bb[1]),(bb[2],bb[3]),color,2)
644 | cv2.rectangle(img_cumulative,(bb[0],bb[1]),(bb[2],bb[3]),color,2)
645 | cv2.putText(img_cumulative, class_name, (bb[0],bb[1] - 5), font, 0.6, color, 1, cv2.LINE_AA)
646 | # show image
647 | cv2.imshow("Animation", img)
648 | cv2.waitKey(20) # show for 20 ms
649 | # save image to output
650 | output_img_path = output_files_path + "/images/detections_one_by_one/" + class_name + "_detection" + str(idx) + ".jpg"
651 | cv2.imwrite(output_img_path, img)
652 | # save the image with all the objects drawn to it
653 | cv2.imwrite(img_cumulative_path, img_cumulative)
654 |
655 | #print(tp)
656 | # compute precision/recall
657 | cumsum = 0
658 | for idx, val in enumerate(fp):
659 | fp[idx] += cumsum
660 | cumsum += val
661 | cumsum = 0
662 | for idx, val in enumerate(tp):
663 | tp[idx] += cumsum
664 | cumsum += val
665 | #print(tp)
666 | rec = tp[:]
667 | for idx, val in enumerate(tp):
668 | rec[idx] = float(tp[idx]) / gt_counter_per_class[class_name]
669 | #print(rec)
670 | prec = tp[:]
671 | for idx, val in enumerate(tp):
672 | prec[idx] = float(tp[idx]) / (fp[idx] + tp[idx])
673 | #print(prec)
674 |
675 | ap, mrec, mprec = voc_ap(rec[:], prec[:])
676 | sum_AP += ap
677 | text = "{0:.2f}%".format(ap*100) + " = " + class_name + " AP " #class_name + " AP = {0:.2f}%".format(ap*100)
678 | """
679 | Write to output.txt
680 | """
681 | rounded_prec = [ '%.2f' % elem for elem in prec ]
682 | rounded_rec = [ '%.2f' % elem for elem in rec ]
683 | output_file.write(text + "\n Precision: " + str(rounded_prec) + "\n Recall :" + str(rounded_rec) + "\n\n")
684 | if not args.quiet:
685 | print(text)
686 | ap_dictionary[class_name] = ap
687 |
688 | n_images = counter_images_per_class[class_name]
689 | lamr, mr, fppi = log_average_miss_rate(np.array(prec), np.array(rec), n_images)
690 | lamr_dictionary[class_name] = lamr
691 |
692 | """
693 | Draw plot
694 | """
695 | if draw_plot:
696 | plt.plot(rec, prec, '-o')
697 | # add a new penultimate point to the list (mrec[-2], 0.0)
698 | # since the last line segment (and respective area) do not affect the AP value
699 | area_under_curve_x = mrec[:-1] + [mrec[-2]] + [mrec[-1]]
700 | area_under_curve_y = mprec[:-1] + [0.0] + [mprec[-1]]
701 | plt.fill_between(area_under_curve_x, 0, area_under_curve_y, alpha=0.2, edgecolor='r')
702 | # set window title
703 | fig = plt.gcf() # gcf - get current figure
704 | fig.canvas.set_window_title('AP ' + class_name)
705 | # set plot title
706 | plt.title('class: ' + text)
707 | #plt.suptitle('This is a somewhat long figure title', fontsize=16)
708 | # set axis titles
709 | plt.xlabel('Recall')
710 | plt.ylabel('Precision')
711 | # optional - set axes
712 | axes = plt.gca() # gca - get current axes
713 | axes.set_xlim([0.0,1.0])
714 | axes.set_ylim([0.0,1.05]) # .05 to give some extra space
715 | # Alternative option -> wait for button to be pressed
716 | #while not plt.waitforbuttonpress(): pass # wait for key display
717 | # Alternative option -> normal display
718 | #plt.show()
719 | # save the plot
720 | fig.savefig(output_files_path + "/classes/" + class_name + ".png")
721 | plt.cla() # clear axes for next plot
722 |
723 | if show_animation:
724 | cv2.destroyAllWindows()
725 |
726 | output_file.write("\n# mAP of all classes\n")
727 | mAP = sum_AP / n_classes
728 | text = "mAP = {0:.2f}%".format(mAP*100)
729 | output_file.write(text + "\n")
730 | print(text)
731 |
732 | """
733 | Draw false negatives
734 | """
735 | if show_animation:
736 | pink = (203,192,255)
737 | for tmp_file in gt_files:
738 | ground_truth_data = json.load(open(tmp_file))
739 | #print(ground_truth_data)
740 | # get name of corresponding image
741 | start = TEMP_FILES_PATH + '/'
742 | img_id = tmp_file[tmp_file.find(start)+len(start):tmp_file.rfind('_ground_truth.json')]
743 | img_cumulative_path = output_files_path + "/images/" + img_id + ".jpg"
744 | img = cv2.imread(img_cumulative_path)
745 | if img is None:
746 | img_path = IMG_PATH + '/' + img_id + ".jpg"
747 | img = cv2.imread(img_path)
748 | # draw false negatives
749 | for obj in ground_truth_data:
750 | if not obj['used']:
751 | bbgt = [ int(round(float(x))) for x in obj["bbox"].split() ]
752 | cv2.rectangle(img,(bbgt[0],bbgt[1]),(bbgt[2],bbgt[3]),pink,2)
753 | cv2.imwrite(img_cumulative_path, img)
754 |
755 | # remove the temp_files directory
756 | shutil.rmtree(TEMP_FILES_PATH)
757 |
758 | """
759 | Count total of detection-results
760 | """
761 | # iterate through all the files
762 | det_counter_per_class = {}
763 | for txt_file in dr_files_list:
764 | # get lines to list
765 | lines_list = file_lines_to_list(txt_file)
766 | for line in lines_list:
767 | class_name = line.split()[0]
768 | # check if class is in the ignore list, if yes skip
769 | if class_name in args.ignore:
770 | continue
771 | # count that object
772 | if class_name in det_counter_per_class:
773 | det_counter_per_class[class_name] += 1
774 | else:
775 | # if class didn't exist yet
776 | det_counter_per_class[class_name] = 1
777 | #print(det_counter_per_class)
778 | dr_classes = list(det_counter_per_class.keys())
779 |
780 |
781 | """
782 | Plot the total number of occurences of each class in the ground-truth
783 | """
784 | if draw_plot:
785 | window_title = "ground-truth-info"
786 | plot_title = "ground-truth\n"
787 | plot_title += "(" + str(len(ground_truth_files_list)) + " files and " + str(n_classes) + " classes)"
788 | x_label = "Number of objects per class"
789 | output_path = output_files_path + "/ground-truth-info.png"
790 | to_show = False
791 | plot_color = 'forestgreen'
792 | draw_plot_func(
793 | gt_counter_per_class,
794 | n_classes,
795 | window_title,
796 | plot_title,
797 | x_label,
798 | output_path,
799 | to_show,
800 | plot_color,
801 | '',
802 | )
803 |
804 | """
805 | Write number of ground-truth objects per class to results.txt
806 | """
807 | with open(output_files_path + "/output.txt", 'a') as output_file:
808 | output_file.write("\n# Number of ground-truth objects per class\n")
809 | for class_name in sorted(gt_counter_per_class):
810 | output_file.write(class_name + ": " + str(gt_counter_per_class[class_name]) + "\n")
811 |
812 | """
813 | Finish counting true positives
814 | """
815 | for class_name in dr_classes:
816 | # if class exists in detection-result but not in ground-truth then there are no true positives in that class
817 | if class_name not in gt_classes:
818 | count_true_positives[class_name] = 0
819 | #print(count_true_positives)
820 |
821 | """
822 | Plot the total number of occurences of each class in the "detection-results" folder
823 | """
824 | if draw_plot:
825 | window_title = "detection-results-info"
826 | # Plot title
827 | plot_title = "detection-results\n"
828 | plot_title += "(" + str(len(dr_files_list)) + " files and "
829 | count_non_zero_values_in_dictionary = sum(int(x) > 0 for x in list(det_counter_per_class.values()))
830 | plot_title += str(count_non_zero_values_in_dictionary) + " detected classes)"
831 | # end Plot title
832 | x_label = "Number of objects per class"
833 | output_path = output_files_path + "/detection-results-info.png"
834 | to_show = False
835 | plot_color = 'forestgreen'
836 | true_p_bar = count_true_positives
837 | draw_plot_func(
838 | det_counter_per_class,
839 | len(det_counter_per_class),
840 | window_title,
841 | plot_title,
842 | x_label,
843 | output_path,
844 | to_show,
845 | plot_color,
846 | true_p_bar
847 | )
848 |
849 | """
850 | Write number of detected objects per class to output.txt
851 | """
852 | with open(output_files_path + "/output.txt", 'a') as output_file:
853 | output_file.write("\n# Number of detected objects per class\n")
854 | for class_name in sorted(dr_classes):
855 | n_det = det_counter_per_class[class_name]
856 | text = class_name + ": " + str(n_det)
857 | text += " (tp:" + str(count_true_positives[class_name]) + ""
858 | text += ", fp:" + str(n_det - count_true_positives[class_name]) + ")\n"
859 | output_file.write(text)
860 |
861 | """
862 | Draw log-average miss rate plot (Show lamr of all classes in decreasing order)
863 | """
864 | if draw_plot:
865 | window_title = "lamr"
866 | plot_title = "log-average miss rate"
867 | x_label = "log-average miss rate"
868 | output_path = output_files_path + "/lamr.png"
869 | to_show = False
870 | plot_color = 'royalblue'
871 | draw_plot_func(
872 | lamr_dictionary,
873 | n_classes,
874 | window_title,
875 | plot_title,
876 | x_label,
877 | output_path,
878 | to_show,
879 | plot_color,
880 | ""
881 | )
882 |
883 | """
884 | Draw mAP plot (Show AP's of all classes in decreasing order)
885 | """
886 | if draw_plot:
887 | window_title = "mAP"
888 | plot_title = "mAP = {0:.2f}%".format(mAP*100)
889 | x_label = "Average Precision"
890 | output_path = output_files_path + "/mAP.png"
891 | to_show = True
892 | plot_color = 'royalblue'
893 | draw_plot_func(
894 | ap_dictionary,
895 | n_classes,
896 | window_title,
897 | plot_title,
898 | x_label,
899 | output_path,
900 | to_show,
901 | plot_color,
902 | ""
903 | )
904 |
--------------------------------------------------------------------------------
/scripts/extra/README.md:
--------------------------------------------------------------------------------
1 | # Extra
2 |
3 | ## ground-truth:
4 | - ### convert `xml` to our format:
5 |
6 | 1) Insert ground-truth xml files into **ground-truth/**
7 | 2) Run the python script: `python convert_gt_xml.py`
8 |
9 | - ### convert YOLO to our format:
10 |
11 | 1) Add class list to the file `class_list.txt`
12 | 2) Insert ground-truth files into **ground-truth/**
13 | 3) Insert images into **images/**
14 | 4) Run the python script: `python convert_gt_yolo.py`
15 |
16 | - ### convert keras-yolo3 to our format:
17 |
18 | 1) Add or update the class list to the file `class_list.txt`
19 | 2) Use the parameter `--gt` to set the **ground-truth** source.
20 | 3) Run the python script: `python3 convert_keras-yolo3.py --gt `
21 | 1) Supports only python 3.
22 | 2) This code can handle recursive annotation structure. Just use the `-r` parameter.
23 | 3) The converted annotation is placed by default in a new from_kerasyolo3 folder. You can change that with the parameter `-o`.
24 | 4) The format is defined according with github.com/qqwweee/keras-yolo3
25 |
26 | ## detection-results:
27 | - ### convert darkflow `json` to our format:
28 |
29 | 1) Insert result json files into **detection-results/**
30 | 2) Run the python script: `python convert_dr_darkflow_json.py`
31 |
32 | - ### convert YOLO to our format:
33 |
34 | After runnuning darknet on a list of images, e.g.: `darknet.exe detector test data/voc.data yolo-voc.cfg yolo-voc.weights -dont_show -ext_output < data/test.txt > result.txt`
35 |
36 | 1) Copy the file `result.txt` to the folder `extra/`
37 | 2) Run the python script: `python convert_dr_yolo.py`
38 |
39 | - ### convert keras-yolo3 to our format:
40 |
41 | 1) Add or update the class list to the file `class_list.txt`
42 | 2) Use the parameter `--dr` to set the **detection-results** source.
43 | 3) Run the python script: `python3 convert_keras-yolo3.py --dr `
44 | 1) Supports only python 3.
45 | 2) This code can handle recursive annotation structure. Just use the `-r` parameter.
46 | 3) The converted annotation is placed by default in a new from_kerasyolo3 folder. You can change that with the parameter `-o`.
47 | 4) The format is defined according with github.com/gustavovaliati/keras-yolo3
48 |
49 | ## Find the files that contain a specific class of objects
50 |
51 | 1) Run the `find_class.py` script and specify the **class** as argument, e.g.
52 | `python find_class.py chair`
53 |
54 | ## Intersect ground-truth and detection-results files
55 | This script ensures same number of files in ground-truth and detection-results folder.
56 | When you encounter file not found error, it's usually because you have
57 | mismatched numbers of ground-truth and detection-results files.
58 | You can use this script to move ground-truth and detection-results files that are
59 | not in the intersection into a backup folder (backup_no_matches_found).
60 | This will retain only files that have the same name in both folders.
61 |
62 | 1) Prepare `.txt` files in your `ground-truth` and `detection-results` folders.
63 | 2) Run the `intersect-gt-and-dr.py` script to move non-intersected files into a backup folder (default: `backup_no_matches_found`).
64 |
65 | `python intersect-gt-and-dr.py`
66 |
--------------------------------------------------------------------------------
/scripts/extra/class_list.txt:
--------------------------------------------------------------------------------
1 | bed
2 | person
3 | pictureframe
4 | shirt
5 | lamp
6 | nightstand
7 | clock
8 | heater
9 | windowblind
10 | pillow
11 | robot
12 | cabinetry
13 | door
14 | doorhandle
15 | shelf
16 | pottedplant
17 | chair
18 | diningtable
19 | backpack
20 | whiteboard
21 | cup
22 | tvmonitor
23 | pen
24 | pencil
25 | wardrobe
26 | apple
27 | orange
28 | countertop
29 | tap
30 | banana
31 | bicyclehelmet
32 | book
33 | bookcase
34 | refrigerator
35 | wastecontainer
36 | tincan
37 | handbag
38 | sofa
39 | glasses
40 | vase
41 | coffeetable
42 | bowl
43 | remote
44 | candle
45 | bottle
46 | sink
47 | envelope
48 | doll
49 |
--------------------------------------------------------------------------------
/scripts/extra/convert_dr_darkflow_json.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import os
3 | import glob
4 | import json
5 |
6 | # make sure that the cwd() in the beginning is the location of the python script (so that every path makes sense)
7 | os.chdir(os.path.dirname(os.path.abspath(__file__)))
8 |
9 | # change directory to the one with the files to be changed
10 | parent_path = os.path.abspath(os.path.join(os.getcwd(), os.pardir))
11 | parent_path = os.path.abspath(os.path.join(parent_path, os.pardir))
12 | DR_PATH = os.path.join(parent_path, 'input','detection-results')
13 | #print(DR_PATH)
14 | os.chdir(DR_PATH)
15 |
16 | # old files (darkflow json format) will be moved to a "backup" folder
17 | ## create the backup dir if it doesn't exist already
18 | if not os.path.exists("backup"):
19 | os.makedirs("backup")
20 |
21 | # create VOC format files
22 | json_list = glob.glob('*.json')
23 | if len(json_list) == 0:
24 | print("Error: no .json files found in detection-results")
25 | sys.exit()
26 | for tmp_file in json_list:
27 | #print(tmp_file)
28 | # 1. create new file (VOC format)
29 | with open(tmp_file.replace(".json", ".txt"), "a") as new_f:
30 | data = json.load(open(tmp_file))
31 | for obj in data:
32 | obj_name = obj['label']
33 | conf = obj['confidence']
34 | left = obj['topleft']['x']
35 | top = obj['topleft']['y']
36 | right = obj['bottomright']['x']
37 | bottom = obj['bottomright']['y']
38 | new_f.write(obj_name + " " + str(conf) + " " + str(left) + " " + str(top) + " " + str(right) + " " + str(bottom) + '\n')
39 | # 2. move old file (darkflow format) to backup
40 | os.rename(tmp_file, "backup/" + tmp_file)
41 | print("Conversion completed!")
42 |
--------------------------------------------------------------------------------
/scripts/extra/convert_dr_yolo.py:
--------------------------------------------------------------------------------
1 | import os
2 | import re
3 |
4 | # make sure that the cwd() in the beginning is the location of the python script (so that every path makes sense)
5 | os.chdir(os.path.dirname(os.path.abspath(__file__)))
6 |
7 | IN_FILE = 'result.txt'
8 |
9 | # change directory to the one with the files to be changed
10 | parent_path = os.path.abspath(os.path.join(os.getcwd(), os.pardir))
11 | parent_path = os.path.abspath(os.path.join(parent_path, os.pardir))
12 | DR_PATH = os.path.join(parent_path, 'input','detection-results')
13 | #print(DR_PATH)
14 | os.chdir(DR_PATH)
15 |
16 | SEPARATOR_KEY = 'Enter Image Path:'
17 | IMG_FORMAT = '.jpg'
18 |
19 | outfile = None
20 | with open(IN_FILE) as infile:
21 | for line in infile:
22 | if SEPARATOR_KEY in line:
23 | if IMG_FORMAT not in line:
24 | break
25 | # get text between two substrings (SEPARATOR_KEY and IMG_FORMAT)
26 | image_path = re.search(SEPARATOR_KEY + '(.*)' + IMG_FORMAT, line)
27 | # get the image name (the final component of a image_path)
28 | # e.g., from 'data/horses_1' to 'horses_1'
29 | image_name = os.path.basename(image_path.group(1))
30 | # close the previous file
31 | if outfile is not None:
32 | outfile.close()
33 | # open a new file
34 | outfile = open(os.path.join(DR_PATH, image_name + '.txt'), 'w')
35 | elif outfile is not None:
36 | # split line on first occurrence of the character ':' and '%'
37 | class_name, info = line.split(':', 1)
38 | confidence, bbox = info.split('%', 1)
39 | # get all the coordinates of the bounding box
40 | bbox = bbox.replace(')','') # remove the character ')'
41 | # go through each of the parts of the string and check if it is a digit
42 | left, top, width, height = [int(s) for s in bbox.split() if s.lstrip('-').isdigit()]
43 | right = left + width
44 | bottom = top + height
45 | outfile.write("{} {} {} {} {} {}\n".format(class_name, float(confidence)/100, left, top, right, bottom))
46 |
--------------------------------------------------------------------------------
/scripts/extra/convert_gt_xml.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import os
3 | import glob
4 | import xml.etree.ElementTree as ET
5 |
6 | # make sure that the cwd() in the beginning is the location of the python script (so that every path makes sense)
7 | os.chdir(os.path.dirname(os.path.abspath(__file__)))
8 |
9 | # change directory to the one with the files to be changed
10 | parent_path = os.path.abspath(os.path.join(os.getcwd(), os.pardir))
11 | parent_path = os.path.abspath(os.path.join(parent_path, os.pardir))
12 | GT_PATH = os.path.join(parent_path, 'input','ground-truth')
13 | #print(GT_PATH)
14 | os.chdir(GT_PATH)
15 |
16 | # old files (xml format) will be moved to a "backup" folder
17 | ## create the backup dir if it doesn't exist already
18 | if not os.path.exists("backup"):
19 | os.makedirs("backup")
20 |
21 | # create VOC format files
22 | xml_list = glob.glob('*.xml')
23 | if len(xml_list) == 0:
24 | print("Error: no .xml files found in ground-truth")
25 | sys.exit()
26 | for tmp_file in xml_list:
27 | #print(tmp_file)
28 | # 1. create new file (VOC format)
29 | with open(tmp_file.replace(".xml", ".txt"), "a") as new_f:
30 | root = ET.parse(tmp_file).getroot()
31 | for obj in root.findall('object'):
32 | obj_name = obj.find('name').text
33 | bndbox = obj.find('bndbox')
34 | left = bndbox.find('xmin').text
35 | top = bndbox.find('ymin').text
36 | right = bndbox.find('xmax').text
37 | bottom = bndbox.find('ymax').text
38 | new_f.write("%s %s %s %s %s\n" % (obj_name, left, top, right, bottom))
39 | # 2. move old file (xml format) to backup
40 | os.rename(tmp_file, os.path.join("backup", tmp_file))
41 | print("Conversion completed!")
42 |
--------------------------------------------------------------------------------
/scripts/extra/convert_gt_yolo.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import os
3 | import glob
4 | import cv2
5 |
6 | def convert_yolo_coordinates_to_voc(x_c_n, y_c_n, width_n, height_n, img_width, img_height):
7 | ## remove normalization given the size of the image
8 | x_c = float(x_c_n) * img_width
9 | y_c = float(y_c_n) * img_height
10 | width = float(width_n) * img_width
11 | height = float(height_n) * img_height
12 | ## compute half width and half height
13 | half_width = width / 2
14 | half_height = height / 2
15 | ## compute left, top, right, bottom
16 | ## in the official VOC challenge the top-left pixel in the image has coordinates (1;1)
17 | left = int(x_c - half_width) + 1
18 | top = int(y_c - half_height) + 1
19 | right = int(x_c + half_width) + 1
20 | bottom = int(y_c + half_height) + 1
21 | return left, top, right, bottom
22 |
23 | # make sure that the cwd() in the beginning is the location of the python script (so that every path makes sense)
24 | os.chdir(os.path.dirname(os.path.abspath(__file__)))
25 |
26 | # read the class_list.txt to a list
27 | with open("class_list.txt") as f:
28 | obj_list = f.readlines()
29 | ## remove whitespace characters like `\n` at the end of each line
30 | obj_list = [x.strip() for x in obj_list]
31 | ## e.g. first object in the list
32 | #print(obj_list[0])
33 |
34 | # change directory to the one with the files to be changed
35 | parent_path = os.path.abspath(os.path.join(os.getcwd(), os.pardir))
36 | parent_path = os.path.abspath(os.path.join(parent_path, os.pardir))
37 | GT_PATH = os.path.join(parent_path, 'input','ground-truth')
38 | #print(GT_PATH)
39 | os.chdir(GT_PATH)
40 |
41 | # old files (YOLO format) will be moved to a new folder (backup/)
42 | ## create the backup dir if it doesn't exist already
43 | if not os.path.exists("backup"):
44 | os.makedirs("backup")
45 |
46 | # create VOC format files
47 | txt_list = glob.glob('*.txt')
48 | if len(txt_list) == 0:
49 | print("Error: no .txt files found in ground-truth")
50 | sys.exit()
51 | for tmp_file in txt_list:
52 | #print(tmp_file)
53 | # 1. check that there is an image with that name
54 | ## get name before ".txt"
55 | image_name = tmp_file.split(".txt",1)[0]
56 | #print(image_name)
57 | ## check if image exists
58 | for fname in os.listdir('../images'):
59 | if fname.startswith(image_name):
60 | ## image found
61 | #print(fname)
62 | img = cv2.imread('../images/' + fname)
63 | ## get image width and height
64 | img_height, img_width = img.shape[:2]
65 | break
66 | else:
67 | ## image not found
68 | print("Error: image not found, corresponding to " + tmp_file)
69 | sys.exit()
70 | # 2. open txt file lines to a list
71 | with open(tmp_file) as f:
72 | content = f.readlines()
73 | ## remove whitespace characters like `\n` at the end of each line
74 | content = [x.strip() for x in content]
75 | # 3. move old file (YOLO format) to backup
76 | os.rename(tmp_file, "backup/" + tmp_file)
77 | # 4. create new file (VOC format)
78 | with open(tmp_file, "a") as new_f:
79 | for line in content:
80 | ## split a line by spaces.
81 | ## "c" stands for center and "n" stands for normalized
82 | obj_id, x_c_n, y_c_n, width_n, height_n = line.split()
83 | obj_name = obj_list[int(obj_id)]
84 | left, top, right, bottom = convert_yolo_coordinates_to_voc(x_c_n, y_c_n, width_n, height_n, img_width, img_height)
85 | ## add new line to file
86 | #print(obj_name + " " + str(left) + " " + str(top) + " " + str(right) + " " + str(bottom))
87 | new_f.write(obj_name + " " + str(left) + " " + str(top) + " " + str(right) + " " + str(bottom) + '\n')
88 | print("Conversion completed!")
89 |
--------------------------------------------------------------------------------
/scripts/extra/convert_keras-yolo3.py:
--------------------------------------------------------------------------------
1 | '''
2 | ABOUT THIS SCRIPT:
3 | Converts ground-truth from the annotation files
4 | according to the https://github.com/qqwweee/keras-yolo3
5 | or https://github.com/gustavovaliati/keras-yolo3 format.
6 |
7 | And converts the detection-results from the annotation files
8 | according to the https://github.com/gustavovaliati/keras-yolo3 format.
9 | '''
10 |
11 | import argparse
12 | import datetime
13 | import os
14 |
15 | '''
16 | Each time this script runs, it saves the output in a different path
17 | controlled by the following folder suffix: annotation_version.
18 | '''
19 | annotation_version = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
20 |
21 | ap = argparse.ArgumentParser()
22 |
23 | ap.add_argument("-o", "--output_path",
24 | required=False,
25 | default='from_kerasyolo3/version_{}'.format(annotation_version),
26 | type=str,
27 | help="The dataset root path location.")
28 | ap.add_argument("-r", "--gen_recursive",
29 | required=False,
30 | default=False,
31 | action="store_true",
32 | help="Define if the output txt files will be placed in a \
33 | recursive folder tree or to direct txt files.")
34 | group = ap.add_mutually_exclusive_group(required=True)
35 | group.add_argument('--gt',
36 | type=str,
37 | default=None,
38 | help="The annotation file that refers to ground-truth in (keras-yolo3 format)")
39 | group.add_argument('--dr',
40 | type=str,
41 | default=None,
42 | help="The annotation file that refers to detection-results in (keras-yolo3 format)")
43 |
44 | ARGS = ap.parse_args()
45 |
46 | with open('class_list.txt', 'r') as class_file:
47 | class_map = class_file.readlines()
48 | print(class_map)
49 | annotation_file = ARGS.gt if ARGS.gt else ARGS.dr
50 |
51 | os.makedirs(ARGS.output_path, exist_ok=True)
52 |
53 | with open(annotation_file, 'r') as annot_f:
54 | for annot in annot_f:
55 | annot = annot.split(' ')
56 | img_path = annot[0].strip()
57 | if ARGS.gen_recursive:
58 | annotation_dir_name = os.path.dirname(img_path)
59 | # remove the root path to enable to path.join.
60 | if annotation_dir_name.startswith('/'):
61 | annotation_dir_name = annotation_dir_name.replace('/', '', 1)
62 | destination_dir = os.path.join(ARGS.output_path, annotation_dir_name)
63 | os.makedirs(destination_dir, exist_ok=True)
64 | # replace .jpg with your image format.
65 | file_name = os.path.basename(img_path).replace('.jpg', '.txt')
66 | output_file_path = os.path.join(destination_dir, file_name)
67 | else:
68 | file_name = img_path.replace('.jpg', '.txt').replace('/', '__')
69 | output_file_path = os.path.join(ARGS.output_path, file_name)
70 | os.path.dirname(output_file_path)
71 |
72 | with open(output_file_path, 'w') as out_f:
73 | for bbox in annot[1:]:
74 | if ARGS.gt:
75 | # Here we are dealing with ground-truth annotations
76 | # []
77 | # todo: handle difficulty
78 | x_min, y_min, x_max, y_max, class_id = list(map(float, bbox.split(',')))
79 | out_box = '{} {} {} {} {}'.format(
80 | class_map[int(class_id)].strip(), x_min, y_min, x_max, y_max)
81 | else:
82 | # Here we are dealing with detection-results annotations
83 | #
84 | x_min, y_min, x_max, y_max, class_id, score = list(map(float, bbox.split(',')))
85 | out_box = '{} {} {} {} {} {}'.format(
86 | class_map[int(class_id)].strip(), score, x_min, y_min, x_max, y_max)
87 |
88 | out_f.write(out_box + "\n")
89 |
--------------------------------------------------------------------------------
/scripts/extra/find_class.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import os
3 | import glob
4 |
5 | # make sure that the cwd() in the beginning is the location of the python script (so that every path makes sense)
6 | os.chdir(os.path.dirname(os.path.abspath(__file__)))
7 |
8 | if len(sys.argv) != 2:
9 | print("Error: wrong format.\nUsage: python find_class.py [class_name]")
10 | sys.exit(0)
11 |
12 | searching_class_name = sys.argv[1]
13 |
14 | def find_class(class_name):
15 | file_list = glob.glob('*.txt')
16 | file_list.sort()
17 | # iterate through the text files
18 | file_found = False
19 | for txt_file in file_list:
20 | # open txt file lines to a list
21 | with open(txt_file) as f:
22 | content = f.readlines()
23 | # remove whitespace characters like `\n` at the end of each line
24 | content = [x.strip() for x in content]
25 | # go through each line of eache file
26 | for line in content:
27 | class_name = line.split()[0]
28 | if class_name == searching_class_name:
29 | print(" " + txt_file)
30 | file_found = True
31 | break
32 | if not file_found:
33 | print(" No file found with that class")
34 |
35 | parent_path = os.path.abspath(os.path.join(os.getcwd(), os.pardir))
36 | parent_path = os.path.abspath(os.path.join(parent_path, os.pardir))
37 | GT_PATH = os.path.join(parent_path, 'input','ground-truth')
38 | DR_PATH = os.path.join(parent_path, 'input','detection-results')
39 |
40 | print("ground-truth folder:")
41 | os.chdir(GT_PATH)
42 | find_class(searching_class_name)
43 | print("detection-results folder:")
44 | os.chdir(DR_PATH)
45 | find_class(searching_class_name)
46 |
--------------------------------------------------------------------------------
/scripts/extra/intersect-gt-and-dr.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import os
3 | import glob
4 |
5 | ## This script ensures same number of files in ground-truth and detection-results folder.
6 | ## When you encounter file not found error, it's usually because you have
7 | ## mismatched numbers of ground-truth and detection-results files.
8 | ## You can use this script to move ground-truth and detection-results files that are
9 | ## not in the intersection into a backup folder (backup_no_matches_found).
10 | ## This will retain only files that have the same name in both folders.
11 |
12 |
13 | # make sure that the cwd() in the beginning is the location of the python script (so that every path makes sense)
14 | os.chdir(os.path.dirname(os.path.abspath(__file__)))
15 |
16 | parent_path = os.path.abspath(os.path.join(os.getcwd(), os.pardir))
17 | parent_path = os.path.abspath(os.path.join(parent_path, os.pardir))
18 | GT_PATH = os.path.join(parent_path, 'input','ground-truth')
19 | DR_PATH = os.path.join(parent_path, 'input','detection-results')
20 |
21 | backup_folder = 'backup_no_matches_found' # must end without slash
22 |
23 | os.chdir(GT_PATH)
24 | gt_files = glob.glob('*.txt')
25 | if len(gt_files) == 0:
26 | print("Error: no .txt files found in", GT_PATH)
27 | sys.exit()
28 | os.chdir(DR_PATH)
29 | dr_files = glob.glob('*.txt')
30 | if len(dr_files) == 0:
31 | print("Error: no .txt files found in", DR_PATH)
32 | sys.exit()
33 |
34 | gt_files = set(gt_files)
35 | dr_files = set(dr_files)
36 | print('total ground-truth files:', len(gt_files))
37 | print('total detection-results files:', len(dr_files))
38 | print()
39 |
40 | gt_backup = gt_files - dr_files
41 | dr_backup = dr_files - gt_files
42 |
43 | def backup(src_folder, backup_files, backup_folder):
44 | # non-intersection files (txt format) will be moved to a backup folder
45 | if not backup_files:
46 | print('No backup required for', src_folder)
47 | return
48 | os.chdir(src_folder)
49 | ## create the backup dir if it doesn't exist already
50 | if not os.path.exists(backup_folder):
51 | os.makedirs(backup_folder)
52 | for file in backup_files:
53 | os.rename(file, backup_folder + '/' + file)
54 |
55 | backup(GT_PATH, gt_backup, backup_folder)
56 | backup(DR_PATH, dr_backup, backup_folder)
57 | if gt_backup:
58 | print('total ground-truth backup files:', len(gt_backup))
59 | if dr_backup:
60 | print('total detection-results backup files:', len(dr_backup))
61 |
62 | intersection = gt_files & dr_files
63 | print('total intersected files:', len(intersection))
64 | print("Intersection completed!")
65 |
--------------------------------------------------------------------------------
/scripts/extra/result.txt:
--------------------------------------------------------------------------------
1 | Total BFLOPS 65.864
2 |
3 | seen 64
4 | Enter Image Path: data/horses.jpg: Predicted in 42.076185 seconds.
5 | horse: 88% (left_x: 3 top_y: 185 width: 150 height: 167)
6 | horse: 99% (left_x: 5 top_y: 198 width: 307 height: 214)
7 | horse: 96% (left_x: 236 top_y: 180 width: 215 height: 169)
8 | horse: 99% (left_x: 440 top_y: 209 width: 156 height: 142)
9 | Enter Image Path: data/person.jpg: Predicted in 41.767213 seconds.
10 | dog: 99% (left_x: 58 top_y: 262 width: 147 height: 89)
11 | person: 100% (left_x: 190 top_y: 95 width: 86 height: 284)
12 | horse: 100% (left_x: 394 top_y: 137 width: 215 height: 206)
13 | Enter Image Path:
--------------------------------------------------------------------------------