├── .gitignore ├── Code_Explanation.txt ├── LICENSE ├── README.md ├── annotations ├── Labels.txt ├── VOC2007_annotations_test.mat ├── VOC2007_records_test.mat ├── gt_fel_aeroplane.txt ├── gt_fel_bicycle.txt ├── gt_fel_bird.txt ├── gt_fel_boat.txt ├── gt_fel_cat.txt ├── gt_fel_chair.txt ├── gt_fel_diningtable.txt ├── gt_ved_aeroplane.txt ├── gt_ved_bicycle.txt ├── gt_ved_bird.txt ├── gt_ved_boat.txt ├── gt_ved_cat.txt ├── gt_ved_chair.txt └── gt_ved_diningtable.txt ├── detections ├── README.md ├── candidate_detector1 │ ├── comp4_det_test_aeroplane.txt │ ├── comp4_det_test_bicycle.txt │ ├── comp4_det_test_bird.txt │ ├── comp4_det_test_boat.txt │ ├── comp4_det_test_bottle.txt │ ├── comp4_det_test_bus.txt │ ├── comp4_det_test_car.txt │ ├── comp4_det_test_cat.txt │ ├── comp4_det_test_chair.txt │ ├── comp4_det_test_cow.txt │ ├── comp4_det_test_diningtable.txt │ ├── comp4_det_test_dog.txt │ ├── comp4_det_test_horse.txt │ ├── comp4_det_test_motorbike.txt │ ├── comp4_det_test_person.txt │ ├── comp4_det_test_pottedplant.txt │ ├── comp4_det_test_sheep.txt │ ├── comp4_det_test_sofa.txt │ ├── comp4_det_test_train.txt │ └── comp4_det_test_tvmonitor.txt ├── candidate_detector2 │ ├── comp4_det_test_aeroplane.txt │ ├── comp4_det_test_bicycle.txt │ ├── comp4_det_test_bird.txt │ ├── comp4_det_test_boat.txt │ ├── comp4_det_test_bottle.txt │ ├── comp4_det_test_bus.txt │ ├── comp4_det_test_car.txt │ ├── comp4_det_test_cat.txt │ ├── comp4_det_test_chair.txt │ ├── comp4_det_test_cow.txt │ ├── comp4_det_test_diningtable.txt │ ├── comp4_det_test_dog.txt │ ├── comp4_det_test_horse.txt │ ├── comp4_det_test_motorbike.txt │ ├── comp4_det_test_person.txt │ ├── comp4_det_test_pottedplant.txt │ ├── comp4_det_test_sheep.txt │ ├── comp4_det_test_sofa.txt │ ├── comp4_det_test_train.txt │ └── comp4_det_test_tvmonitor.txt ├── candidate_detector3 │ ├── comp4_det_test_aeroplane.txt │ ├── comp4_det_test_bicycle.txt │ ├── comp4_det_test_bird.txt │ ├── comp4_det_test_boat.txt │ ├── comp4_det_test_bottle.txt │ ├── comp4_det_test_bus.txt │ ├── comp4_det_test_car.txt │ ├── comp4_det_test_cat.txt │ ├── comp4_det_test_chair.txt │ ├── comp4_det_test_cow.txt │ ├── comp4_det_test_diningtable.txt │ ├── comp4_det_test_dog.txt │ ├── comp4_det_test_horse.txt │ ├── comp4_det_test_motorbike.txt │ ├── comp4_det_test_person.txt │ ├── comp4_det_test_pottedplant.txt │ ├── comp4_det_test_sheep.txt │ ├── comp4_det_test_sofa.txt │ ├── comp4_det_test_train.txt │ └── comp4_det_test_tvmonitor.txt ├── candidate_detector4 │ ├── comp4_det_test_aeroplane.txt │ ├── comp4_det_test_bicycle.txt │ ├── comp4_det_test_bird.txt │ ├── comp4_det_test_boat.txt │ ├── comp4_det_test_bottle.txt │ ├── comp4_det_test_bus.txt │ ├── comp4_det_test_car.txt │ ├── comp4_det_test_cat.txt │ ├── comp4_det_test_chair.txt │ ├── comp4_det_test_cow.txt │ ├── comp4_det_test_diningtable.txt │ ├── comp4_det_test_dog.txt │ ├── comp4_det_test_horse.txt │ ├── comp4_det_test_motorbike.txt │ ├── comp4_det_test_person.txt │ ├── comp4_det_test_pottedplant.txt │ ├── comp4_det_test_sheep.txt │ ├── comp4_det_test_sofa.txt │ ├── comp4_det_test_train.txt │ └── comp4_det_test_tvmonitor.txt └── candidate_detector5 │ ├── comp4_det_test_aeroplane.txt │ ├── comp4_det_test_bicycle.txt │ ├── comp4_det_test_bird.txt │ ├── comp4_det_test_boat.txt │ ├── comp4_det_test_bottle.txt │ ├── comp4_det_test_bus.txt │ ├── comp4_det_test_car.txt │ ├── comp4_det_test_cat.txt │ ├── comp4_det_test_chair.txt │ ├── comp4_det_test_cow.txt │ ├── comp4_det_test_diningtable.txt │ ├── comp4_det_test_dog.txt │ ├── comp4_det_test_horse.txt │ ├── comp4_det_test_motorbike.txt │ ├── comp4_det_test_person.txt │ ├── comp4_det_test_pottedplant.txt │ ├── comp4_det_test_sheep.txt │ ├── comp4_det_test_sofa.txt │ ├── comp4_det_test_train.txt │ └── comp4_det_test_tvmonitor.txt ├── results ├── README.md └── detectionAnalysisAutoReportTemplate.tex └── src ├── PASgetObjects.m ├── PASreadAllRecords.m ├── VOCcode ├── PASemptyobject.m ├── PASemptyrecord.m ├── PASerrmsg.m ├── PASreadrecord.m ├── PASreadrectxt.m ├── VOCevalcls.m ├── VOCevaldet.m ├── VOCevallayout.m ├── VOCevalseg.m ├── VOCinit.m ├── VOClabelcolormap.m ├── VOCreadrecxml.m ├── VOCreadxml.m ├── VOCwritexml.m └── VOCxml2struct.m ├── analyzeFalsePositives.m ├── analyzeSensitivity.m ├── analyzeTrueDetections.m ├── averagePrecisionNormalized.m ├── computeAPForObjectSubset.m ├── detectionAnalysisScript.m ├── displayAnalysisResults.m ├── displayAverageSensitivityImpactPlot.m ├── displayCharacteristicPerClassPlots.m ├── displayDetectionTrend.m ├── displayDetectionTrend2.m ├── displayExtraAnnotations.m ├── displayFPTrend.m ├── displayFalsePositiveImpactPlot.m ├── displayGtConfidencePredictions.m ├── displayPerCharacteristicPlots.m ├── displayRankedPositives.m ├── displayTopFP.m ├── matchDetectionsWithGroundTruth.m ├── pie.m ├── readDatasetAnnotations.m ├── readDetections.m ├── readGtData.m ├── setDatasetParameters.m ├── setDetectorInfo.m ├── showSurprisingMisses.m ├── tmp └── transferDetectionsScript.m ├── updateRecordAnnotations.m ├── writeFPAnalysisSummary.m ├── writeMissedObjectCharacteristics.m ├── writeTexHeader.m └── writeTexObject.m /.gitignore: -------------------------------------------------------------------------------- 1 | # Detection results 2 | detections 3 | 4 | # Analysis results 5 | results 6 | -------------------------------------------------------------------------------- /Code_Explanation.txt: -------------------------------------------------------------------------------- 1 | Derek Hoiem 2 | July 31, 2014 3 | 4 | This contains updated instructions for version 2 of the analysis code. You 5 | may also want to consult the README (created for version 1) and the pdf 6 | description, as well as the original paper: 7 | 8 | D. Hoiem, Y. Chodpathumwan, and Q. Dai, 9 | "Diagnosing Error in Object Detectors", ECCV 2012. 10 | 11 | ------------------------------------------------------------------------------ 12 | 13 | The main script is detectionAnalysisScript. Full functionality applies to 14 | only the VOC2007 dataset because detailed annotations are available only 15 | on that dataset. However, most functionality, including full false positive 16 | analysis also applies to other VOC detection datasets. The code has also 17 | been written to make it easy to adapt to other detection datasets that are 18 | based on bounding box criteria. It may be applicable to datasets for other 19 | localization criteria, but more revision may be necessary. 20 | 21 | 22 | MAIN FUNCTIONS 23 | 24 | ---- Functions that likely require editing ---- 25 | 26 | detectionAnalysisScript: Script for running all code. 27 | The first few lines contain parameters specifying what analysis and display 28 | functions to call. The dataset type (e.g., 'VOC'), list of detectors to 29 | analyze, and list of object classes to analyze is also specified here. 30 | 31 | setDatasetParameters: Specifies specific datset (e.g., 32 | 'VOC2007') and paths for images and annotations. Some parameters are 33 | specific to the machine; others to the type of dataset. The list of 34 | generally required parameters are explained in the function documentation. 35 | 36 | setDetectorInfo: Specifies location of detection files 37 | for each detector and directory to place results. 38 | 39 | 40 | ---- Functions that require editing if not using a VOC dataset ---- 41 | 42 | readDatasetAnnotations: For maximum compatibility (similar to say VOC2010), 43 | if using another dataset, this should produce the following structure: 44 | ann. 45 | rec(image_number). 46 | filename: name of image file 47 | imgsize([w h]): width and height of image in pixels 48 | objects(num_objects). 49 | detailedannotation: true if detailed annotation is available 50 | (probably false if not using VOC2007) 51 | details: annotations for visible parts, etc., if available, empty if not 52 | truncated: 0/1 for whether truncated 53 | difficult: 0/1 for whether this object is a don't care 54 | gt(object_class_number). 55 | bbox(num_objects, [x1 y1 x2 y2]): ground truth bounding boxes 56 | rnum(num_objects): index into rec, specifying source image 57 | onum(num_objects): index into rec(rnum).objects, specifying which object 58 | isdiff(num_objects): whether each object is don't care 59 | istrunc(num_objects): whether each object is truncated 60 | isocc(num_objects): whether each object is occluded 61 | details(num_objects): detail structure if available (otherwise empty) 62 | N: number of ground truth objects 63 | Note that isdiff, isocc, istrunc can be set to zeros if that information is 64 | not available; likewise trunacted and difficult in rec can be set to 0. 65 | 66 | readDetections: Reads the output of the object detector. For maximum 67 | compatibility, this should produce the following structure: 68 | det. 69 | bbox(ndetections, [x1 y1 x2 y2]): detection bounding box 70 | conf(ndetections): confidence for each detection (higher is more confident) 71 | rnum(ndetections): index into rec/gt structures, specifying source image 72 | nimages: total number of images in dataset 73 | N: total number of detections 74 | 75 | If these functions can be written according to the above specifications 76 | (which should be true for most bounding box based tasks), set dataset 77 | in the main script to 'voc_compatible'. 78 | 79 | 80 | ---- Functions that may require editing if not using a VOC-compatible dataset ---- 81 | 82 | analyzeTrueDetections: Produces precision-recall curves and normalized PR 83 | curves for objects with various characteristics. 84 | 85 | matchDetectionsWithGroundTruth: Labels detections as incorrect, correct, or 86 | don't care. localization parameter specifies whether localization error 87 | should be ignored ('weak') or not ('strong'). If you want to change the 88 | localization criteria, edit setDatasetParameters and/or this function. Also 89 | assigned ground truth objects to detections with best score or overlap. 90 | 91 | analyzeFalsePositives: Assigns detections to false positive types and 92 | computes effects of each type of false positive. 93 | 94 | displayPerCharacteristicPlots: Draws plots comparing normalized-AP for 95 | various object characteristics 96 | 97 | displayAverageSensitivityImpactPlot: Averages across objects to show impact 98 | of various object characteristics 99 | 100 | writeMissedObjectCharacteristics: summarizes statistics for objects that are 101 | not detected 102 | 103 | displayGtConfidencePredictions: displays detected objects sorted by 104 | the difference of predicted confidence (based on characteristics) and 105 | detection confidence (displays unexpectedly high confidence detections) 106 | 107 | showSurprisingMisses: similar to above, but displays unexpectedly low 108 | confidence detections 109 | 110 | displayTopFP: displays and optionally saves most confident false positives 111 | 112 | displayFalsePositiveImpactPlot: creates pie/bar charts for impact of 113 | false positives on performance 114 | 115 | displayFPTrend: displays stacked area plots of false positive with 116 | increasing number of detections 117 | 118 | writeFPAnalysisSummary: creates text file summarizing FP analysis 119 | 120 | writeTexHeader: creates tex header file for creating pdf report 121 | 122 | writeTexObject: creates tex material for results for one object category 123 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Kun Wang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Diagnosing Object Detectors 2 | 3 | ## Citation 4 | 5 | This project is modified from [here](http://dhoiem.web.engr.illinois.edu/projects/detectionAnalysis/). Please cite it in your publications if it helps your research: 6 | 7 | ``` 8 | @article{hoiem2012diagnosing, 9 | title={Diagnosing error in object detectors}, 10 | author={Hoiem, Derek and Chodpathumwan, Yodsawalai and Dai, Qieyun}, 11 | journal={Computer Vision--ECCV 2012}, 12 | pages={340--353}, 13 | year={2012}, 14 | publisher={Springer} 15 | } 16 | 17 | ``` 18 | 19 | Derek Hoiem 20 | July 30, 2012 (updated July 31, 2014) 21 | 22 | This project contains the source code and annotations for analyzing object 23 | detectors with the PASCAL VOC 2007 dataset. The annotations were created 24 | by Yodsawalai Chodpathumwan in Spring 2010 and Fall 2011 as an undergraduate 25 | RA. The associated published paper is: 26 | 27 | D. Hoiem, Y. Chodpathumwan, and Q. Dai, 28 | [Diagnosing Error in Object Detectors](http://dhoiem.web.engr.illinois.edu/publications/eccv2012_detanalysis_derek.pdf), ECCV 2012. 29 | 30 | 31 | ## How to Run 32 | 33 | **CASE I:** PASCAL VOC 2007, felzenszwalb or vedaldi detectors 34 | 1) In [detectionAnalysisScript.m](src/detectionAnalysisScript.m), set all flags on top to 1 (true) (note: `DO_SHOW_SURPRISING_MISSES` is optional) 35 | 2) Set the [imdir](src/setDatasetParameters.m#L23) path to a valid directory of VOC images 36 | 3) Run [detectionAnalysisScript.m](src/detectionAnalysisScript.m) in Matlab 37 | 38 | **CASE II:** PASCAL VOC 2007, your own detectors 39 | 1) Create a text file of detector outfits with rows of `file_id conf x1 y1 x2 y2` (standard format, see [readDetections.m](src/readDetections.m)). Put this file in a subdirectory within [detections](detections/). 40 | 2) Add a corresponding entry to [setDetectorInfo.m](src/setDetectorInfo.m) and update detector variable in [detectionAnalysisScript.m](src/detectionAnalysisScript.m). 41 | 3) Perform all steps of CASE I. 42 | 43 | **CASE III:** later versions of VOC 44 | Annotations are not currently available for detailed analysis of true detections. 45 | 1) Modify [setDatasetParameters.m](src/setDatasetParameters.m): 46 | * Set the imdir, VOCsourcepath, and VOCset to correspond to the dataset 47 | * Set objnames_extra = {}; change objnames_extra in DISPLAY_TP to objnames_selected. 48 | 2) Run as in CASE I or II 49 | 50 | **Case IV:** other datasets 51 | If detections are bounding boxes and evaluation criteria is similar, use 'voc_compatible' as detector type and update [setDatasetParameters.m](src/setDatasetParameters.m). Otherwise, more modification may be required; see details in [Code_Explanation.txt](Code_Explanation.txt). 52 | 53 | #### Creat A Report 54 | 55 | 1) The tex file for a report will be created for you in results/detname/tex. 56 | 2) Automatically remove whitespace from the figures using an Adobe Acrobat 57 | batch process or this script for pdfcrop from Ross Girshick: 58 | ``` 59 | #!/bin/sh 60 | find . -name "*.pdf" -print0 | xargs -P6 -0 -I file pdfcrop file file 61 | ``` 62 | 3) Use a latex compiler on detectionAnalysisAutoReportTemplate to make the pdf. 63 | 64 | 65 | ## Description of Folders 66 | 67 | [annotations](annotations/): Contains annotations for objects (excluding "difficult" objects, as defined 68 | by VOC annotations). The file [Labels.txt](annotations/Labels.txt) helps to explain the format. Each file also contains whether the object was detected by the Felzenszwalb or the Vedaldi detector and the corresponding confidence, but this need not be used. 69 | 70 | [src](src/): Contains code for reading the annotations and storing them in the PASCAL VOC record structure. Also contains code for computing normalized average precision and making comparisons between different subsets of the data. 71 | 72 | [results](results/): For each detector, contains tables of normalized AP for various subsets of data and comparison plots. 73 | 74 | [detections](detections/): For each detector, contains a list of all detections above some threshold for each object. 75 | 76 | 77 | ## Description of Script/Functions 78 | 79 | [detectionAnalysisScript.m](src/detectionAnalysisScript.m) 80 | 81 | * `TP_ANALYSIS`: correlates detections with ground truth, assigns attributes such as occlusion and aspect to each object, and computes performance measures for various subsets of objects 82 | * `FP_ANALYSIS`: computes fraction of top false positives due to localization error, confusion with similar objects, etc.; also computes the AP impact of false positives 83 | * `TP_DISPLAY`: creates plots showing performance of detector for different subsets of objects, a summary plot, a text summary of characteristics of missed objects, and images of objects that are less confidently detected than expected 84 | * `FP_DISPLAY`: displays statistics of the frequency and impact of false positives, including creation of a table in a text file 85 | * `DO_TEX`: creates tex files for compiling a report 86 | 87 | #### Other useful functions 88 | * [displayTopFP](src/displayTopFP.m): displays most confident false positives 89 | * [displayRankedPositives](src/displayRankedPositives.m): shows detection confidences of a subset of objects, from most to least confident 90 | 91 | 92 | ## Further Help 93 | Contact dhoiem@illinois.edu if there is a problem with the annotations or code. 94 | If instructions are unclear or incomplete, please try to figure it out first and 95 | send me a corrected version of the instructions. If you can't figure it out, 96 | email me, and I will help as time allows. 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /annotations/Labels.txt: -------------------------------------------------------------------------------- 1 | ==================== OCCLUSIONS ==================== 2 | 0 none 3 | 1 low occlusion (1-10%) 4 | 2 medium (10-50%) 5 | 3 high occlusion (50-100%) 6 | 7 | ======================= VIEWS ====================== 8 | v1 bottom 9 | v2 front 10 | v3 rear 11 | v4 side 12 | v5 top 13 | 14 | ======================= PARTS ====================== 15 | aeroplane : 16 | p1 body 17 | p2 head 18 | p3 tail 19 | p4 wing 20 | 21 | bicycle : 22 | p1 body 23 | p2 hand 24 | p3 seat 25 | p4 wheel 26 | 27 | boat : 28 | p1 body 29 | p2 cabin 30 | p3 mast 31 | p4 paddle 32 | p5 sail 33 | p6 windows 34 | 35 | bird : 36 | p1 body 37 | p2 face 38 | p3 beak 39 | p4 leg 40 | p5 tail 41 | p6 wing 42 | 43 | cat : 44 | p1 body 45 | p2 ear 46 | p3 face 47 | p4 leg 48 | p5 tail 49 | 50 | chair : 51 | p1 backrest 52 | p2 cushion 53 | p3 handrest 54 | p4 leg 55 | 56 | diningtable : 57 | p1 table leg 58 | p2 table top 59 | -------------------------------------------------------------------------------- /annotations/VOC2007_annotations_test.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wk910930/diagnosing-object-detectors/fcffd807fe40cad93b992d48e01b9d8e7fbf4c5d/annotations/VOC2007_annotations_test.mat -------------------------------------------------------------------------------- /annotations/VOC2007_records_test.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wk910930/diagnosing-object-detectors/fcffd807fe40cad93b992d48e01b9d8e7fbf4c5d/annotations/VOC2007_records_test.mat -------------------------------------------------------------------------------- /annotations/gt_fel_aeroplane.txt: -------------------------------------------------------------------------------- 1 | det conf occ p1 p2 p3 p4 v1 v2 v3 v4 v5 size ratio(w/h) 2 | 1 0.64346 0 1 1 1 1 0 0 0 1 0 56573 2.942 3 | 0 0 2 1 1 1 0 0 0 0 1 0 46690 3.553 4 | 1 -0.50729 0 1 1 1 1 1 0 0 1 0 2805 0.926 5 | 1 -0.42126 0 1 1 1 1 0 0 0 0 1 6298 1.409 6 | 1 -0.9895 0 0 1 1 1 0 0 1 1 0 74772 2.168 7 | 0 0 0 1 1 0 1 0 0 1 0 0 5350 2.163 8 | 1 -0.49186 0 1 1 1 1 1 1 0 1 0 2244 2.094 9 | 1 -0.90471 0 1 1 1 1 0 1 0 1 1 153095 1.365 10 | 0 0 0 1 0 0 1 1 0 1 0 0 1564 1.364 11 | 0 0 1 1 1 1 1 1 0 0 1 0 10206 0.640 12 | 1 -0.29911 0 1 1 1 0 0 0 0 1 0 9387 2.387 13 | 0 0 3 1 1 0 1 1 1 0 1 0 140400 1.444 14 | 0 0 0 1 1 0 1 0 0 0 1 0 26700 0.842 15 | 0 0 0 1 1 1 1 1 1 0 1 0 94062 1.426 16 | 1 -0.38308 0 1 1 1 1 1 1 0 1 0 20984 2.859 17 | 1 0.80727 0 1 1 1 0 0 0 0 1 0 68952 2.845 18 | 1 0.22772 1 1 1 1 1 0 0 0 1 0 41000 2.637 19 | 1 -0.49249 0 1 1 1 1 1 0 0 1 0 3136 1.313 20 | 0 0 0 1 1 1 1 1 0 0 1 0 2562 1.463 21 | 0 0 0 1 1 1 1 1 0 0 1 0 3008 1.370 22 | 0 0 0 1 1 1 1 1 0 0 1 0 3339 1.192 23 | 0 0 0 1 1 1 1 1 0 0 1 0 3250 1.306 24 | 0 0 0 1 0 0 1 0 0 1 1 0 1235 3.556 25 | 0 0 0 1 1 1 1 0 0 0 0 1 1376 1.355 26 | 0 0 0 1 1 1 1 0 0 0 0 1 1271 1.333 27 | 0 0 0 1 1 1 1 0 0 0 0 1 1200 1.345 28 | 0 0 0 1 1 1 1 0 0 0 0 1 1333 1.400 29 | 0 0 0 1 1 1 1 0 0 0 0 1 1248 1.226 30 | 0 0 0 1 1 1 1 0 0 0 0 1 1240 1.300 31 | 0 0 0 1 1 1 1 0 0 0 0 1 1271 1.333 32 | 0 0 0 1 1 1 1 0 0 0 0 1 1280 1.258 33 | 0 0 0 1 1 1 1 0 0 0 0 1 1248 1.226 34 | 1 1.5097 0 1 1 1 1 0 0 0 1 0 76608 2.725 35 | 1 -0.79714 0 1 1 0 1 1 1 0 0 0 214570 1.161 36 | 1 -0.3895 0 1 1 1 1 0 1 0 1 0 52832 3.294 37 | 0 0 1 1 1 1 1 0 1 0 1 0 91134 2.731 38 | 1 -0.84999 1 0 1 0 1 0 1 0 0 0 115038 2.161 39 | 1 -0.43433 0 1 1 1 1 1 0 0 1 0 40110 0.909 40 | 0 0 0 1 1 1 1 0 0 0 1 0 15336 2.986 41 | 1 1.1827 0 1 1 1 1 0 0 0 1 0 63720 3.515 42 | 1 -0.31649 0 1 1 1 1 1 0 0 1 0 46287 2.406 43 | 1 -0.012854 0 1 1 1 1 0 0 0 1 0 70499 3.465 44 | 0 0 3 0 0 0 1 1 0 1 0 0 4048 0.517 45 | 1 -0.79641 0 1 1 1 1 0 0 0 1 0 78120 2.778 46 | 0 0 0 1 1 1 1 0 0 0 0 1 868 1.111 47 | 1 -0.13737 0 1 1 1 1 0 0 0 1 0 44955 3.673 48 | 0 0 0 0 0 1 0 0 0 0 1 0 131738 1.203 49 | 1 -0.98937 0 1 0 1 1 0 1 0 1 0 157000 1.594 50 | 1 -0.13744 0 1 1 1 1 0 0 0 1 0 19788 4.328 51 | 1 0.51086 0 1 1 1 1 0 0 0 1 0 16498 3.125 52 | 1 -0.75618 0 1 0 0 1 0 0 0 1 0 8844 1.985 53 | 1 -0.55987 0 1 1 0 1 1 1 0 0 0 40040 3.330 54 | 1 -0.57289 1 0 1 1 1 0 1 0 0 0 57771 2.685 55 | 1 -0.060906 1 1 1 1 0 0 0 0 1 0 30600 3.081 56 | 1 -0.040425 1 1 0 1 1 0 0 0 1 0 47570 2.662 57 | 1 0.23544 0 1 1 1 1 1 0 0 1 0 87360 2.646 58 | 1 0.16476 0 1 1 1 1 0 0 0 1 0 8216 3.078 59 | 1 -0.53268 0 1 1 1 1 1 0 0 1 0 21100 2.121 60 | 1 0.56188 0 1 1 1 1 0 0 0 1 0 78648 2.607 61 | 0 0 1 1 0 0 1 0 0 0 1 0 867 3.125 62 | 1 -0.66597 0 1 1 1 1 0 0 0 1 0 13970 1.156 63 | 1 -0.44828 0 1 1 1 1 1 0 0 1 0 3904 1.050 64 | 1 -1.0083 0 1 1 1 1 0 1 0 1 1 102544 1.909 65 | 1 0.46407 0 1 1 1 1 0 0 0 1 0 6364 3.500 66 | 0 0 0 1 1 1 1 0 0 0 1 0 630 2.929 67 | 1 -0.14449 0 1 1 1 1 0 1 0 1 1 78581 2.461 68 | 1 0.7516 0 1 1 1 1 0 0 0 1 0 65037 3.697 69 | 1 -0.71883 0 1 1 1 1 1 0 0 1 0 22248 4.338 70 | 1 0.24446 1 1 1 1 1 0 0 0 1 0 19256 2.817 71 | 1 -0.13023 1 1 1 1 1 0 0 0 1 0 16936 3.208 72 | 0 0 0 1 1 0 0 0 0 0 1 0 9516 2.583 73 | 1 -0.26914 1 1 1 1 1 0 0 0 1 0 16498 3.125 74 | 1 -0.64568 0 1 1 1 1 0 0 0 1 0 18200 3.754 75 | 0 0 0 1 1 1 1 0 0 0 1 0 19125 3.432 76 | 0 0 0 0 1 1 1 0 1 0 0 0 128079 0.804 77 | 1 -0.22704 0 1 1 1 1 0 0 0 1 0 63441 2.519 78 | 1 0.81132 0 1 1 1 1 0 0 0 1 0 48645 3.702 79 | 0 0 0 1 0 1 0 0 1 0 1 0 3744 2.500 80 | 0 0 1 1 0 1 0 0 0 0 1 0 6040 3.846 81 | 0 0 1 1 0 1 0 0 0 0 1 0 4218 3.139 82 | 0 0 0 0 0 0 1 0 1 0 1 0 126746 1.968 83 | 0 0 0 1 1 1 1 0 0 1 1 1 147840 0.692 84 | 1 -0.6725 0 1 1 1 1 0 0 1 1 0 2700 3.069 85 | 1 0.28927 0 1 1 0 1 0 0 0 1 0 50024 4.660 86 | 0 0 0 1 1 1 1 0 1 0 1 0 26368 2.500 87 | 0 0 1 1 1 1 1 0 0 0 1 0 5133 1.483 88 | 1 -0.25889 0 1 1 1 1 0 0 0 1 0 56573 2.942 89 | 1 0.076016 0 1 1 1 1 0 0 0 1 0 69768 2.394 90 | 1 0.10246 0 0 1 1 1 0 1 0 0 0 113680 2.117 91 | 0 0 0 1 1 1 1 1 0 0 0 0 851 1.636 92 | 1 -0.80421 0 1 1 1 1 1 0 0 1 0 2349 2.857 93 | 1 -0.99378 0 0 1 0 1 0 1 0 0 0 135728 1.838 94 | 1 -0.96352 0 1 1 1 1 0 1 0 1 1 57348 1.835 95 | 1 -0.68083 0 1 1 1 1 0 0 0 1 0 103455 2.375 96 | 1 -0.83227 0 1 1 1 1 1 1 0 1 0 14820 0.876 97 | 1 0.15491 0 1 0 1 1 0 0 0 1 0 57782 2.078 98 | 0 0 0 1 1 0 1 0 1 0 1 0 113500 2.208 99 | 1 -0.61235 0 1 1 1 1 0 1 0 1 0 152500 1.641 100 | 0 0 0 1 1 1 1 1 0 0 1 0 35604 4.242 101 | 1 -0.067883 0 1 1 1 1 0 0 0 1 0 112000 2.238 102 | 1 -0.28858 0 1 1 1 1 0 0 1 1 0 41040 3.542 103 | 0 0 2 1 1 0 1 0 0 0 1 0 9828 2.500 104 | 1 0.91793 0 1 1 1 1 0 0 0 1 0 22473 2.306 105 | 1 -0.060628 0 1 1 0 1 0 0 0 1 0 74400 3.322 106 | 0 0 0 1 1 1 0 0 0 0 1 0 1452 3.095 107 | 1 -0.9744 0 1 1 1 1 1 0 0 1 0 3536 1.314 108 | 1 0.37336 0 1 1 1 1 0 0 0 1 0 64812 3.740 109 | 1 0.44251 0 1 1 1 1 0 0 0 1 0 51121 4.333 110 | 1 -0.91078 0 1 1 1 1 1 0 0 0 0 3016 0.895 111 | 1 -0.91869 0 1 0 0 1 0 1 0 1 0 119500 2.097 112 | 1 0.69865 0 1 1 1 1 1 0 1 1 0 91675 2.469 113 | 1 -0.075527 0 1 1 1 1 0 0 0 1 0 44080 3.296 114 | 0 0 0 1 1 0 1 1 1 0 0 0 125249 1.992 115 | 1 -0.44251 0 0 1 0 1 0 1 0 0 0 94927 2.611 116 | 1 0.52372 0 1 1 1 1 0 0 1 1 0 97800 2.452 117 | 1 0.55396 0 1 1 1 1 0 0 0 1 0 66420 3.664 118 | 1 -0.70366 1 1 1 0 1 1 1 0 1 0 64964 2.939 119 | 1 1.0593 0 1 1 1 1 0 0 0 1 0 89775 2.521 120 | 0 0 0 1 1 1 1 1 0 0 0 0 567 0.769 121 | 0 0 0 1 1 1 1 1 0 0 0 0 374 0.762 122 | 0 0 0 1 1 1 1 1 0 0 0 0 456 0.783 123 | 0 0 0 1 1 1 1 1 0 0 0 0 442 0.640 124 | 1 0.44259 1 1 1 1 1 0 0 0 1 0 51296 4.117 125 | 1 -0.72466 0 1 1 1 1 0 0 0 1 0 20376 3.972 126 | 1 -0.91647 1 1 1 1 1 0 1 1 0 0 163173 1.528 127 | 1 -0.62577 0 1 1 1 1 0 0 0 1 0 5760 2.532 128 | 1 -0.51278 0 1 1 1 1 0 0 0 1 1 118048 2.089 129 | 0 0 0 1 1 1 1 1 0 0 0 0 2520 0.800 130 | 0 0 2 1 1 1 1 0 1 0 1 0 49312 2.759 131 | 1 1.1175 0 1 1 1 1 0 0 0 1 0 63960 3.806 132 | 1 -0.15723 0 1 1 1 1 1 0 0 1 0 24888 2.406 133 | 1 -0.93412 0 1 1 1 1 1 0 0 0 0 5226 1.167 134 | 0 0 0 1 1 1 1 0 0 0 1 0 7440 0.480 135 | 1 -0.47709 0 1 1 1 1 0 0 0 1 1 22755 1.508 136 | 1 -0.2964 0 1 1 1 1 0 0 0 1 1 24628 1.438 137 | 0 0 0 1 1 1 1 0 0 0 0 1 21375 0.729 138 | 1 0.034897 0 1 1 1 1 0 1 0 1 0 146207 1.705 139 | 1 -0.47332 0 1 1 1 1 1 0 0 1 0 46690 2.229 140 | 0 0 0 1 1 1 1 0 0 1 1 1 8856 1.718 141 | 0 0 0 1 1 1 1 0 0 1 1 0 3304 4.333 142 | 0 0 0 1 1 1 1 1 0 0 1 0 128304 1.844 143 | 0 0 0 1 1 1 1 0 1 0 1 0 8798 3.173 144 | 0 0 0 1 1 1 0 0 0 0 1 0 1650 2.708 145 | 1 -0.83027 0 1 1 1 1 0 1 0 1 0 82840 2.302 146 | 1 0.5468 0 1 1 1 1 1 0 0 1 0 50718 4.462 147 | 1 -0.86258 0 0 1 0 0 0 1 0 1 0 146400 0.915 148 | 0 0 0 1 1 0 1 0 1 0 0 0 11178 3.887 149 | 1 -0.94784 1 1 1 0 1 0 0 0 1 0 86862 2.519 150 | 0 0 1 0 1 0 1 0 1 0 0 0 40089 1.550 151 | 0 0 0 1 1 1 1 0 0 0 1 0 12312 3.839 152 | 1 -0.16956 0 1 0 1 1 0 0 0 1 1 82248 2.437 153 | 1 -0.7553 0 1 1 1 1 0 0 0 1 0 52052 2.203 154 | 1 -0.4643 0 1 1 1 1 1 0 0 1 0 83470 2.899 155 | 0 0 1 1 1 1 0 0 0 0 1 0 18396 4.694 156 | 1 0.37109 0 1 1 1 1 0 0 0 1 0 75604 2.822 157 | 1 -0.71277 0 1 1 1 1 0 0 0 1 0 80272 2.692 158 | 0 0 0 1 1 1 1 1 0 0 1 0 32600 0.814 159 | 1 0.27392 0 1 1 1 1 0 0 0 1 0 56695 2.708 160 | 0 0 0 0 1 0 1 0 1 0 0 0 1575 2.583 161 | 0 0 0 0 1 0 1 0 1 0 0 0 1403 2.727 162 | 0 0 0 0 1 0 1 0 0 1 0 0 1674 2.346 163 | 0 0 0 0 1 0 1 0 1 0 0 0 1386 2.952 164 | 0 0 0 0 1 0 1 0 1 0 0 0 1488 2.652 165 | 0 0 0 0 1 0 1 0 1 0 0 0 1638 2.480 166 | 1 -0.87707 1 1 1 1 1 0 0 0 1 0 54786 2.891 167 | 1 0.74061 0 1 1 1 1 0 0 0 1 0 76314 3.070 168 | 1 0.53961 0 1 1 1 1 0 0 0 1 0 81796 2.875 169 | 1 -0.22205 0 1 1 1 1 0 0 1 1 1 46428 4.162 170 | 0 0 1 0 0 1 1 0 0 1 0 0 5883 4.389 171 | 0 0 1 1 0 1 0 0 0 0 1 0 700 1.789 172 | 0 0 0 1 1 1 1 0 0 0 1 0 3315 2.211 173 | 0 0 0 1 1 1 1 0 0 0 1 0 2765 2.294 174 | 0 0 0 1 1 1 1 0 0 0 1 0 2607 2.438 175 | 0 0 0 1 1 1 1 0 0 0 1 0 2349 2.857 176 | 0 0 0 1 1 1 1 0 0 0 1 0 2988 2.343 177 | 0 0 0 1 1 1 1 0 0 0 1 0 6678 3.854 178 | 1 -0.92402 0 1 1 1 1 1 1 0 1 0 89157 1.290 179 | 1 -0.31126 1 1 1 1 1 0 0 0 1 0 55278 4.518 180 | 1 -0.8897 0 1 1 1 1 0 1 0 1 0 91254 2.265 181 | 0 0 2 1 0 1 1 0 0 0 1 0 34424 3.204 182 | 1 -0.67104 0 1 1 1 1 1 0 0 1 0 5236 0.882 183 | 1 0.28296 0 1 1 1 1 1 0 0 1 0 3738 2.146 184 | 0 0 0 1 1 1 1 1 1 0 1 0 28028 2.938 185 | 0 0 0 1 1 1 1 1 1 0 1 0 5994 2.075 186 | 1 0.023747 0 1 0 1 1 1 0 1 1 0 107784 2.316 187 | 0 0 1 1 0 1 1 1 0 1 1 0 45756 2.992 188 | 1 -0.50006 0 1 1 1 1 0 0 1 1 0 148281 1.575 189 | 1 -0.39126 0 1 0 1 0 0 0 0 1 0 81069 2.429 190 | 0 0 3 1 1 1 1 0 0 1 1 0 26429 2.321 191 | 0 0 0 1 1 1 1 0 1 0 1 0 11564 3.362 192 | 1 -0.061798 0 1 1 1 1 0 1 0 1 0 63778 3.134 193 | 1 -0.39147 0 1 1 1 1 0 1 0 1 0 3939 2.632 194 | 1 0.4116 1 1 1 1 1 0 0 0 1 0 57477 2.671 195 | 0 0 1 1 1 1 1 0 0 0 1 0 75690 2.509 196 | 1 0.21462 0 1 0 1 1 0 0 0 1 0 114958 1.828 197 | 0 0 1 1 1 1 1 0 1 0 1 1 52140 2.096 198 | 0 0 0 1 0 1 1 1 0 0 1 0 1352 2.040 199 | 1 -0.044868 0 1 1 1 1 0 0 0 1 0 14904 2.288 200 | 1 -0.36309 0 1 1 1 1 0 1 0 1 0 38760 3.752 201 | 0 0 0 1 1 1 1 0 0 0 0 1 43442 0.948 202 | 0 0 0 1 1 1 1 0 0 0 1 0 13824 2.690 203 | 0 0 1 1 0 1 1 1 0 0 1 0 3610 2.541 204 | 1 -0.82478 0 1 1 1 1 0 0 0 1 0 65280 2.266 205 | 1 -0.35245 0 1 1 1 1 0 1 0 1 0 150894 1.646 206 | 0 0 0 1 1 1 1 0 1 0 1 0 4240 2.692 207 | 1 -0.77519 0 1 1 1 1 0 0 0 0 1 21027 0.790 208 | 0 0 3 1 1 1 1 0 0 0 1 1 12350 0.729 209 | 0 0 0 1 1 1 1 0 1 0 1 0 39260 2.333 210 | 1 -0.66791 0 1 1 1 1 0 0 0 1 0 86416 2.800 211 | 1 -1.0011 0 1 1 0 1 0 0 0 1 0 121114 1.472 212 | 0 0 1 1 1 1 1 0 1 0 1 1 9867 2.088 213 | 0 0 0 1 1 1 1 0 0 0 1 0 53789 2.432 214 | 1 -0.4622 0 1 1 1 1 0 0 0 1 0 67734 2.690 215 | 1 0.092687 0 1 1 1 1 0 0 0 1 0 58500 3.481 216 | 1 0.27485 0 1 1 1 1 0 0 1 1 0 75894 2.298 217 | 0 0 1 1 1 0 1 0 1 0 1 0 2618 2.303 218 | 1 -0.30685 0 1 1 1 1 0 1 0 1 0 41900 4.222 219 | 1 0.08013 0 1 1 1 1 0 0 0 1 0 33387 3.891 220 | 0 0 1 1 1 0 0 0 0 0 1 0 148500 1.686 221 | 1 1.1744 0 1 1 1 1 0 0 0 1 0 74412 3.071 222 | 0 0 2 1 0 1 1 0 0 1 1 0 7987 3.375 223 | 1 -0.32149 0 1 1 1 1 0 0 0 1 0 43888 4.087 224 | 1 -0.026444 0 1 1 1 1 0 1 0 1 0 56628 3.267 225 | 0 0 0 1 1 1 1 1 0 0 0 0 306 1.063 226 | 0 0 0 1 1 1 1 1 0 0 0 0 270 1.214 227 | 0 0 0 1 1 1 1 1 0 0 0 0 340 1.188 228 | 0 0 0 1 1 1 1 1 0 0 0 0 306 1.063 229 | 0 0 0 1 1 1 1 1 0 0 0 0 320 1.267 230 | 0 0 0 1 1 1 1 1 0 0 0 0 238 1.231 231 | 0 0 0 1 1 1 1 1 0 0 0 0 270 1.214 232 | 0 0 0 1 1 1 1 1 0 0 0 0 252 1.308 233 | 0 0 0 1 1 1 1 1 0 0 0 0 300 1.357 234 | 1 -0.86504 1 1 1 0 1 1 0 0 1 0 94806 2.218 235 | 0 0 0 1 1 1 1 1 0 0 1 0 79184 2.067 236 | 1 -0.95559 0 1 1 0 1 0 0 0 1 1 162916 1.427 237 | 1 -0.79729 1 1 0 0 1 0 0 0 1 1 32107 3.438 238 | 0 0 1 1 0 1 1 0 0 0 1 0 11644 2.329 239 | 0 0 1 1 0 1 0 0 0 0 1 0 3036 2.844 240 | 1 -0.88897 1 1 1 1 1 0 1 0 1 0 149100 1.659 241 | 0 0 0 1 1 1 1 0 1 0 1 0 19256 2.817 242 | 0 0 0 1 1 0 1 0 0 0 1 0 2848 2.839 243 | 1 -0.7825 0 1 1 1 1 0 1 0 1 0 83174 2.519 244 | 1 -0.68209 1 1 1 1 1 0 0 0 1 0 63030 2.323 245 | 1 -0.45575 0 1 1 1 1 1 0 0 1 0 105090 2.062 246 | 0 0 0 1 1 1 1 0 0 0 1 1 147060 1.258 247 | 1 0.51624 0 1 1 1 1 0 0 0 1 0 53872 4.324 248 | 1 -0.56176 0 1 1 1 1 0 0 0 1 0 21672 3.096 249 | 0 0 0 1 1 1 1 1 0 0 0 0 1209 0.789 250 | 0 0 0 1 1 1 1 0 0 1 1 1 8280 0.571 251 | 1 -0.92003 0 1 0 1 1 0 1 0 1 0 129500 1.934 252 | 1 -0.454 0 1 1 1 1 0 0 0 0 1 24030 1.321 253 | 1 -0.95651 0 1 1 1 1 1 0 0 1 0 49755 2.078 254 | 0 0 0 1 1 1 1 0 0 0 1 1 33124 1.161 255 | 1 -0.65797 0 1 1 1 1 0 1 0 1 0 99540 1.775 256 | 0 0 0 1 1 0 1 1 1 0 1 0 110831 2.234 257 | 1 -0.28066 0 1 1 1 1 0 1 0 1 0 78546 3.120 258 | 1 -0.35473 0 1 1 1 1 1 0 0 1 0 45200 3.563 259 | 1 -0.038046 0 1 1 1 1 1 1 0 1 0 11325 2.027 260 | 1 0.91549 0 1 1 1 1 0 0 0 1 0 71222 3.223 261 | 0 0 0 1 1 0 0 0 1 0 1 1 151916 0.699 262 | 1 -0.69211 0 1 1 1 1 1 1 0 1 0 163514 1.494 263 | 0 0 0 0 1 0 1 0 0 0 1 0 15290 1.266 264 | 0 0 0 1 1 1 1 1 0 0 0 0 480 1.211 265 | 0 0 0 1 1 1 1 1 0 0 0 0 360 1.118 266 | 0 0 0 1 1 1 1 1 0 0 0 0 441 1.000 267 | 0 0 0 1 1 1 1 1 0 0 0 0 360 1.118 268 | 0 0 0 1 1 1 1 1 0 0 0 0 340 1.188 269 | 0 0 0 1 1 1 1 1 0 0 0 0 374 1.313 270 | 0 0 0 1 1 1 1 1 0 0 0 0 360 1.118 271 | 0 0 0 1 1 1 1 1 0 0 0 0 342 1.059 272 | 0 0 0 1 1 1 1 1 0 0 0 0 340 1.188 273 | 0 0 0 1 1 1 1 0 0 0 1 0 2144 2.129 274 | 0 0 0 1 1 1 1 0 0 0 1 0 2272 2.258 275 | 0 0 0 1 1 1 1 0 0 0 1 0 2144 2.129 276 | 0 0 0 1 1 1 1 0 0 0 1 0 1950 2.207 277 | 0 0 0 1 1 1 1 0 0 0 1 0 2414 2.121 278 | 0 0 0 1 1 1 1 0 0 0 1 0 2046 2.167 279 | 0 0 0 1 1 1 1 0 0 0 1 0 2178 2.031 280 | 0 0 0 1 1 1 1 0 0 0 1 0 1792 2.333 281 | 0 0 0 1 1 1 1 0 0 0 1 0 1728 2.423 282 | 0 0 0 1 1 1 1 1 1 0 1 0 23564 3.212 283 | 1 -0.284 0 1 1 1 1 0 0 0 1 0 27700 2.788 284 | 1 -0.56607 0 1 0 1 1 0 0 1 1 0 71818 3.250 285 | 1 -0.13567 0 1 1 1 1 0 0 0 1 1 48872 2.209 286 | 1 -0.25589 0 1 1 1 1 0 0 0 1 0 49617 4.055 287 | -------------------------------------------------------------------------------- /annotations/gt_fel_boat.txt: -------------------------------------------------------------------------------- 1 | det conf occ p1 p2 p3 p4 p5 p6 v1 v2 v3 v4 v5 size ratio(w/h) 2 | 1 -0.90891 1 1 1 0 0 0 1 0 0 0 1 0 51562 3.214 3 | 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1944 0.287 4 | 0 0 0 1 1 1 0 0 0 0 1 0 1 0 1344 1.323 5 | 1 -0.84148 1 1 0 0 0 1 0 0 1 0 1 0 93886 0.952 6 | 0 0 0 1 1 1 0 0 0 0 0 0 1 0 4704 2.064 7 | 1 -1.0034 0 1 0 1 0 1 0 0 0 0 1 0 100905 0.466 8 | 1 -0.92282 1 1 1 0 0 0 1 0 0 0 1 0 3619 1.652 9 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1196 0.556 10 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 3200 2.026 11 | 1 -1.0054 1 1 0 0 0 1 0 0 0 0 1 0 2236 0.824 12 | 0 0 1 1 1 0 0 1 0 0 0 0 1 0 3645 1.818 13 | 1 -1.0226 1 1 1 1 0 0 0 0 1 0 1 0 11130 2.290 14 | 1 -0.9578 0 1 0 1 0 0 0 0 1 0 1 1 165580 1.434 15 | 0 0 0 1 0 1 0 1 0 0 0 0 1 0 107244 1.022 16 | 1 -0.90814 1 1 0 0 0 1 0 0 0 0 1 0 149000 1.680 17 | 1 -0.94673 1 1 1 0 0 0 0 0 1 0 1 0 34944 1.439 18 | 1 -0.95105 1 1 1 0 0 0 0 0 1 0 1 0 49449 1.962 19 | 0 0 2 0 1 0 0 0 0 0 1 0 1 0 20165 1.704 20 | 0 0 1 1 1 0 0 0 1 0 1 0 1 0 22788 1.963 21 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 4389 0.737 22 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 6240 0.674 23 | 1 -0.55655 0 1 0 1 0 0 0 0 0 0 1 1 45333 1.058 24 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 69130 0.718 25 | 1 -0.7229 0 1 0 0 0 1 0 0 0 0 1 0 49344 0.746 26 | 0 0 0 1 0 0 0 1 0 0 1 0 1 0 56023 0.260 27 | 1 -0.88395 0 1 1 0 0 0 1 1 1 0 1 0 25893 1.382 28 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 9975 1.106 29 | 1 -0.99501 0 1 0 0 0 0 0 0 1 0 1 0 71100 2.201 30 | 1 -0.92358 1 1 1 1 0 0 0 0 1 0 1 0 136728 0.767 31 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 68283 1.157 32 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 19701 0.495 33 | 0 0 0 1 0 0 0 0 0 0 1 0 0 0 15092 1.577 34 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 7497 2.920 35 | 0 0 1 1 0 0 0 0 0 0 0 1 1 0 12078 3.283 36 | 0 0 2 1 0 0 0 0 0 0 0 1 1 0 3002 2.108 37 | 0 0 0 1 0 0 0 0 0 0 0 1 1 0 1300 1.960 38 | 0 0 0 1 0 0 0 0 0 0 1 0 1 0 29944 0.770 39 | 1 -0.98431 0 1 0 1 0 0 0 0 1 0 1 0 55125 1.805 40 | 0 0 0 1 0 0 0 0 0 0 0 1 0 0 930 1.034 41 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 850 1.375 42 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 945 1.308 43 | 0 0 0 1 0 0 0 0 0 0 1 0 1 0 990 1.103 44 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 966 1.864 45 | 0 0 0 1 0 0 0 0 0 0 1 0 1 0 5244 0.907 46 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 3871 1.625 47 | 0 0 1 1 1 0 0 0 0 0 1 0 1 0 1800 1.128 48 | 0 0 1 1 1 0 0 0 0 0 1 0 1 0 2150 1.167 49 | 1 -0.82586 0 1 0 1 0 1 0 0 0 0 1 0 165750 0.848 50 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 9394 0.628 51 | 1 -0.9908 1 1 0 0 0 0 0 0 1 0 1 0 111714 1.681 52 | 0 0 0 1 1 0 0 0 0 0 0 0 1 0 2613 1.737 53 | 1 -0.7186 0 1 0 0 0 1 0 0 0 0 1 0 34454 0.751 54 | 1 -1.0104 0 1 0 1 0 0 0 0 1 0 1 0 6336 0.684 55 | 0 0 0 1 0 1 0 0 0 0 1 0 1 0 2660 0.453 56 | 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1462 1.273 57 | 0 0 1 1 1 0 0 0 0 0 1 0 1 0 1620 1.828 58 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 1856 1.839 59 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 1952 1.935 60 | 0 0 0 1 0 0 0 0 0 0 0 0 1 1 21112 6.368 61 | 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1260 1.029 62 | 1 -0.93254 0 1 1 0 0 0 1 0 0 0 1 0 2834 4.320 63 | 0 0 0 1 1 0 0 0 1 0 0 0 1 0 1752 3.130 64 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 1173 2.273 65 | 1 -1.0341 0 1 1 0 0 0 1 0 1 0 1 0 81720 2.531 66 | 1 -0.87793 0 1 1 0 0 0 0 0 1 0 1 0 113880 1.337 67 | 1 -0.16912 0 1 0 0 0 1 0 0 0 0 1 0 20895 0.525 68 | 1 -0.17508 0 1 0 1 0 1 0 0 0 0 1 0 36735 0.653 69 | 0 0 1 1 1 0 0 0 0 0 0 0 1 1 45279 3.328 70 | 0 0 0 1 0 0 0 0 0 0 0 0 1 1 30720 3.358 71 | 1 -1.0117 1 1 1 0 0 0 0 0 1 0 1 0 145824 1.689 72 | 0 0 0 1 1 1 0 0 0 0 1 0 1 1 38016 0.970 73 | 0 0 1 1 1 0 0 0 0 0 1 0 1 0 32518 1.617 74 | 0 0 0 1 1 0 0 0 0 0 0 0 1 0 21513 4.314 75 | 1 -0.82849 0 1 1 0 0 0 0 0 0 0 1 0 3572 2.514 76 | 0 0 1 1 0 0 0 0 0 0 0 0 1 0 17301 3.278 77 | 0 0 3 1 0 0 0 0 0 0 0 0 1 0 3999 4.267 78 | 0 0 0 1 0 0 0 0 0 1 1 0 1 0 106134 0.666 79 | 0 0 0 1 0 0 0 0 0 0 1 0 1 0 5840 1.097 80 | 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1875 3.083 81 | 0 0 0 1 1 0 0 0 0 0 0 0 1 0 46360 3.132 82 | 1 -0.036328 0 1 0 1 0 1 0 0 0 0 1 0 73656 0.632 83 | 1 -0.67744 0 1 0 1 0 0 0 0 0 0 1 0 3772 0.440 84 | 1 -0.9069 0 1 1 1 0 0 0 0 0 0 1 0 58302 0.963 85 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 116440 1.445 86 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1408 3.000 87 | 0 0 2 1 0 1 0 0 0 0 0 0 1 0 20930 0.806 88 | 1 -0.44212 2 1 0 1 0 0 0 0 0 0 1 0 23424 0.698 89 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 19720 0.680 90 | 0 0 1 1 0 1 0 0 0 0 1 0 0 0 3927 0.271 91 | 0 0 0 1 0 0 0 0 0 0 1 0 0 0 31436 2.348 92 | 1 -0.18915 0 1 0 1 0 1 0 0 0 0 1 0 29250 0.466 93 | 1 -0.57019 1 1 0 1 0 0 0 0 0 0 1 0 22939 0.554 94 | 1 -0.58744 0 1 0 1 0 0 0 0 0 0 1 0 5800 0.576 95 | 1 -0.96629 0 1 0 1 0 0 0 0 0 0 0 1 57824 3.007 96 | 1 0.11721 0 1 0 1 0 1 0 0 0 0 1 0 43050 0.710 97 | 0 0 0 1 0 0 0 0 0 0 1 0 0 0 74108 0.507 98 | 0 0 1 1 0 0 0 0 0 0 1 0 0 0 25320 0.567 99 | 0 0 1 1 0 0 0 0 0 0 0 1 1 1 32832 1.424 100 | 1 -0.94818 0 1 0 1 0 0 0 0 1 0 1 0 85260 0.986 101 | 0 0 0 1 1 0 0 0 1 0 0 0 1 0 42042 4.412 102 | 0 0 1 1 0 0 0 0 0 0 1 0 0 0 1360 1.182 103 | 1 -0.77652 0 1 0 1 0 1 0 0 0 0 1 0 53345 0.966 104 | 1 -0.96305 0 1 0 0 0 0 0 0 1 0 1 0 4074 2.341 105 | 0 0 2 1 0 0 0 0 0 0 1 0 1 0 7007 2.958 106 | 1 -0.78244 0 1 0 1 0 1 0 0 0 0 1 0 25560 0.561 107 | 1 -0.54839 0 1 0 0 0 1 0 0 0 0 1 0 8307 0.603 108 | 0 0 0 1 1 0 0 0 0 0 0 0 1 0 4428 2.675 109 | 0 0 1 1 1 0 0 0 1 0 0 0 1 0 25833 4.179 110 | 0 0 1 1 1 0 0 0 1 0 1 0 1 1 66732 3.737 111 | 1 -0.78774 0 1 1 0 0 0 0 0 1 0 1 1 20540 1.217 112 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 1974 1.122 113 | 0 0 0 1 0 0 0 0 0 0 0 1 1 1 50170 0.595 114 | 0 0 0 1 0 0 0 0 0 0 0 0 1 1 30976 1.898 115 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 6012 4.743 116 | 0 0 1 1 0 0 0 0 0 0 0 0 1 1 12180 3.667 117 | 0 0 1 1 0 0 0 0 0 0 0 0 1 1 19008 3.704 118 | 0 0 1 1 0 0 0 0 0 0 0 0 1 0 4200 5.519 119 | 0 0 1 1 0 0 0 0 0 0 1 0 1 0 37408 0.744 120 | 0 0 0 1 1 0 0 0 0 0 0 0 1 0 165336 0.666 121 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1248 5.133 122 | 1 -0.88147 0 1 1 1 0 0 1 0 0 0 1 0 44147 2.585 123 | 1 -1.0155 1 1 1 0 0 0 0 1 1 0 1 0 66862 1.642 124 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 18704 6.055 125 | 0 0 0 1 0 1 0 0 0 0 1 0 1 0 2091 0.800 126 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 10850 0.227 127 | 1 -0.89584 0 1 0 0 0 1 0 0 0 1 1 0 62425 0.825 128 | 0 0 0 1 0 0 0 0 0 0 1 0 1 1 21412 2.110 129 | 0 0 0 1 0 0 0 0 0 0 1 0 1 0 102630 1.061 130 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 83485 0.959 131 | 0 0 0 1 1 1 0 0 0 0 0 0 1 0 15429 1.255 132 | 0 0 1 1 0 0 1 0 0 0 0 0 0 1 18018 2.987 133 | 0 0 0 1 0 0 1 0 0 0 1 0 1 0 2291 2.786 134 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 4558 2.500 135 | 1 -0.88443 0 1 1 0 0 0 0 0 1 0 1 0 5194 1.865 136 | 1 -0.82984 0 1 1 0 0 0 1 0 0 0 1 0 17280 4.270 137 | 0 0 2 1 0 1 0 0 0 0 0 0 1 0 22256 1.953 138 | 0 0 1 1 0 0 0 0 0 0 0 0 1 1 3708 2.914 139 | 0 0 0 1 0 1 0 1 0 0 0 0 1 0 828 0.629 140 | 1 -0.67882 0 1 1 0 0 0 1 0 0 0 1 0 12529 2.818 141 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1159 3.333 142 | 0 0 0 1 1 0 0 0 1 0 0 0 1 0 41328 3.315 143 | 0 0 0 0 1 0 0 0 0 0 0 1 0 0 118881 1.072 144 | 1 -0.50526 0 1 0 1 0 0 0 0 1 0 1 1 103304 0.848 145 | 0 0 1 1 0 1 0 0 0 0 0 1 1 0 108225 1.025 146 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 21684 3.597 147 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 2442 1.806 148 | 1 -0.92517 0 1 1 0 0 0 0 0 0 0 1 0 51392 2.421 149 | 1 -0.91635 1 1 1 0 0 0 0 0 0 0 1 1 40120 2.897 150 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 2001 2.429 151 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 2090 4.476 152 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 800 3.267 153 | 0 0 1 1 0 0 0 0 0 0 0 0 1 0 928 3.800 154 | 0 0 1 1 0 0 0 0 0 0 0 0 1 0 3190 3.893 155 | 0 0 0 1 1 0 0 0 1 0 1 0 1 1 122944 1.664 156 | 0 0 1 1 0 0 0 0 0 0 0 1 1 0 63481 1.606 157 | 0 0 0 1 0 1 0 1 0 0 0 0 1 0 25020 0.771 158 | 1 -0.968 0 1 0 1 0 1 0 0 0 0 1 0 39072 0.792 159 | 1 -0.58433 0 1 0 1 0 0 0 0 0 0 1 0 12155 0.592 160 | 1 -1.0297 0 1 1 0 0 0 0 0 0 0 1 0 15958 1.570 161 | 0 0 2 1 0 1 0 0 0 0 0 0 1 0 7568 1.024 162 | 1 -0.9299 0 1 0 0 0 0 0 0 0 0 1 0 3150 1.805 163 | 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1890 0.377 164 | 0 0 1 1 1 0 0 0 0 0 0 0 1 0 32136 3.049 165 | 1 -0.79512 0 1 0 1 0 0 0 0 0 0 1 0 6864 0.631 166 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 3822 2.195 167 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 148335 0.685 168 | 0 0 0 1 1 0 0 0 0 0 0 0 1 0 35868 3.763 169 | 1 -0.87634 1 1 0 0 0 0 1 0 0 0 1 0 5671 2.038 170 | 0 0 1 1 0 0 0 0 0 0 1 0 1 1 4070 1.352 171 | 0 0 2 1 0 0 0 0 0 0 0 0 1 1 7392 1.708 172 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 7296 2.268 173 | 1 -0.46759 0 1 0 1 0 1 0 0 1 0 0 0 134235 0.604 174 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 459 0.615 175 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 2209 1.000 176 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1050 1.708 177 | 0 0 0 1 1 0 0 0 0 0 0 0 1 0 1595 1.929 178 | 0 0 1 1 1 0 0 0 0 0 1 0 1 0 22260 2.029 179 | 1 -0.91141 2 1 1 0 0 0 0 0 0 1 1 0 24625 1.581 180 | 0 0 0 1 0 1 0 1 0 0 0 0 1 0 64815 0.341 181 | 1 -0.98842 0 1 0 1 0 1 0 0 0 0 1 1 129090 0.848 182 | 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1100 0.558 183 | 0 0 0 1 0 0 0 0 0 0 0 1 1 1 1702 1.250 184 | 1 -0.64793 0 1 0 1 0 0 0 0 0 0 1 0 7650 0.733 185 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 12690 4.415 186 | 1 -0.59413 0 1 0 1 0 1 0 0 1 0 1 0 9480 0.655 187 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1088 0.939 188 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 16471 0.500 189 | 1 -0.35516 0 1 0 0 0 1 0 0 0 0 1 0 15224 0.506 190 | 1 -0.95535 0 1 0 1 0 1 0 0 0 0 1 0 107062 1.481 191 | 0 0 0 1 0 1 0 0 0 0 1 0 0 0 2256 0.247 192 | 0 0 0 1 1 0 0 0 1 0 0 1 1 0 3540 1.017 193 | 0 0 2 1 1 0 0 0 1 0 0 1 1 0 2145 1.421 194 | 1 -1.0103 0 1 0 0 0 0 0 0 1 0 1 1 69930 1.589 195 | 1 -0.48624 0 1 1 1 0 0 0 0 0 0 1 0 6545 0.905 196 | 1 -0.75083 0 1 0 1 0 0 0 0 0 0 1 0 2660 0.536 197 | 0 0 1 1 0 0 0 1 0 0 1 0 1 0 10764 0.248 198 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 4902 3.459 199 | 1 -0.40103 0 1 0 1 0 1 0 0 1 0 1 0 64600 0.558 200 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 110565 1.485 201 | 0 0 0 1 1 0 0 0 0 0 0 1 1 0 9165 2.188 202 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1140 3.278 203 | 1 -0.87274 0 1 0 1 0 0 0 0 1 0 1 0 84762 1.105 204 | 1 -0.98045 0 1 1 1 0 0 1 0 0 1 1 0 135278 1.656 205 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 2604 3.407 206 | 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1976 3.000 207 | 1 -0.89713 0 1 0 0 0 0 0 0 1 0 1 0 28690 3.202 208 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 9610 2.525 209 | 1 -0.95428 1 1 1 0 0 0 1 1 1 0 1 0 82880 2.429 210 | 0 0 2 1 0 0 0 0 0 0 0 0 1 1 23980 0.493 211 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 8321 3.000 212 | 1 -0.61573 0 1 0 1 0 0 0 0 0 0 1 0 12104 0.652 213 | 0 0 2 1 0 0 0 0 0 0 0 0 1 0 9118 4.196 214 | 1 -0.86689 0 1 1 1 0 0 0 0 0 1 0 0 36630 0.934 215 | 1 -0.93618 0 1 0 1 0 0 0 0 0 0 1 0 101304 1.598 216 | 1 -1.002 1 1 0 0 0 0 0 0 0 1 1 0 102410 2.351 217 | 1 -0.77713 0 1 1 0 0 0 1 0 1 0 1 0 85239 1.600 218 | 1 -0.93718 0 1 0 1 0 0 0 0 0 0 1 0 18426 0.667 219 | 0 0 0 1 1 0 0 0 1 0 0 0 1 1 109250 2.070 220 | 0 0 0 1 0 0 0 1 0 0 1 0 1 0 23478 0.313 221 | 0 0 0 1 0 0 0 1 0 0 1 0 1 0 6600 0.374 222 | 1 -0.9017 0 1 1 0 0 0 0 0 0 0 1 0 82416 1.985 223 | 0 0 1 1 0 0 0 0 0 0 0 0 1 0 24806 1.006 224 | 0 0 0 1 1 0 0 0 0 0 1 0 1 1 52332 1.655 225 | 0 0 1 1 0 0 0 0 0 0 1 0 1 0 49910 3.798 226 | 1 -0.57033 1 1 0 1 0 1 0 0 0 0 1 0 28623 0.693 227 | 0 0 0 1 0 1 0 0 0 0 1 0 0 0 2223 0.679 228 | 0 0 1 1 0 0 0 0 0 0 1 0 0 0 1216 1.194 229 | 0 0 0 1 0 0 0 0 0 0 1 0 0 0 504 1.150 230 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1302 3.050 231 | 0 0 1 1 1 0 0 0 0 0 1 0 1 0 3936 1.723 232 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 832 3.400 233 | 1 -0.6913 0 1 0 1 0 0 0 0 0 0 1 0 8216 0.757 234 | 1 -0.63239 0 1 0 1 0 0 0 0 0 0 1 0 72420 0.573 235 | 1 -0.85454 0 1 0 0 0 1 0 0 0 0 1 0 41772 1.335 236 | 0 0 1 1 1 0 0 0 0 0 1 0 1 0 34540 2.872 237 | 1 -0.89545 0 1 1 0 0 0 0 0 0 1 1 0 9118 0.969 238 | 1 -0.69313 1 1 1 0 0 0 1 0 1 0 1 0 51982 2.089 239 | 0 0 0 1 1 0 0 0 1 0 0 0 1 0 25273 1.571 240 | 0 0 1 1 0 0 0 0 0 0 0 1 1 1 34600 1.157 241 | 0 0 1 1 0 0 0 0 0 0 0 0 1 0 33345 3.723 242 | 0 0 2 1 0 0 0 0 0 0 0 1 0 0 14700 1.475 243 | 1 -0.38319 0 1 0 1 0 1 0 0 0 0 1 0 80100 0.890 244 | 0 0 2 1 1 0 0 0 0 0 0 0 1 0 27936 3.053 245 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 2419 0.690 246 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1160 0.718 247 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1551 0.696 248 | 1 -0.77628 0 1 0 0 0 1 0 0 0 0 1 0 1848 0.582 249 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 759 0.688 250 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 31773 0.247 251 | 1 -0.97724 0 1 0 0 0 0 0 0 0 1 1 1 8174 2.217 252 | 0 0 1 1 0 0 0 0 0 0 0 1 0 0 89500 2.803 253 | 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1500 3.895 254 | 0 0 0 1 1 0 0 0 0 0 0 0 1 0 1242 2.409 255 | 0 0 0 1 1 0 0 0 1 1 1 0 1 0 8800 1.138 256 | 1 -0.37851 0 1 0 1 0 1 0 0 0 0 1 0 66768 0.685 257 | 0 0 0 1 1 0 0 0 1 0 0 0 1 0 25185 4.778 258 | 0 0 0 1 0 0 0 0 0 0 0 1 0 0 836 0.568 259 | 0 0 0 1 0 1 0 0 0 0 1 0 0 0 5005 0.239 260 | 0 0 0 1 0 0 0 0 0 0 1 0 1 1 105105 1.412 261 | 1 -0.96227 0 1 1 0 0 0 1 0 0 0 1 0 53582 2.524 262 | 0 0 1 1 1 0 0 0 1 0 0 0 1 0 15700 1.576 263 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 899 1.071 264 | 0 0 1 1 0 1 0 0 0 0 0 1 0 1 187000 1.338 265 | -------------------------------------------------------------------------------- /annotations/gt_fel_diningtable.txt: -------------------------------------------------------------------------------- 1 | det conf occ p1 p2 v1 v2 size ratio(w/h) 2 | 0 0 1 1 1 1 1 36072 1.295 3 | 0 0 2 1 1 1 1 17700 1.778 4 | 0 0 2 1 1 1 1 6188 5.485 5 | 0 0 2 0 1 0 1 43472 2.134 6 | 0 0 1 0 1 1 1 41550 1.852 7 | 0 0 1 1 1 1 1 35778 2.000 8 | 0 0 3 0 1 0 1 57088 1.149 9 | 0 0 2 1 1 1 1 8701 1.474 10 | 0 0 2 0 1 0 1 143500 1.745 11 | 0 0 0 1 1 1 1 58844 0.599 12 | 0 0 2 0 1 0 1 48258 3.056 13 | 0 0 2 1 1 1 1 23112 1.991 14 | 0 0 1 0 1 0 1 7979 1.282 15 | 0 0 1 0 1 0 1 4000 1.612 16 | 0 0 1 0 1 0 1 8526 0.277 17 | 0 0 1 0 1 1 1 1750 1.441 18 | 1 -0.4831 1 1 1 1 1 71610 1.627 19 | 0 0 2 0 1 0 1 57120 2.239 20 | 1 -0.2587 2 0 1 0 1 142590 1.686 21 | 1 -0.65625 2 0 1 0 1 71269 1.635 22 | 1 -0.46193 2 0 1 0 1 128960 1.911 23 | 1 -0.62069 1 1 1 1 1 128892 1.695 24 | 1 -0.7387 1 0 1 0 1 92256 2.676 25 | 0 0 1 0 1 0 1 44405 3.906 26 | 1 -0.70135 2 1 1 1 1 49610 1.181 27 | 0 0 2 0 1 0 1 52438 2.135 28 | 0 0 2 1 1 1 1 15022 2.767 29 | 1 -0.71668 2 1 1 1 1 51816 1.246 30 | 0 0 1 1 1 1 1 27004 1.096 31 | 1 0.26117 1 1 1 1 1 104976 2.256 32 | 1 -0.418 3 0 1 0 1 70892 3.252 33 | 0 0 3 0 1 0 1 140958 0.966 34 | 1 0.49262 1 0 1 0 1 120786 2.000 35 | 0 0 0 0 1 0 1 23217 4.657 36 | 1 -0.7091 1 0 1 0 1 141732 0.976 37 | 0 0 1 0 1 1 1 15447 4.821 38 | 1 -0.85883 2 1 1 1 1 56760 2.091 39 | 1 -0.69335 2 0 1 0 1 163183 1.491 40 | 0 0 2 0 1 0 1 83054 0.826 41 | 1 -0.27238 2 1 1 0 1 83839 2.040 42 | 0 0 0 1 1 1 1 10008 0.514 43 | 1 -0.23356 1 1 1 1 1 76050 1.504 44 | 1 -0.13703 2 0 1 0 1 77745 1.624 45 | 1 -0.88287 2 1 1 1 1 70411 2.360 46 | 0 0 2 0 1 0 1 178143 1.399 47 | 0 0 1 0 1 0 1 77376 3.194 48 | 1 -0.80641 3 0 1 1 1 60060 1.126 49 | 1 -0.45475 1 1 1 1 1 40600 1.938 50 | 1 -0.35287 1 1 1 1 1 77520 2.153 51 | 0 0 1 0 1 1 1 20844 1.794 52 | 1 -0.85952 2 0 1 1 1 12078 2.800 53 | 1 -0.55703 2 0 1 0 1 134862 1.813 54 | 0 0 1 1 1 1 1 6962 2.017 55 | 1 -0.73531 2 1 1 1 1 94965 2.505 56 | 1 -0.40642 2 0 1 0 1 37278 2.885 57 | 1 -0.53967 1 0 1 1 1 37204 2.177 58 | 1 -0.21058 1 0 1 1 1 7548 2.940 59 | 1 -0.04277 1 1 1 1 1 56235 2.123 60 | 1 -0.46607 1 1 1 1 1 25938 1.515 61 | 0 0 1 1 1 1 1 7875 2.000 62 | 1 -0.44047 1 0 1 0 1 120780 2.033 63 | 1 -0.50418 3 0 1 0 1 126731 1.607 64 | 0 0 0 1 1 1 1 21500 1.379 65 | 0 0 0 1 1 1 0 12726 0.800 66 | 1 0.31083 1 0 1 0 1 50566 2.962 67 | 0 0 2 1 1 1 1 16416 1.411 68 | 0 0 2 1 1 1 1 53457 1.791 69 | 1 -0.61007 3 0 1 0 1 59740 2.854 70 | 1 -0.15358 0 1 1 1 1 49686 1.503 71 | 1 -0.52514 1 0 1 0 1 94050 1.245 72 | 0 0 2 1 1 1 1 64256 0.980 73 | 0 0 2 1 1 1 0 34196 3.245 74 | 1 -0.40283 2 0 1 1 1 53200 1.476 75 | 1 -0.30187 1 1 1 1 1 72080 1.607 76 | 0 0 2 0 1 0 1 124832 0.883 77 | 0 0 1 1 1 1 1 45864 1.195 78 | 1 -0.38945 3 0 1 0 1 46170 2.545 79 | 1 0.27371 2 0 1 1 1 61950 1.983 80 | 1 -0.59263 1 1 1 1 1 44200 1.106 81 | 1 0.14566 2 0 1 0 1 127958 1.707 82 | 1 -0.8001 3 0 1 0 1 136136 1.028 83 | 1 -0.010807 1 0 1 0 1 133500 1.876 84 | 1 -0.38478 2 0 1 0 1 99591 1.398 85 | 0 0 1 0 1 0 1 152516 1.152 86 | 1 -0.89982 1 1 0 1 0 33142 1.559 87 | 1 -0.50601 1 0 1 1 1 34443 2.078 88 | 0 0 1 0 1 1 1 10290 2.116 89 | 0 0 1 0 1 1 1 23980 2.028 90 | 0 0 1 0 1 0 1 51792 2.135 91 | 1 0.05321 1 0 1 1 1 115038 2.161 92 | 0 0 2 0 1 0 1 166500 1.503 93 | 0 0 2 0 1 0 1 32250 1.945 94 | 0 0 1 1 1 1 1 8664 1.507 95 | 0 0 1 0 1 0 1 65369 3.831 96 | 0 0 1 0 1 0 1 151302 1.357 97 | 1 -0.77132 1 1 1 1 1 10788 3.246 98 | 0 0 1 0 1 1 1 4386 3.879 99 | 0 0 3 0 1 0 1 35723 1.855 100 | 1 -0.5522 2 1 1 1 1 81940 1.413 101 | 1 -0.46306 3 0 1 0 1 51156 2.377 102 | 1 -0.76433 2 0 1 0 1 76405 0.878 103 | 1 -0.57741 3 0 1 0 1 103792 2.406 104 | 0 0 2 0 1 0 1 42971 4.604 105 | 1 -0.54166 2 1 1 1 1 86680 2.240 106 | 0 0 1 1 1 1 0 21980 0.891 107 | 1 -0.76379 2 0 1 0 1 62205 1.639 108 | 1 -0.13617 2 1 1 1 1 67925 1.558 109 | 1 -0.68272 1 0 1 0 1 72500 3.465 110 | 1 -0.079396 2 1 1 1 1 116312 1.895 111 | 1 -0.87941 2 0 1 1 1 32663 4.159 112 | 1 -0.45218 2 0 1 1 1 48576 1.571 113 | 1 -0.90455 2 0 1 1 1 95432 1.047 114 | 1 -0.79034 1 0 1 0 1 66893 2.947 115 | 1 -0.81728 1 0 1 0 1 120848 0.912 116 | 1 -0.4768 1 1 1 1 1 74108 2.037 117 | 1 -0.7414 2 0 1 1 1 69915 2.239 118 | 1 -0.93498 3 0 1 0 1 165000 1.517 119 | 1 -0.86999 1 1 1 1 1 53550 1.858 120 | 0 0 2 1 1 1 1 34362 1.810 121 | 0 0 2 0 1 0 1 172326 0.807 122 | 1 -0.76954 2 0 1 0 1 149296 1.650 123 | 1 -0.50913 0 1 1 1 0 58968 0.928 124 | 1 -0.90283 2 0 1 0 1 168000 0.837 125 | 0 0 2 1 1 1 1 7220 1.253 126 | 1 -0.82 1 1 1 1 1 43806 1.980 127 | 1 0.17891 2 1 1 1 1 112050 2.219 128 | 0 0 0 1 1 1 1 25551 1.092 129 | 1 -0.61643 2 1 1 1 1 18966 1.602 130 | 0 0 1 1 1 1 1 23940 1.512 131 | 0 0 3 0 1 1 1 12675 3.031 132 | 0 0 2 1 1 1 1 89102 1.003 133 | 1 -0.71411 1 0 1 0 1 169000 1.481 134 | 0 0 3 0 1 0 1 101559 1.200 135 | 1 -0.16388 1 1 1 1 1 20608 1.649 136 | 1 -0.73716 1 1 1 1 1 7905 1.095 137 | 1 -0.70854 1 0 1 1 1 8625 1.541 138 | 1 -0.21099 1 0 1 1 1 7049 2.538 139 | 0 0 2 1 1 1 1 4380 0.819 140 | 1 -0.15596 2 0 1 0 1 104647 2.035 141 | 1 -0.71065 2 0 1 0 1 91154 1.612 142 | 1 -0.46245 1 0 1 1 1 145000 1.727 143 | 1 -0.30685 2 0 1 1 1 53088 1.886 144 | 0 0 1 1 1 1 1 20700 1.570 145 | 0 0 1 0 1 1 1 20383 0.581 146 | 0 0 0 1 1 1 1 21222 1.238 147 | 1 -0.765 2 0 1 1 1 49997 1.674 148 | 0 0 2 0 1 0 1 180306 1.311 149 | 1 -0.63862 1 1 1 1 0 3819 0.848 150 | 1 -0.75375 2 0 1 0 1 51474 2.715 151 | 0 0 2 1 1 1 1 34182 1.304 152 | 1 -0.14725 1 0 1 1 1 80275 2.821 153 | 1 -0.87583 0 1 1 1 1 15840 1.622 154 | 1 -0.10049 1 1 1 1 1 36894 1.810 155 | 1 -0.32326 2 0 1 0 1 142000 1.763 156 | 1 -0.25054 2 0 1 1 1 59444 2.516 157 | 1 0.79448 1 1 1 1 1 44274 2.236 158 | 1 -0.38204 1 1 1 1 1 36273 3.189 159 | 1 -0.23074 2 0 1 0 1 153692 1.622 160 | 1 -0.64286 1 0 1 0 1 116584 2.098 161 | 0 0 0 1 1 1 0 11102 0.744 162 | 1 -0.57463 2 1 1 1 1 31800 1.416 163 | 0 0 1 1 1 1 1 11433 1.078 164 | 1 -0.54654 1 0 1 1 1 28449 2.407 165 | 1 -0.7531 2 0 1 0 1 30959 4.537 166 | 1 -0.57063 1 0 1 1 1 36828 2.407 167 | 0 0 2 0 1 1 1 27068 2.670 168 | 1 -0.92722 2 0 1 1 1 77520 1.193 169 | 0 0 1 1 1 1 0 32747 1.606 170 | 1 -0.56915 2 1 1 1 1 42935 1.792 171 | 1 -0.70947 1 1 1 1 1 23166 1.134 172 | 1 -0.57128 1 0 1 0 1 83990 1.633 173 | 1 -0.46845 2 0 1 1 1 148840 1.602 174 | 1 -0.80182 1 0 1 1 1 37248 2.283 175 | 1 -0.93031 2 0 1 1 1 69764 2.636 176 | 1 -0.36167 2 0 1 1 1 94354 1.549 177 | 1 -0.2902 2 1 1 1 1 154567 1.600 178 | 1 -0.15486 1 1 1 1 1 19418 1.098 179 | 0 0 1 1 1 1 0 36464 1.234 180 | 1 -0.77043 1 0 1 0 1 123000 2.037 181 | 1 -0.62018 3 0 1 0 1 77173 1.474 182 | 0 0 2 0 1 0 1 154577 0.708 183 | 0 0 2 0 1 1 1 39037 3.706 184 | 0 0 1 1 1 1 1 6643 0.800 185 | 0 0 2 0 1 1 1 78496 2.543 186 | 1 -0.37483 1 0 1 1 1 80352 3.075 187 | 1 -0.69198 1 1 1 1 1 18860 1.430 188 | 1 -0.65888 0 1 1 1 1 45276 1.179 189 | 0 0 1 0 1 1 1 54000 4.664 190 | 1 -0.38887 2 0 1 1 1 91800 2.212 191 | 1 -0.32096 2 0 1 1 1 43429 2.324 192 | 1 -0.25489 2 0 1 1 1 91264 2.705 193 | 1 -0.33651 2 0 1 1 1 72000 1.424 194 | 1 -0.92699 2 0 1 0 1 174096 1.414 195 | 1 -0.54168 2 0 1 1 1 70490 1.004 196 | 1 -0.51227 2 1 1 1 1 18318 1.102 197 | 0 0 1 0 1 0 1 145416 1.708 198 | 1 -0.5093 1 1 1 1 1 60997 1.867 199 | 0 0 1 0 1 1 1 48138 3.795 200 | 0 0 1 1 1 1 1 13375 1.170 201 | 1 -0.72787 1 0 1 0 1 173153 1.439 202 | 1 -0.14619 2 0 1 1 1 65527 2.538 203 | 1 -0.4399 2 0 1 1 1 64020 1.324 204 | 1 -0.93765 2 0 1 1 1 37760 1.478 205 | 1 -0.19593 1 1 1 1 1 60564 2.815 206 | 0 0 2 0 1 1 1 17936 1.291 207 | 0 0 1 1 1 1 0 5576 0.827 208 | -------------------------------------------------------------------------------- /annotations/gt_ved_boat.txt: -------------------------------------------------------------------------------- 1 | det conf occ p1 p2 p3 p4 p5 p6 v1 v2 v3 v4 v5 size ratio(w/h) 2 | 1 -0.42395 1 1 1 0 0 0 1 0 0 0 1 0 51562 3.214 3 | 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1944 0.287 4 | 0 0 0 1 1 1 0 0 0 0 1 0 1 0 1344 1.323 5 | 1 -0.39111 1 1 0 0 0 1 0 0 1 0 1 0 93886 0.952 6 | 0 0 0 1 1 1 0 0 0 0 0 0 1 0 4704 2.064 7 | 0 0 0 1 0 1 0 1 0 0 0 0 1 0 100905 0.466 8 | 1 -0.35839 1 1 1 0 0 0 1 0 0 0 1 0 3619 1.652 9 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1196 0.556 10 | 1 -0.81354 0 1 1 0 0 0 0 0 1 0 1 0 3200 2.026 11 | 0 0 1 1 0 0 0 1 0 0 0 0 1 0 2236 0.824 12 | 0 0 1 1 1 0 0 1 0 0 0 0 1 0 3645 1.818 13 | 0 0 1 1 1 1 0 0 0 0 1 0 1 0 11130 2.290 14 | 1 -0.77353 0 1 0 1 0 0 0 0 1 0 1 1 165580 1.434 15 | 1 -0.95441 0 1 0 1 0 1 0 0 0 0 1 0 107244 1.022 16 | 0 0 1 1 0 0 0 1 0 0 0 0 1 0 149000 1.680 17 | 0 0 1 1 1 0 0 0 0 0 1 0 1 0 34944 1.439 18 | 0 0 1 1 1 0 0 0 0 0 1 0 1 0 49449 1.962 19 | 0 0 2 0 1 0 0 0 0 0 1 0 1 0 20165 1.704 20 | 0 0 1 1 1 0 0 0 1 0 1 0 1 0 22788 1.963 21 | 1 -0.37377 0 1 0 0 0 1 0 0 0 0 1 0 4389 0.737 22 | 1 -0.6154 0 1 0 0 0 1 0 0 0 0 1 0 6240 0.674 23 | 1 -0.060141 0 1 0 1 0 0 0 0 0 0 1 1 45333 1.058 24 | 1 -0.38035 0 1 0 0 0 1 0 0 0 0 1 0 69130 0.718 25 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 49344 0.746 26 | 0 0 0 1 0 0 0 1 0 0 1 0 1 0 56023 0.260 27 | 1 -0.14375 0 1 1 0 0 0 1 1 1 0 1 0 25893 1.382 28 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 9975 1.106 29 | 0 0 0 1 0 0 0 0 0 0 1 0 1 0 71100 2.201 30 | 1 -0.77032 1 1 1 1 0 0 0 0 1 0 1 0 136728 0.767 31 | 1 -0.47553 0 1 1 0 0 0 0 0 1 0 1 0 68283 1.157 32 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 19701 0.495 33 | 1 -0.54858 0 1 0 0 0 0 0 0 1 0 0 0 15092 1.577 34 | 1 -0.20375 0 1 0 0 0 0 0 0 0 0 1 0 7497 2.920 35 | 0 0 1 1 0 0 0 0 0 0 0 1 1 0 12078 3.283 36 | 0 0 2 1 0 0 0 0 0 0 0 1 1 0 3002 2.108 37 | 0 0 0 1 0 0 0 0 0 0 0 1 1 0 1300 1.960 38 | 0 0 0 1 0 0 0 0 0 0 1 0 1 0 29944 0.770 39 | 1 0.059318 0 1 0 1 0 0 0 0 1 0 1 0 55125 1.805 40 | 0 0 0 1 0 0 0 0 0 0 0 1 0 0 930 1.034 41 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 850 1.375 42 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 945 1.308 43 | 0 0 0 1 0 0 0 0 0 0 1 0 1 0 990 1.103 44 | 1 -0.74424 0 1 0 0 0 0 0 0 0 0 1 0 966 1.864 45 | 0 0 0 1 0 0 0 0 0 0 1 0 1 0 5244 0.907 46 | 1 -0.63232 0 1 1 0 0 0 0 0 1 0 1 0 3871 1.625 47 | 0 0 1 1 1 0 0 0 0 0 1 0 1 0 1800 1.128 48 | 0 0 1 1 1 0 0 0 0 0 1 0 1 0 2150 1.167 49 | 1 -0.87826 0 1 0 1 0 1 0 0 0 0 1 0 165750 0.848 50 | 1 -0.45631 0 1 0 1 0 0 0 0 0 0 1 0 9394 0.628 51 | 0 0 1 1 0 0 0 0 0 0 1 0 1 0 111714 1.681 52 | 1 -0.0021675 0 1 1 0 0 0 0 0 0 0 1 0 2613 1.737 53 | 1 -0.35833 0 1 0 0 0 1 0 0 0 0 1 0 34454 0.751 54 | 0 0 0 1 0 1 0 0 0 0 1 0 1 0 6336 0.684 55 | 0 0 0 1 0 1 0 0 0 0 1 0 1 0 2660 0.453 56 | 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1462 1.273 57 | 0 0 1 1 1 0 0 0 0 0 1 0 1 0 1620 1.828 58 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 1856 1.839 59 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 1952 1.935 60 | 1 -0.46452 0 1 0 0 0 0 0 0 0 0 1 1 21112 6.368 61 | 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1260 1.029 62 | 1 -0.66006 0 1 1 0 0 0 1 0 0 0 1 0 2834 4.320 63 | 0 0 0 1 1 0 0 0 1 0 0 0 1 0 1752 3.130 64 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 1173 2.273 65 | 1 -0.79323 0 1 1 0 0 0 1 0 1 0 1 0 81720 2.531 66 | 1 -0.36089 0 1 1 0 0 0 0 0 1 0 1 0 113880 1.337 67 | 1 0.1043 0 1 0 0 0 1 0 0 0 0 1 0 20895 0.525 68 | 1 0.050752 0 1 0 1 0 1 0 0 0 0 1 0 36735 0.653 69 | 1 -0.52427 1 1 1 0 0 0 0 0 0 0 1 1 45279 3.328 70 | 1 -0.92777 0 1 0 0 0 0 0 0 0 0 1 1 30720 3.358 71 | 1 -0.43846 1 1 1 0 0 0 0 0 1 0 1 0 145824 1.689 72 | 0 0 0 1 1 1 0 0 0 0 1 0 1 1 38016 0.970 73 | 0 0 1 1 1 0 0 0 0 0 1 0 1 0 32518 1.617 74 | 1 -0.39104 0 1 1 0 0 0 0 0 0 0 1 0 21513 4.314 75 | 1 -0.54096 0 1 1 0 0 0 0 0 0 0 1 0 3572 2.514 76 | 1 -0.28373 1 1 0 0 0 0 0 0 0 0 1 0 17301 3.278 77 | 1 -1.0095 3 1 0 0 0 0 0 0 0 0 1 0 3999 4.267 78 | 0 0 0 1 0 0 0 0 0 1 1 0 1 0 106134 0.666 79 | 1 -0.68596 0 1 0 0 0 0 0 0 1 0 1 0 5840 1.097 80 | 1 -0.83334 1 1 0 0 0 0 0 0 0 0 1 0 1875 3.083 81 | 0 0 0 1 1 0 0 0 0 0 0 0 1 0 46360 3.132 82 | 1 0.56759 0 1 0 1 0 1 0 0 0 0 1 0 73656 0.632 83 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 3772 0.440 84 | 0 0 0 1 1 1 0 0 0 0 0 0 1 0 58302 0.963 85 | 1 -0.39585 0 1 0 1 0 0 0 0 0 0 1 0 116440 1.445 86 | 1 0.33012 0 1 0 0 0 0 0 0 0 0 1 0 1408 3.000 87 | 0 0 2 1 0 1 0 0 0 0 0 0 1 0 20930 0.806 88 | 1 -0.24263 2 1 0 1 0 0 0 0 0 0 1 0 23424 0.698 89 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 19720 0.680 90 | 0 0 1 1 0 1 0 0 0 0 1 0 0 0 3927 0.271 91 | 0 0 0 1 0 0 0 0 0 0 1 0 0 0 31436 2.348 92 | 1 -0.11721 0 1 0 1 0 1 0 0 0 0 1 0 29250 0.466 93 | 0 0 1 1 0 1 0 0 0 0 0 0 1 0 22939 0.554 94 | 1 -0.18567 0 1 0 1 0 0 0 0 0 0 1 0 5800 0.576 95 | 1 -0.71948 0 1 0 1 0 0 0 0 0 0 0 1 57824 3.007 96 | 1 0.84946 0 1 0 1 0 1 0 0 0 0 1 0 43050 0.710 97 | 1 -1.082 0 1 0 0 0 0 0 0 1 0 0 0 74108 0.507 98 | 1 -1.5735 1 1 0 0 0 0 0 0 1 0 0 0 25320 0.567 99 | 1 -0.59427 1 1 0 0 0 0 0 0 0 1 1 1 32832 1.424 100 | 0 0 0 1 0 1 0 0 0 0 1 0 1 0 85260 0.986 101 | 1 -0.66501 0 1 1 0 0 0 1 0 0 0 1 0 42042 4.412 102 | 0 0 1 1 0 0 0 0 0 0 1 0 0 0 1360 1.182 103 | 0 0 0 1 0 1 0 1 0 0 0 0 1 0 53345 0.966 104 | 0 0 0 1 0 0 0 0 0 0 1 0 1 0 4074 2.341 105 | 0 0 2 1 0 0 0 0 0 0 1 0 1 0 7007 2.958 106 | 1 -0.49999 0 1 0 1 0 1 0 0 0 0 1 0 25560 0.561 107 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 8307 0.603 108 | 0 0 0 1 1 0 0 0 0 0 0 0 1 0 4428 2.675 109 | 0 0 1 1 1 0 0 0 1 0 0 0 1 0 25833 4.179 110 | 1 -0.55171 1 1 1 0 0 0 1 0 1 0 1 1 66732 3.737 111 | 1 0.2317 0 1 1 0 0 0 0 0 1 0 1 1 20540 1.217 112 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 1974 1.122 113 | 0 0 0 1 0 0 0 0 0 0 0 1 1 1 50170 0.595 114 | 0 0 0 1 0 0 0 0 0 0 0 0 1 1 30976 1.898 115 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 6012 4.743 116 | 0 0 1 1 0 0 0 0 0 0 0 0 1 1 12180 3.667 117 | 0 0 1 1 0 0 0 0 0 0 0 0 1 1 19008 3.704 118 | 1 -1.1347 1 1 0 0 0 0 0 0 0 0 1 0 4200 5.519 119 | 0 0 1 1 0 0 0 0 0 0 1 0 1 0 37408 0.744 120 | 0 0 0 1 1 0 0 0 0 0 0 0 1 0 165336 0.666 121 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1248 5.133 122 | 1 -0.16825 0 1 1 1 0 0 1 0 0 0 1 0 44147 2.585 123 | 1 -0.68861 1 1 1 0 0 0 0 1 1 0 1 0 66862 1.642 124 | 1 -0.35324 0 1 0 0 0 0 0 0 0 0 1 0 18704 6.055 125 | 0 0 0 1 0 1 0 0 0 0 1 0 1 0 2091 0.800 126 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 10850 0.227 127 | 1 -0.48784 0 1 0 0 0 1 0 0 0 1 1 0 62425 0.825 128 | 1 -0.23309 0 1 0 0 0 0 0 0 1 0 1 1 21412 2.110 129 | 1 -1.2102 0 1 0 0 0 0 0 0 1 0 1 0 102630 1.061 130 | 1 -0.90757 0 1 0 0 0 1 0 0 0 0 1 0 83485 0.959 131 | 1 -0.94576 0 1 1 1 0 0 0 0 0 0 1 0 15429 1.255 132 | 0 0 1 1 0 0 1 0 0 0 0 0 0 1 18018 2.987 133 | 0 0 0 1 0 0 1 0 0 0 1 0 1 0 2291 2.786 134 | 1 -0.68927 0 1 1 0 0 0 0 0 1 0 1 0 4558 2.500 135 | 1 -0.25842 0 1 1 0 0 0 0 0 1 0 1 0 5194 1.865 136 | 1 0.1906 0 1 1 0 0 0 1 0 0 0 1 0 17280 4.270 137 | 0 0 2 1 0 1 0 0 0 0 0 0 1 0 22256 1.953 138 | 1 -0.98888 1 1 0 0 0 0 0 0 0 0 1 1 3708 2.914 139 | 1 -0.48383 0 1 0 1 0 1 0 0 0 0 1 0 828 0.629 140 | 1 -0.027623 0 1 1 0 0 0 1 0 0 0 1 0 12529 2.818 141 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1159 3.333 142 | 1 -0.7212 0 1 1 0 0 0 1 0 0 0 1 0 41328 3.315 143 | 1 -0.86374 0 0 1 0 0 0 0 0 0 1 0 0 118881 1.072 144 | 0 0 0 1 0 1 0 0 0 0 1 0 1 1 103304 0.848 145 | 1 -0.5841 1 1 0 1 0 0 0 0 0 1 1 0 108225 1.025 146 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 21684 3.597 147 | 1 -0.24088 0 1 0 1 0 0 0 0 0 0 1 0 2442 1.806 148 | 1 -1.0706 0 1 1 0 0 0 0 0 0 0 1 0 51392 2.421 149 | 1 -0.48823 1 1 1 0 0 0 0 0 0 0 1 1 40120 2.897 150 | 1 -0.48433 0 1 0 0 0 0 0 0 0 0 1 0 2001 2.429 151 | 1 -0.63256 0 1 0 0 0 0 0 0 0 0 1 0 2090 4.476 152 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 800 3.267 153 | 0 0 1 1 0 0 0 0 0 0 0 0 1 0 928 3.800 154 | 0 0 1 1 0 0 0 0 0 0 0 0 1 0 3190 3.893 155 | 1 -0.51731 0 1 1 0 0 0 1 0 1 0 1 1 122944 1.664 156 | 0 0 1 1 0 0 0 0 0 0 0 1 1 0 63481 1.606 157 | 0 0 0 1 0 1 0 1 0 0 0 0 1 0 25020 0.771 158 | 1 -0.42696 0 1 0 1 0 1 0 0 0 0 1 0 39072 0.792 159 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 12155 0.592 160 | 1 -0.31825 0 1 1 0 0 0 0 0 0 0 1 0 15958 1.570 161 | 0 0 2 1 0 1 0 0 0 0 0 0 1 0 7568 1.024 162 | 1 -0.57938 0 1 0 0 0 0 0 0 0 0 1 0 3150 1.805 163 | 1 -0.42533 0 1 0 1 0 0 0 0 1 0 1 0 1890 0.377 164 | 1 -0.26512 1 1 1 0 0 0 0 0 0 0 1 0 32136 3.049 165 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 6864 0.631 166 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 3822 2.195 167 | 1 -0.60503 0 1 0 0 0 1 0 0 0 0 1 0 148335 0.685 168 | 1 -0.7473 0 1 1 0 0 0 0 0 0 0 1 0 35868 3.763 169 | 0 0 1 1 0 0 0 0 1 0 0 0 1 0 5671 2.038 170 | 0 0 1 1 0 0 0 0 0 0 1 0 1 1 4070 1.352 171 | 0 0 2 1 0 0 0 0 0 0 0 0 1 1 7392 1.708 172 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 7296 2.268 173 | 1 0.28588 0 1 0 1 0 1 0 0 1 0 0 0 134235 0.604 174 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 459 0.615 175 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 2209 1.000 176 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1050 1.708 177 | 0 0 0 1 1 0 0 0 0 0 0 0 1 0 1595 1.929 178 | 1 -0.7566 1 1 1 0 0 0 0 0 1 0 1 0 22260 2.029 179 | 1 -0.45611 2 1 1 0 0 0 0 0 0 1 1 0 24625 1.581 180 | 1 -0.27149 0 1 0 1 0 1 0 0 0 0 1 0 64815 0.341 181 | 0 0 0 1 0 1 0 1 0 0 0 0 1 1 129090 0.848 182 | 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1100 0.558 183 | 1 -0.10028 0 1 0 0 0 0 0 0 0 1 1 1 1702 1.250 184 | 1 0.15495 0 1 0 1 0 0 0 0 0 0 1 0 7650 0.733 185 | 1 -0.79001 0 1 0 0 0 0 0 0 0 0 1 0 12690 4.415 186 | 1 -0.22076 0 1 0 1 0 1 0 0 1 0 1 0 9480 0.655 187 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1088 0.939 188 | 1 -0.41792 0 1 0 0 0 1 0 0 0 0 1 0 16471 0.500 189 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 15224 0.506 190 | 0 0 0 1 0 1 0 1 0 0 0 0 1 0 107062 1.481 191 | 0 0 0 1 0 1 0 0 0 0 1 0 0 0 2256 0.247 192 | 0 0 0 1 1 0 0 0 1 0 0 1 1 0 3540 1.017 193 | 0 0 2 1 1 0 0 0 1 0 0 1 1 0 2145 1.421 194 | 1 -0.84049 0 1 0 0 0 0 0 0 1 0 1 1 69930 1.589 195 | 1 -0.095951 0 1 1 1 0 0 0 0 0 0 1 0 6545 0.905 196 | 1 -0.23676 0 1 0 1 0 0 0 0 0 0 1 0 2660 0.536 197 | 0 0 1 1 0 0 0 1 0 0 1 0 1 0 10764 0.248 198 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 4902 3.459 199 | 0 0 0 1 0 1 0 1 0 0 1 0 1 0 64600 0.558 200 | 1 -0.63596 0 1 0 1 0 0 0 0 0 0 1 0 110565 1.485 201 | 1 -0.67146 0 1 1 0 0 0 0 0 0 1 1 0 9165 2.188 202 | 1 -0.7201 0 1 0 0 0 0 0 0 0 0 1 0 1140 3.278 203 | 0 0 0 1 0 1 0 0 0 0 1 0 1 0 84762 1.105 204 | 0 0 0 1 1 1 0 0 1 0 0 1 1 0 135278 1.656 205 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 2604 3.407 206 | 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1976 3.000 207 | 1 -0.60764 0 1 0 0 0 0 0 0 1 0 1 0 28690 3.202 208 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 9610 2.525 209 | 1 -0.33347 1 1 1 0 0 0 1 1 1 0 1 0 82880 2.429 210 | 0 0 2 1 0 0 0 0 0 0 0 0 1 1 23980 0.493 211 | 1 -0.23205 0 1 0 0 0 0 0 0 0 0 1 0 8321 3.000 212 | 1 -0.2473 0 1 0 1 0 0 0 0 0 0 1 0 12104 0.652 213 | 0 0 2 1 0 0 0 0 0 0 0 0 1 0 9118 4.196 214 | 0 0 0 1 1 1 0 0 0 0 0 1 0 0 36630 0.934 215 | 1 -0.65538 0 1 0 1 0 0 0 0 0 0 1 0 101304 1.598 216 | 0 0 1 1 0 0 0 0 0 0 0 1 1 0 102410 2.351 217 | 1 -0.48259 0 1 1 0 0 0 1 0 1 0 1 0 85239 1.600 218 | 1 -0.87222 0 1 0 1 0 0 0 0 0 0 1 0 18426 0.667 219 | 0 0 0 1 1 0 0 0 1 0 0 0 1 1 109250 2.070 220 | 0 0 0 1 0 0 0 1 0 0 1 0 1 0 23478 0.313 221 | 0 0 0 1 0 0 0 1 0 0 1 0 1 0 6600 0.374 222 | 1 -0.62937 0 1 1 0 0 0 0 0 0 0 1 0 82416 1.985 223 | 1 -1.0107 1 1 0 0 0 0 0 0 0 0 1 0 24806 1.006 224 | 1 -0.68511 0 1 1 0 0 0 0 0 1 0 1 1 52332 1.655 225 | 0 0 1 1 0 0 0 0 0 0 1 0 1 0 49910 3.798 226 | 1 -0.12215 1 1 0 1 0 1 0 0 0 0 1 0 28623 0.693 227 | 0 0 0 1 0 1 0 0 0 0 1 0 0 0 2223 0.679 228 | 0 0 1 1 0 0 0 0 0 0 1 0 0 0 1216 1.194 229 | 0 0 0 1 0 0 0 0 0 0 1 0 0 0 504 1.150 230 | 1 -1.0309 0 1 0 0 0 0 0 0 0 0 1 0 1302 3.050 231 | 1 -0.29831 1 1 1 0 0 0 0 0 1 0 1 0 3936 1.723 232 | 0 0 0 1 0 0 0 0 0 0 0 0 1 0 832 3.400 233 | 1 -0.58008 0 1 0 1 0 0 0 0 0 0 1 0 8216 0.757 234 | 1 0.097652 0 1 0 1 0 0 0 0 0 0 1 0 72420 0.573 235 | 1 -0.63235 0 1 0 0 0 1 0 0 0 0 1 0 41772 1.335 236 | 1 -0.33363 1 1 1 0 0 0 0 0 1 0 1 0 34540 2.872 237 | 1 -0.66784 0 1 1 0 0 0 0 0 0 1 1 0 9118 0.969 238 | 1 -0.054601 1 1 1 0 0 0 1 0 1 0 1 0 51982 2.089 239 | 1 -0.61252 0 1 1 0 0 0 1 0 0 0 1 0 25273 1.571 240 | 1 -0.81042 1 1 0 0 0 0 0 0 0 1 1 1 34600 1.157 241 | 1 -0.59292 1 1 0 0 0 0 0 0 0 0 1 0 33345 3.723 242 | 1 -0.87991 2 1 0 0 0 0 0 0 0 1 0 0 14700 1.475 243 | 1 0.42138 0 1 0 1 0 1 0 0 0 0 1 0 80100 0.890 244 | 1 -0.23126 2 1 1 0 0 0 0 0 0 0 1 0 27936 3.053 245 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 2419 0.690 246 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1160 0.718 247 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1551 0.696 248 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1848 0.582 249 | 0 0 0 1 0 0 0 1 0 0 0 0 1 0 759 0.688 250 | 0 0 0 1 0 1 0 0 0 0 0 0 1 0 31773 0.247 251 | 0 0 0 1 0 0 0 0 0 0 0 1 1 1 8174 2.217 252 | 0 0 1 1 0 0 0 0 0 0 0 1 0 0 89500 2.803 253 | 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1500 3.895 254 | 0 0 0 1 1 0 0 0 0 0 0 0 1 0 1242 2.409 255 | 0 0 0 1 1 0 0 0 1 1 1 0 1 0 8800 1.138 256 | 1 0.076578 0 1 0 1 0 1 0 0 0 0 1 0 66768 0.685 257 | 0 0 0 1 1 0 0 0 1 0 0 0 1 0 25185 4.778 258 | 0 0 0 1 0 0 0 0 0 0 0 1 0 0 836 0.568 259 | 0 0 0 1 0 1 0 0 0 0 1 0 0 0 5005 0.239 260 | 0 0 0 1 0 0 0 0 0 0 1 0 1 1 105105 1.412 261 | 0 0 0 1 1 0 0 0 1 0 0 0 1 0 53582 2.524 262 | 0 0 1 1 1 0 0 0 1 0 0 0 1 0 15700 1.576 263 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 899 1.071 264 | 0 0 1 1 0 1 0 0 0 0 0 1 0 1 187000 1.338 265 | -------------------------------------------------------------------------------- /annotations/gt_ved_diningtable.txt: -------------------------------------------------------------------------------- 1 | det conf occ p1 p2 v1 v2 size ratio(w/h) 2 | 1 -0.97123 1 1 1 1 1 36072 1.295 3 | 1 -0.59101 2 1 1 1 1 17700 1.778 4 | 0 0 2 1 1 1 1 6188 5.485 5 | 1 -0.89588 2 0 1 0 1 43472 2.134 6 | 1 -0.79971 1 0 1 1 1 41550 1.852 7 | 1 -0.75341 1 1 1 1 1 35778 2.000 8 | 0 0 3 0 1 0 1 57088 1.149 9 | 0 0 2 1 1 1 1 8701 1.474 10 | 1 -0.85212 2 0 1 0 1 143500 1.745 11 | 0 0 0 1 1 1 1 58844 0.599 12 | 1 -0.75924 2 0 1 0 1 48258 3.056 13 | 1 -0.62519 2 1 1 1 1 23112 1.991 14 | 0 0 1 0 1 0 1 7979 1.282 15 | 0 0 1 0 1 0 1 4000 1.612 16 | 0 0 1 0 1 0 1 8526 0.277 17 | 0 0 1 0 1 1 1 1750 1.441 18 | 1 -0.74998 1 1 1 1 1 71610 1.627 19 | 0 0 2 0 1 0 1 57120 2.239 20 | 1 -0.91521 2 0 1 0 1 142590 1.686 21 | 1 -0.8374 2 0 1 0 1 71269 1.635 22 | 1 -0.9028 2 0 1 0 1 128960 1.911 23 | 1 -0.74389 1 1 1 1 1 128892 1.695 24 | 1 -1.0423 1 0 1 0 1 92256 2.676 25 | 0 0 1 0 1 0 1 44405 3.906 26 | 1 -0.88512 2 1 1 1 1 49610 1.181 27 | 1 -1.0114 2 0 1 0 1 52438 2.135 28 | 0 0 2 1 1 1 1 15022 2.767 29 | 1 -0.84544 2 1 1 1 1 51816 1.246 30 | 1 -0.70133 1 1 1 1 1 27004 1.096 31 | 1 -0.75965 1 1 1 1 1 104976 2.256 32 | 1 -0.88781 3 0 1 0 1 70892 3.252 33 | 1 -0.97978 3 0 1 0 1 140958 0.966 34 | 1 -0.81108 1 0 1 0 1 120786 2.000 35 | 0 0 0 0 1 0 1 23217 4.657 36 | 1 -0.80976 1 0 1 0 1 141732 0.976 37 | 0 0 1 0 1 1 1 15447 4.821 38 | 1 -0.94711 2 1 1 1 1 56760 2.091 39 | 1 -1.0769 2 0 1 0 1 163183 1.491 40 | 1 -0.96749 2 0 1 0 1 83054 0.826 41 | 1 -0.88768 2 1 1 0 1 83839 2.040 42 | 0 0 0 1 1 1 1 10008 0.514 43 | 1 -0.60817 1 1 1 1 1 76050 1.504 44 | 0 0 2 0 1 0 1 77745 1.624 45 | 1 -0.79739 2 1 1 1 1 70411 2.360 46 | 1 -1.0329 2 0 1 0 1 178143 1.399 47 | 1 -0.91477 1 0 1 0 1 77376 3.194 48 | 1 -0.78768 3 0 1 1 1 60060 1.126 49 | 1 -0.74761 1 1 1 1 1 40600 1.938 50 | 1 -0.60593 1 1 1 1 1 77520 2.153 51 | 1 -0.96142 1 0 1 1 1 20844 1.794 52 | 1 -1.0744 2 0 1 1 1 12078 2.800 53 | 1 -0.93405 2 0 1 0 1 134862 1.813 54 | 0 0 1 1 1 1 1 6962 2.017 55 | 1 -0.81636 2 1 1 1 1 94965 2.505 56 | 1 -0.89759 2 0 1 0 1 37278 2.885 57 | 1 -1.0435 1 0 1 1 1 37204 2.177 58 | 0 0 1 0 1 1 1 7548 2.940 59 | 1 -0.83319 1 1 1 1 1 56235 2.123 60 | 0 0 1 1 1 1 1 25938 1.515 61 | 0 0 1 1 1 1 1 7875 2.000 62 | 1 -0.98614 1 0 1 0 1 120780 2.033 63 | 1 -0.86831 3 0 1 0 1 126731 1.607 64 | 1 -0.96271 0 1 1 1 1 21500 1.379 65 | 1 -0.95246 0 1 1 1 0 12726 0.800 66 | 1 -0.75544 1 0 1 0 1 50566 2.962 67 | 0 0 2 1 1 1 1 16416 1.411 68 | 1 -0.77408 2 1 1 1 1 53457 1.791 69 | 1 -0.91203 3 0 1 0 1 59740 2.854 70 | 1 -0.4689 0 1 1 1 1 49686 1.503 71 | 1 -0.82993 1 0 1 0 1 94050 1.245 72 | 1 -0.84666 2 1 1 1 1 64256 0.980 73 | 1 -0.69771 2 1 1 1 0 34196 3.245 74 | 1 -0.96868 2 0 1 1 1 53200 1.476 75 | 1 -0.49624 1 1 1 1 1 72080 1.607 76 | 1 -0.99959 2 0 1 0 1 124832 0.883 77 | 0 0 1 1 1 1 1 45864 1.195 78 | 1 -0.82127 3 0 1 0 1 46170 2.545 79 | 1 -0.85788 2 0 1 1 1 61950 1.983 80 | 1 -0.60998 1 1 1 1 1 44200 1.106 81 | 1 -0.88093 2 0 1 0 1 127958 1.707 82 | 1 -0.98241 3 0 1 0 1 136136 1.028 83 | 1 -0.83278 1 0 1 0 1 133500 1.876 84 | 1 -0.92018 2 0 1 0 1 99591 1.398 85 | 0 0 1 0 1 0 1 152516 1.152 86 | 1 -0.81111 1 1 0 1 0 33142 1.559 87 | 1 -0.79387 1 0 1 1 1 34443 2.078 88 | 0 0 1 0 1 1 1 10290 2.116 89 | 0 0 1 0 1 1 1 23980 2.028 90 | 0 0 1 0 1 0 1 51792 2.135 91 | 1 -0.99525 1 0 1 1 1 115038 2.161 92 | 1 -0.96553 2 0 1 0 1 166500 1.503 93 | 0 0 2 0 1 0 1 32250 1.945 94 | 0 0 1 1 1 1 1 8664 1.507 95 | 0 0 1 0 1 0 1 65369 3.831 96 | 0 0 1 0 1 0 1 151302 1.357 97 | 0 0 1 1 1 1 1 10788 3.246 98 | 0 0 1 0 1 1 1 4386 3.879 99 | 1 -0.9297 3 0 1 0 1 35723 1.855 100 | 1 -0.93006 2 1 1 1 1 81940 1.413 101 | 1 -0.97773 3 0 1 0 1 51156 2.377 102 | 1 -0.87772 2 0 1 0 1 76405 0.878 103 | 1 -0.97412 3 0 1 0 1 103792 2.406 104 | 0 0 2 0 1 0 1 42971 4.604 105 | 1 -0.79753 2 1 1 1 1 86680 2.240 106 | 0 0 1 1 1 1 0 21980 0.891 107 | 1 -0.87438 2 0 1 0 1 62205 1.639 108 | 1 -0.81639 2 1 1 1 1 67925 1.558 109 | 0 0 1 0 1 0 1 72500 3.465 110 | 1 -0.80147 2 1 1 1 1 116312 1.895 111 | 0 0 2 0 1 1 1 32663 4.159 112 | 1 -0.93548 2 0 1 1 1 48576 1.571 113 | 1 -1.0688 2 0 1 1 1 95432 1.047 114 | 1 -0.92813 1 0 1 0 1 66893 2.947 115 | 1 -0.99685 1 0 1 0 1 120848 0.912 116 | 1 -0.74322 1 1 1 1 1 74108 2.037 117 | 1 -0.84451 2 0 1 1 1 69915 2.239 118 | 1 -1.0455 3 0 1 0 1 165000 1.517 119 | 1 -0.90755 1 1 1 1 1 53550 1.858 120 | 0 0 2 1 1 1 1 34362 1.810 121 | 0 0 2 0 1 0 1 172326 0.807 122 | 1 -1.0835 2 0 1 0 1 149296 1.650 123 | 0 0 0 1 1 1 0 58968 0.928 124 | 1 -1.0339 2 0 1 0 1 168000 0.837 125 | 0 0 2 1 1 1 1 7220 1.253 126 | 0 0 1 1 1 1 1 43806 1.980 127 | 1 -0.83221 2 1 1 1 1 112050 2.219 128 | 0 0 0 1 1 1 1 25551 1.092 129 | 1 -0.69348 2 1 1 1 1 18966 1.602 130 | 1 -0.86398 1 1 1 1 1 23940 1.512 131 | 0 0 3 0 1 1 1 12675 3.031 132 | 1 -0.96078 2 1 1 1 1 89102 1.003 133 | 1 -1.0491 1 0 1 0 1 169000 1.481 134 | 1 -0.92207 3 0 1 0 1 101559 1.200 135 | 1 -0.70829 1 1 1 1 1 20608 1.649 136 | 0 0 1 1 1 1 1 7905 1.095 137 | 1 -1.0995 1 0 1 1 1 8625 1.541 138 | 1 -1.1044 1 0 1 1 1 7049 2.538 139 | 0 0 2 1 1 1 1 4380 0.819 140 | 1 -0.86183 2 0 1 0 1 104647 2.035 141 | 1 -0.84865 2 0 1 0 1 91154 1.612 142 | 1 -1.0685 1 0 1 1 1 145000 1.727 143 | 1 -0.92574 2 0 1 1 1 53088 1.886 144 | 1 -0.81593 1 1 1 1 1 20700 1.570 145 | 0 0 1 0 1 1 1 20383 0.581 146 | 0 0 0 1 1 1 1 21222 1.238 147 | 0 0 2 0 1 1 1 49997 1.674 148 | 1 -1.0612 2 0 1 0 1 180306 1.311 149 | 0 0 1 1 1 1 0 3819 0.848 150 | 1 -1.0161 2 0 1 0 1 51474 2.715 151 | 1 -0.81018 2 1 1 1 1 34182 1.304 152 | 0 0 1 0 1 1 1 80275 2.821 153 | 0 0 0 1 1 1 1 15840 1.622 154 | 0 0 1 1 1 1 1 36894 1.810 155 | 1 -1.0028 2 0 1 0 1 142000 1.763 156 | 1 -0.95454 2 0 1 1 1 59444 2.516 157 | 1 -0.82481 1 1 1 1 1 44274 2.236 158 | 1 -0.73545 1 1 1 1 1 36273 3.189 159 | 1 -0.75319 2 0 1 0 1 153692 1.622 160 | 1 -0.92173 1 0 1 0 1 116584 2.098 161 | 0 0 0 1 1 1 0 11102 0.744 162 | 1 -0.7787 2 1 1 1 1 31800 1.416 163 | 1 -0.81832 1 1 1 1 1 11433 1.078 164 | 1 -0.75034 1 0 1 1 1 28449 2.407 165 | 1 -1.0365 2 0 1 0 1 30959 4.537 166 | 1 -0.84001 1 0 1 1 1 36828 2.407 167 | 0 0 2 0 1 1 1 27068 2.670 168 | 1 -0.98094 2 0 1 1 1 77520 1.193 169 | 0 0 1 1 1 1 0 32747 1.606 170 | 1 -0.72317 2 1 1 1 1 42935 1.792 171 | 1 -0.78863 1 1 1 1 1 23166 1.134 172 | 1 -0.92992 1 0 1 0 1 83990 1.633 173 | 1 -0.95224 2 0 1 1 1 148840 1.602 174 | 1 -1.1184 1 0 1 1 1 37248 2.283 175 | 1 -0.79514 2 0 1 1 1 69764 2.636 176 | 1 -0.83195 2 0 1 1 1 94354 1.549 177 | 1 -0.90708 2 1 1 1 1 154567 1.600 178 | 1 -0.75485 1 1 1 1 1 19418 1.098 179 | 0 0 1 1 1 1 0 36464 1.234 180 | 1 -0.88242 1 0 1 0 1 123000 2.037 181 | 1 -0.9915 3 0 1 0 1 77173 1.474 182 | 1 -0.99473 2 0 1 0 1 154577 0.708 183 | 1 -1.0611 2 0 1 1 1 39037 3.706 184 | 0 0 1 1 1 1 1 6643 0.800 185 | 0 0 2 0 1 1 1 78496 2.543 186 | 1 -1.0248 1 0 1 1 1 80352 3.075 187 | 1 -0.82922 1 1 1 1 1 18860 1.430 188 | 1 -1.0505 0 1 1 1 1 45276 1.179 189 | 1 -1.0719 1 0 1 1 1 54000 4.664 190 | 1 -0.97822 2 0 1 1 1 91800 2.212 191 | 1 -0.92819 2 0 1 1 1 43429 2.324 192 | 1 -0.90427 2 0 1 1 1 91264 2.705 193 | 1 -0.91275 2 0 1 1 1 72000 1.424 194 | 1 -1.0361 2 0 1 0 1 174096 1.414 195 | 0 0 2 0 1 1 1 70490 1.004 196 | 0 0 2 1 1 1 1 18318 1.102 197 | 0 0 1 0 1 0 1 145416 1.708 198 | 1 -0.72206 1 1 1 1 1 60997 1.867 199 | 0 0 1 0 1 1 1 48138 3.795 200 | 1 -0.9166 1 1 1 1 1 13375 1.170 201 | 1 -0.91312 1 0 1 0 1 173153 1.439 202 | 1 -0.86162 2 0 1 1 1 65527 2.538 203 | 1 -0.82392 2 0 1 1 1 64020 1.324 204 | 1 -0.91039 2 0 1 1 1 37760 1.478 205 | 1 -0.70015 1 1 1 1 1 60564 2.815 206 | 1 -0.86612 2 0 1 1 1 17936 1.291 207 | 0 0 1 1 1 1 0 5576 0.827 208 | -------------------------------------------------------------------------------- /detections/README.md: -------------------------------------------------------------------------------- 1 | ## detections 2 | -------------------------------------------------------------------------------- /results/README.md: -------------------------------------------------------------------------------- 1 | ## results 2 | 3 | ### Creat A Report 4 | 5 | 1) The tex file for a report will be created for you in results/detname/tex. 6 | 2) Automatically remove whitespace from the figures using 7 | * an Adobe Acrobat batch process or 8 | * the following script for `pdfcrop` from Ross Girshick: 9 | ``` 10 | #!/bin/sh 11 | find . -name "*.pdf" -print0 | xargs -P6 -0 -I file pdfcrop file file 12 | ``` 13 | 3) Use a latex compiler on [detectionAnalysisAutoReportTemplate.tex](detectionAnalysisAutoReportTemplate.tex) to make the pdf. 14 | -------------------------------------------------------------------------------- /results/detectionAnalysisAutoReportTemplate.tex: -------------------------------------------------------------------------------- 1 | \documentclass[10pt,twocolumn,letterpaper]{article} 2 | 3 | \usepackage{graphicx} 4 | 5 | \newcommand{\mb}[1]{\mathbf{#1}} 6 | \newcommand{\tb}[1]{\textbf{#1}} 7 | \newcommand{\mrm}[1]{\mathrm{#1}} 8 | \newcommand{\boldhead}[1]{\vspace{0.03in}\noindent\textbf{#1.}} 9 | 10 | \def\apn{AP$\mrm{_N}$ } 11 | \def\apnn{AP$\mrm{_N}$} 12 | \def\anp{AP$\mrm{_N}$ } 13 | 14 | \renewcommand{\baselinestretch}{0.99} 15 | 16 | \begin{document} 17 | 18 | \title{When Good Detectors Go Bad: A Study of Object Detection Error\\ 19 | Automatically Generated Detector Report} 20 | 21 | \maketitle 22 | % \thispagestyle{empty} 23 | 24 | \input{header.tex} 25 | 26 | \section{Overall Detector Characteristics} 27 | 28 | %\input{ap.tex} 29 | 30 | \begin{figure*}[h!tp] 31 | \vspace{-0.5in} 32 | \begin{center} 33 | \begin{tabular}{c c c c c} 34 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_aeroplane.pdf} & \includegraphics[width=0.15\textwidth]{../plots_fp_pie_bicycle.pdf} & 35 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_boat.pdf} & 36 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_bus.pdf} & 37 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_car.pdf} \\ 38 | \includegraphics[width=0.15\textwidth]{../plots_fp_aeroplane.pdf} & \includegraphics[width=0.15\textwidth]{../plots_fp_bicycle.pdf} & 39 | \includegraphics[width=0.15\textwidth]{../plots_fp_boat.pdf} & 40 | \includegraphics[width=0.15\textwidth]{../plots_fp_bus.pdf} & 41 | \includegraphics[width=0.15\textwidth]{../plots_fp_car.pdf} \\ 42 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_motorbike.pdf} & 43 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_train.pdf} & 44 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_bird.pdf} & 45 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_cat.pdf} & 46 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_cow.pdf} \\ 47 | \includegraphics[width=0.15\textwidth]{../plots_fp_motorbike.pdf} & 48 | \includegraphics[width=0.15\textwidth]{../plots_fp_train.pdf} & 49 | \includegraphics[width=0.15\textwidth]{../plots_fp_bird.pdf} & 50 | \includegraphics[width=0.15\textwidth]{../plots_fp_cat.pdf} & 51 | \includegraphics[width=0.15\textwidth]{../plots_fp_cow.pdf} \\ 52 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_dog.pdf} & 53 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_horse.pdf} & 54 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_sheep.pdf} & 55 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_bottle.pdf} & 56 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_chair.pdf} \\ 57 | \includegraphics[width=0.15\textwidth]{../plots_fp_dog.pdf} & 58 | \includegraphics[width=0.15\textwidth]{../plots_fp_horse.pdf} & 59 | \includegraphics[width=0.15\textwidth]{../plots_fp_sheep.pdf} & 60 | \includegraphics[width=0.15\textwidth]{../plots_fp_bottle.pdf} & 61 | \includegraphics[width=0.15\textwidth]{../plots_fp_chair.pdf} \\ 62 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_diningtable.pdf} & 63 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_pottedplant.pdf} & 64 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_sofa.pdf} & 65 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_tvmonitor.pdf} & 66 | \includegraphics[width=0.15\textwidth]{../plots_fp_pie_person.pdf} \\ 67 | \includegraphics[width=0.15\textwidth]{../plots_fp_diningtable.pdf} & 68 | \includegraphics[width=0.15\textwidth]{../plots_fp_pottedplant.pdf} & 69 | \includegraphics[width=0.15\textwidth]{../plots_fp_sofa.pdf} & 70 | \includegraphics[width=0.15\textwidth]{../plots_fp_tvmonitor.pdf} & 71 | \includegraphics[width=0.15\textwidth]{../plots_fp_person.pdf} \\ 72 | \hspace{-0.17in} 73 | \vspace{-0.3in} 74 | \end{tabular} 75 | \end{center} 76 | \caption{ 77 | \textbf{Analysis of Top-Ranked Detections.} Pie charts: fraction of top N detections (N=num of objs in category) that are correct (Cor), or false positives due to poor localization (Loc), confusion with similar objects (Sim), confusion with other VOC objects (Oth), or confusion with background or unlabeled objects (BG). Bar graphs: absolute AP improvement by removing all false positives of one type. `B': no confusion with background and non-similar objects. `L': first bar segment is improvement if duplicate or poor localizations are removed; second bar is improvement if localization errors are corrected so that the false positives become true positives. 78 | } 79 | \end{figure*} 80 | 81 | \begin{figure*} 82 | \begin{center} 83 | \includegraphics[width=0.5\textwidth]{../plots_impact_strong.pdf} \\ 84 | \end{center} 85 | \caption{ 86 | \textbf{Summary of Sensitivity and Impact of Object Characteristics: } We show the average (over categories) \apn performance of the highest performing and lowest performing subsets within each characteristic (occlusion, truncation, bounding box area, aspect ratio, viewpoint, part visibility). Overall \apn is indicated by the black dashed line. The difference between max and min indicates sensitivity; the difference between max and overall indicates the impact. 87 | } 88 | \end{figure*} 89 | 90 | \input{aeroplane.tex} 91 | \input{bicycle.tex} 92 | \input{boat.tex} 93 | \input{bus.tex} 94 | \input{car.tex} 95 | \input{motorbike.tex} 96 | \input{train.tex} 97 | \input{bird.tex} 98 | \input{cat.tex} 99 | \input{cow.tex} 100 | \input{dog.tex} 101 | \input{horse.tex} 102 | \input{sheep.tex} 103 | \input{bottle.tex} 104 | \input{chair.tex} 105 | \input{diningtable.tex} 106 | \input{pottedplant.tex} 107 | \input{sofa.tex} 108 | \input{tvmonitor.tex} 109 | \input{person.tex} 110 | % test 111 | %\section{Aeroplane} 112 | % 113 | %\begin{figure*}[thp] 114 | %\begin{center} 115 | %\begin{tabular}{c c c c c } 116 | %\includegraphics[width=0.2\textwidth]{../fp/aeroplane_fp_0001.pdf} & \hspace{-0.17in} 117 | %\includegraphics[width=0.2\textwidth]{../fp/aeroplane_fp_0002.pdf} & \hspace{-0.17in} 118 | %\includegraphics[width=0.2\textwidth]{../fp/aeroplane_fp_0003.pdf} & \hspace{-0.17in} 119 | %\includegraphics[width=0.2\textwidth]{../fp/aeroplane_fp_0004.pdf} & \hspace{-0.17in} 120 | %\includegraphics[width=0.2\textwidth]{../fp/aeroplane_fp_0005.pdf} \\ 121 | %\hspace{-0.17in} 122 | %\includegraphics[width=0.2\textwidth]{../fp/aeroplane_fp_0006.pdf} & \hspace{-0.17in} 123 | %\includegraphics[width=0.2\textwidth]{../fp/aeroplane_fp_0007.pdf} & \hspace{-0.17in} 124 | %\includegraphics[width=0.2\textwidth]{../fp/aeroplane_fp_0008.pdf} & \hspace{-0.17in} 125 | %\includegraphics[width=0.2\textwidth]{../fp/aeroplane_fp_0009.pdf} & \hspace{-0.17in} 126 | %\includegraphics[width=0.2\textwidth]{../fp/aeroplane_fp_0010.pdf} \\ 127 | %\end{tabular} 128 | %\end{center} 129 | %\caption{ 130 | %\vspace{-0.3in} 131 | %\textbf{Examples of top false positives} 132 | %} 133 | %\end{figure*} 134 | % 135 | % 136 | %\begin{figure*}[pht] 137 | %\begin{center} 138 | %\includegraphics[width=\textwidth]{../plots_aeroplane_ov50.pdf} \\ 139 | %\end{center} 140 | %\caption{ 141 | %\textbf{Per-Category Analysis of Characteristics: } \apn ('+') with standard error bars (red). Black dashed lines indicate overall AP$\mrm{_N}$. Key: {\em Occlusion}: N=none; L=low; M=medium; H=high. {\em Truncation}: N=not truncated; T=truncated. {\em Bounding Box Area}: XS=extra-small; S=small; M=medium; L=large; XL =extra-large. {\em Aspect Ratio}: XT=extra-tall/narrow; T=tall; M=medium; W=wide; XW =extra-wide. {\em Part Visibility / Viewpoint}: '1'=part/side is visible; '0'=part/side is not visible. 142 | %} 143 | %\end{figure*} 144 | % 145 | %\begin{figure*} 146 | %\begin{center} 147 | %\begin{tabular}{c c c c c} 148 | %\hspace{-0.17in} 149 | %\includegraphics[width=0.2\textwidth]{../tp/aeroplane_tp_0001.pdf} & \hspace{-0.17in} 150 | %\includegraphics[width=0.2\textwidth]{../tp/aeroplane_tp_0002.pdf} & \hspace{-0.17in} 151 | %\includegraphics[width=0.2\textwidth]{../tp/aeroplane_tp_0003.pdf} & \hspace{-0.17in} 152 | %\includegraphics[width=0.2\textwidth]{../tp/aeroplane_tp_0004.pdf} & \hspace{-0.17in} 153 | %\includegraphics[width=0.2\textwidth]{../tp/aeroplane_tp_0005.pdf} \\ 154 | %\hspace{-0.17in} 155 | %\includegraphics[width=0.2\textwidth]{../tp/aeroplane_tp_0006.pdf} & \hspace{-0.17in} 156 | %\includegraphics[width=0.2\textwidth]{../tp/aeroplane_tp_0007.pdf} & \hspace{-0.17in} 157 | %\includegraphics[width=0.2\textwidth]{../tp/aeroplane_tp_0008.pdf} & \hspace{-0.17in} 158 | %\includegraphics[width=0.2\textwidth]{../tp/aeroplane_tp_0009.pdf} & \hspace{-0.17in} 159 | %\includegraphics[width=0.2\textwidth]{../tp/aeroplane_tp_0010.pdf} \\ 160 | %\hspace{-0.17in} 161 | %\end{tabular} 162 | %\end{center} 163 | %\caption{ 164 | %\label{fig:tp_missing} 165 | %\textbf{Unexpectedly Difficult Detections: } The ground truth object is in red, with predicted confidence in upper-right corner in italics. The other box shows the highest scoring correct detection (green), if any, or highest scoring overlapping detection (blue dashed) with the detection confidence in the upper-left corner. 166 | %} 167 | %\end{figure*} 168 | 169 | 170 | 171 | 172 | \end{document} 173 | -------------------------------------------------------------------------------- /src/PASgetObjects.m: -------------------------------------------------------------------------------- 1 | function [ids, bbox, isdiff, istrunc, isocc, details, rnum, onum, classnum] = ... 2 | PASgetObjects(rec, objname, usediff) 3 | % [ids, bbox, isdiff, istrunc, isocc, details, rnum, objnum, classnum] = getObjectBBoxes(rec, objname, usediff) 4 | 5 | if ~exist('usediff', 'var') % whether to include difficult variables 6 | usediff = 1; 7 | end 8 | 9 | n = 0; 10 | 11 | maxdata = 100000; 12 | bbox = zeros(maxdata, 4); 13 | ids = cell(maxdata, 1); 14 | istrunc = false(maxdata, 1); 15 | isdiff = false(maxdata, 1); 16 | isocc = false(maxdata, 1); 17 | rnum = zeros(maxdata, 1); 18 | onum = zeros(maxdata, 1); 19 | classnum = zeros(maxdata, 1); 20 | details = cell(maxdata, 1); 21 | 22 | VOCinit; 23 | for k = 1:numel(rec) 24 | id = strtok(rec(k).filename, '.'); 25 | for k2 = 1:numel(rec(k).objects) 26 | if (isempty(objname) || strcmp(rec(k).objects(k2).class, objname)) && ... 27 | (usediff || ~rec(k).objects(k2).difficult) 28 | n = n+1; 29 | bbox(n, :) = rec(k).objects(k2).bbox; 30 | % extend box by 10% 31 | bbox(n, :) = round(bbox(n, :)); % + [-0.1*bw -0.1*bh 0.1*bw 0.1*bh]); 32 | ids{n} = id; 33 | istrunc(n) = logical(rec(k).objects(k2).truncated); 34 | isdiff(n) = logical(rec(k).objects(k2).difficult); 35 | isocc(n) = logical(rec(k).objects(k2).occluded); 36 | details{n} = rec(k).objects(k2).details; 37 | rnum(n) = k; 38 | onum(n) = k2; 39 | classnum(n) = find(strcmp(rec(k).objects(k2).class, VOCopts.classes)); 40 | end 41 | end 42 | end 43 | 44 | bbox = bbox(1:n, :); 45 | ids = ids(1:n); 46 | istrunc = istrunc(1:n); 47 | isdiff = isdiff(1:n); 48 | isocc = isocc(1:n); 49 | details = details(1:n); 50 | rnum = rnum(1:n); 51 | onum = onum(1:n); 52 | classnum = classnum(1:n); 53 | -------------------------------------------------------------------------------- /src/PASreadAllRecords.m: -------------------------------------------------------------------------------- 1 | function [rec, objcount] = PASreadAllRecords(recname, settype) 2 | 3 | VOCinit; 4 | 5 | if ~exist('settype', 'var') || isempty(settype) 6 | settype = 'main'; 7 | end 8 | 9 | if strcmp(settype, 'main') 10 | ids = textread(sprintf(VOCopts.imgsetpath, recname), '%s'); 11 | %fid = fopen(sprintf(VOCopts.imgsetpath,recname)); 12 | elseif strcmp(settype, 'seg') 13 | ids = textread(sprintf(VOCopts.seg.imgsetpath, recname), '%s'); 14 | %fid = fopen(sprintf(VOCopts.seg.imgsetpath,recname)); 15 | end 16 | % C=textscan(fid,'%s %d'); 17 | % ids = C{1}; 18 | % gt = C{2}; 19 | % fclose(fid); 20 | 21 | objcount = zeros(numel(ids), numel(VOCopts.classes), 'uint8'); 22 | for i=1:numel(ids) 23 | % read annotation 24 | rec(i) =PASreadrecord(sprintf(VOCopts.annopath,ids{i})); 25 | if i == 1 26 | rec(numel(ids)) = rec(i); 27 | end 28 | 29 | for k = 1:numel(rec(i).objects) 30 | c = strcmp(rec(i).objects(k).class, VOCopts.classes); 31 | objcount(i, c) = objcount(i, c) + 1; 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /src/VOCcode/PASemptyobject.m: -------------------------------------------------------------------------------- 1 | function object=PASemptyobject 2 | object.label=''; 3 | object.orglabel=''; 4 | object.bbox=[]; 5 | object.polygon=[]; 6 | object.mask=''; 7 | object.class=''; 8 | object.view=''; 9 | object.truncated=false; 10 | object.difficult=false; 11 | return -------------------------------------------------------------------------------- /src/VOCcode/PASemptyrecord.m: -------------------------------------------------------------------------------- 1 | function record=PASemptyrecord 2 | record.imgname=''; 3 | record.imgsize=[]; 4 | record.database=''; 5 | record.objects=PASemptyobject; 6 | return -------------------------------------------------------------------------------- /src/VOCcode/PASerrmsg.m: -------------------------------------------------------------------------------- 1 | function PASerrmsg(PASerr,SYSerr) 2 | fprintf('Pascal Error Message: %s\n',PASerr); 3 | fprintf('System Error Message: %s\n',SYSerr); 4 | k=input('Enter K for keyboard, any other key to continue or ^C to quit ...','s'); 5 | if (~isempty(k)), if (lower(k)=='k'), keyboard; end; end; 6 | fprintf('\n'); 7 | return -------------------------------------------------------------------------------- /src/VOCcode/PASreadrecord.m: -------------------------------------------------------------------------------- 1 | function rec = PASreadrecord(path) 2 | 3 | if length(path)<4 4 | error('unable to determine format: %s',path); 5 | end 6 | 7 | if strcmp(path(end-3:end),'.txt') 8 | rec=PASreadrectxt(path); 9 | else 10 | rec=VOCreadrecxml(path); 11 | end 12 | -------------------------------------------------------------------------------- /src/VOCcode/PASreadrectxt.m: -------------------------------------------------------------------------------- 1 | function record=PASreadrectxt(filename) 2 | [fd,syserrmsg]=fopen(filename,'rt'); 3 | if (fd==-1), 4 | PASmsg=sprintf('Could not open %s for reading',filename); 5 | PASerrmsg(PASmsg,syserrmsg); 6 | end; 7 | 8 | matchstrs=initstrings; 9 | record=PASemptyrecord; 10 | notEOF=1; 11 | while (notEOF), 12 | line=fgetl(fd); 13 | notEOF=ischar(line); 14 | if (notEOF), 15 | matchnum=match(line,matchstrs); 16 | switch matchnum, 17 | case 1, [imgname]=strread(line,matchstrs(matchnum).str); 18 | record.imgname=char(imgname); 19 | case 2, [x,y,c]=strread(line,matchstrs(matchnum).str); 20 | record.imgsize=[x y c]; 21 | case 3, [database]=strread(line,matchstrs(matchnum).str); 22 | record.database=char(database); 23 | case 4, [obj,lbl,xmin,ymin,xmax,ymax]=strread(line,matchstrs(matchnum).str); 24 | record.objects(obj).label=char(lbl); 25 | record.objects(obj).bbox=[min(xmin,xmax),min(ymin,ymax),max(xmin,xmax),max(ymin,ymax)]; 26 | case 5, tmp=findstr(line,' : '); 27 | [obj,lbl]=strread(line(1:tmp),matchstrs(matchnum).str); 28 | record.objects(obj).label=char(lbl); 29 | record.objects(obj).polygon=sscanf(line(tmp+3:end),'(%d, %d) ')'; 30 | case 6, [obj,lbl,mask]=strread(line,matchstrs(matchnum).str); 31 | record.objects(obj).label=char(lbl); 32 | record.objects(obj).mask=char(mask); 33 | case 7, [obj,lbl,orglbl]=strread(line,matchstrs(matchnum).str); 34 | lbl=char(lbl); 35 | record.objects(obj).label=lbl; 36 | record.objects(obj).orglabel=char(orglbl); 37 | if strcmp(lbl(max(end-8,1):end),'Difficult') 38 | record.objects(obj).difficult=true; 39 | lbl(end-8:end)=[]; 40 | else 41 | record.objects(obj).difficult=false; 42 | end 43 | if strcmp(lbl(max(end-4,1):end),'Trunc') 44 | record.objects(obj).truncated=true; 45 | lbl(end-4:end)=[]; 46 | else 47 | record.objects(obj).truncated=false; 48 | end 49 | t=find(lbl>='A'&lbl<='Z'); 50 | t=t(t>=4); 51 | if ~isempty(t) 52 | record.objects(obj).view=lbl(t(1):end); 53 | lbl(t(1):end)=[]; 54 | else 55 | record.objects(obj).view=''; 56 | end 57 | record.objects(obj).class=lbl(4:end); 58 | 59 | otherwise, %fprintf('Skipping: %s\n',line); 60 | end; 61 | end; 62 | end; 63 | fclose(fd); 64 | return 65 | 66 | function matchnum=match(line,matchstrs) 67 | for i=1:length(matchstrs), 68 | matched(i)=strncmp(line,matchstrs(i).str,matchstrs(i).matchlen); 69 | end; 70 | matchnum=find(matched); 71 | if isempty(matchnum), matchnum=0; end; 72 | if (length(matchnum)~=1), 73 | PASerrmsg('Multiple matches while parsing',''); 74 | end; 75 | return 76 | 77 | function s=initstrings 78 | s(1).matchlen=14; 79 | s(1).str='Image filename : %q'; 80 | 81 | s(2).matchlen=10; 82 | s(2).str='Image size (X x Y x C) : %d x %d x %d'; 83 | 84 | s(3).matchlen=8; 85 | s(3).str='Database : %q'; 86 | 87 | s(4).matchlen=8; 88 | s(4).str='Bounding box for object %d %q (Xmin, Ymin) - (Xmax, Ymax) : (%d, %d) - (%d, %d)'; 89 | 90 | s(5).matchlen=7; 91 | s(5).str='Polygon for object %d %q (X, Y)'; 92 | 93 | s(6).matchlen=5; 94 | s(6).str='Pixel mask for object %d %q : %q'; 95 | 96 | s(7).matchlen=8; 97 | s(7).str='Original label for object %d %q : %q'; 98 | 99 | return -------------------------------------------------------------------------------- /src/VOCcode/VOCevalcls.m: -------------------------------------------------------------------------------- 1 | function [rec,prec,ap] = VOCevalcls(VOCopts,id,cls,draw) 2 | 3 | % load test set 4 | [gtids,gt]=textread(sprintf(VOCopts.clsimgsetpath,cls,VOCopts.testset),'%s %d'); 5 | 6 | % load results 7 | [ids,confidence]=textread(sprintf(VOCopts.clsrespath,id,cls),'%s %f'); 8 | 9 | % map results to ground truth images 10 | out=ones(size(gt))*-inf; 11 | tic; 12 | for i=1:length(ids) 13 | % display progress 14 | if toc>1 15 | fprintf('%s: pr: %d/%d\n',cls,i,length(ids)); 16 | drawnow; 17 | tic; 18 | end 19 | 20 | % find ground truth image 21 | j=strmatch(ids{i},gtids,'exact'); 22 | if isempty(j) 23 | error('unrecognized image "%s"',ids{i}); 24 | elseif length(j)>1 25 | error('multiple image "%s"',ids{i}); 26 | else 27 | out(j)=confidence(i); 28 | end 29 | end 30 | 31 | % compute precision/recall 32 | 33 | [so,si]=sort(-out); 34 | tp=gt(si)>0; 35 | fp=gt(si)<0; 36 | 37 | fp=cumsum(fp); 38 | tp=cumsum(tp); 39 | rec=tp/sum(gt>0); 40 | prec=tp./(fp+tp); 41 | 42 | % compute average precision 43 | 44 | ap=0; 45 | for t=0:0.1:1 46 | p=max(prec(rec>=t)); 47 | if isempty(p) 48 | p=0; 49 | end 50 | ap=ap+p/11; 51 | end 52 | 53 | if draw 54 | % plot precision/recall 55 | plot(rec,prec,'-'); 56 | grid; 57 | xlabel 'recall' 58 | ylabel 'precision' 59 | title(sprintf('class: %s, subset: %s, AP = %.3f',cls,VOCopts.testset,ap)); 60 | end 61 | -------------------------------------------------------------------------------- /src/VOCcode/VOCevaldet.m: -------------------------------------------------------------------------------- 1 | function [rec,prec,ap] = VOCevaldet(VOCopts,id,cls,draw) 2 | 3 | % load test set 4 | 5 | cp=sprintf(VOCopts.annocachepath,VOCopts.testset); 6 | try 7 | load(cp,'gtids','recs'); 8 | catch 9 | [gtids,t]=textread(sprintf(VOCopts.imgsetpath,VOCopts.testset),'%s %d'); 10 | for i=1:length(gtids) 11 | % display progress 12 | if toc>1 13 | fprintf('%s: pr: load: %d/%d\n',cls,i,length(gtids)); 14 | drawnow; 15 | tic; 16 | end 17 | 18 | % read annotation 19 | recs(i)=PASreadrecord(sprintf(VOCopts.annopath,gtids{i})); 20 | end 21 | save(cp,'gtids','recs'); 22 | end 23 | 24 | % extract ground truth objects 25 | 26 | npos=0; 27 | gt(length(gtids))=struct('BB',[],'diff',[],'det',[]); 28 | for i=1:length(gtids) 29 | % extract objects of class 30 | clsinds=strmatch(cls,{recs(i).objects(:).class},'exact'); 31 | gt(i).BB=cat(1,recs(i).objects(clsinds).bbox)'; 32 | gt(i).diff=[recs(i).objects(clsinds).difficult]; 33 | gt(i).det=false(length(clsinds),1); 34 | npos=npos+sum(~gt(i).diff); 35 | end 36 | 37 | % load results 38 | [ids,confidence,b1,b2,b3,b4]=textread(sprintf(VOCopts.detrespath,id,cls),'%s %f %f %f %f %f'); 39 | BB=[b1 b2 b3 b4]'; 40 | 41 | % sort detections by decreasing confidence 42 | [sc,si]=sort(-confidence); 43 | ids=ids(si); 44 | BB=BB(:,si); 45 | 46 | % assign detections to ground truth objects 47 | nd=length(confidence); 48 | tp=zeros(nd,1); 49 | fp=zeros(nd,1); 50 | tic; 51 | for d=1:nd 52 | % display progress 53 | if toc>1 54 | fprintf('%s: pr: compute: %d/%d\n',cls,d,nd); 55 | drawnow; 56 | tic; 57 | end 58 | 59 | % find ground truth image 60 | i=strmatch(ids{d},gtids,'exact'); 61 | if isempty(i) 62 | error('unrecognized image "%s"',ids{d}); 63 | elseif length(i)>1 64 | error('multiple image "%s"',ids{d}); 65 | end 66 | 67 | % assign detection to ground truth object if any 68 | bb=BB(:,d); 69 | ovmax=-inf; 70 | for j=1:size(gt(i).BB,2) 71 | bbgt=gt(i).BB(:,j); 72 | bi=[max(bb(1),bbgt(1)) ; max(bb(2),bbgt(2)) ; min(bb(3),bbgt(3)) ; min(bb(4),bbgt(4))]; 73 | iw=bi(3)-bi(1)+1; 74 | ih=bi(4)-bi(2)+1; 75 | if iw>0 & ih>0 76 | % compute overlap as area of intersection / area of union 77 | ua=(bb(3)-bb(1)+1)*(bb(4)-bb(2)+1)+... 78 | (bbgt(3)-bbgt(1)+1)*(bbgt(4)-bbgt(2)+1)-... 79 | iw*ih; 80 | ov=iw*ih/ua; 81 | if ov>ovmax 82 | ovmax=ov; 83 | jmax=j; 84 | end 85 | end 86 | end 87 | % assign detection as true positive/don't care/false positive 88 | if ovmax>=VOCopts.minoverlap 89 | if ~gt(i).diff(jmax) 90 | if ~gt(i).det(jmax) 91 | tp(d)=1; % true positive 92 | gt(i).det(jmax)=true; 93 | else 94 | fp(d)=1; % false positive (multiple detection) 95 | end 96 | end 97 | else 98 | fp(d)=1; % false positive 99 | end 100 | end 101 | 102 | % compute precision/recall 103 | fp=cumsum(fp); 104 | tp=cumsum(tp); 105 | rec=tp/npos; 106 | prec=tp./(fp+tp); 107 | 108 | % compute average precision 109 | 110 | ap=0; 111 | for t=0:0.1:1 112 | p=max(prec(rec>=t)); 113 | if isempty(p) 114 | p=0; 115 | end 116 | ap=ap+p/11; 117 | end 118 | 119 | if draw 120 | % plot precision/recall 121 | plot(rec,prec,'-'); 122 | grid; 123 | xlabel 'recall' 124 | ylabel 'precision' 125 | title(sprintf('class: %s, subset: %s, AP = %.3f',cls,VOCopts.testset,ap)); 126 | end 127 | -------------------------------------------------------------------------------- /src/VOCcode/VOCevallayout.m: -------------------------------------------------------------------------------- 1 | function [rec,prec,ap] = VOCevallayout(VOCopts,id,draw) 2 | 3 | % load test set 4 | [imgids,objids]=textread(sprintf(VOCopts.layout.imgsetpath,VOCopts.testset),'%s %d'); 5 | 6 | % load ground truth objects 7 | n=0; 8 | tic; 9 | for i=1:length(imgids) 10 | % display progress 11 | if toc>1 12 | fprintf('layout pr: load %d/%d\n',i,length(imgids)); 13 | drawnow; 14 | tic; 15 | end 16 | 17 | % read annotation 18 | rec=PASreadrecord(sprintf(VOCopts.annopath,imgids{i})); 19 | 20 | % extract object 21 | n=n+1; 22 | gt(n)=rec.objects(objids(i)); 23 | end 24 | 25 | % load results 26 | 27 | fprintf('layout pr: loading results...\n'); 28 | xml=VOCreadxml(sprintf(VOCopts.layout.respath,id)); 29 | 30 | % test detections by decreasing confidence 31 | 32 | [t,si]=sort(-str2double({xml.results.layout.confidence})); 33 | nd=numel(si); 34 | 35 | det=false(n,1); 36 | tp=zeros(nd,1); 37 | fp=zeros(nd,1); 38 | 39 | for di=1:nd 40 | 41 | if di==6 42 | drawnow 43 | end 44 | 45 | % display progress 46 | if toc>1 47 | fprintf('layout pr: compute: %d/%d\n',di,nd); 48 | drawnow; 49 | tic; 50 | end 51 | 52 | % match result to ground truth object 53 | d=xml.results.layout(di); 54 | ii=strmatch(d.image,imgids,'exact'); 55 | oi=ii(objids(ii)==str2num(d.object)); 56 | 57 | if isempty(oi) 58 | warning('unrecognized layout: image %s, object %s',d.image,d.object); 59 | continue 60 | end 61 | 62 | % assign true/false positive 63 | 64 | if det(oi) 65 | fp(di)=1; % multiple detection 66 | else 67 | o=gt(oi); 68 | % num detected parts = num gt parts? 69 | if length(o.part)==length(d.part) 70 | op=zeros(size(o.part)); 71 | dp=zeros(size(d.part)); 72 | for k=1:VOCopts.nparts 73 | op(strmatch(VOCopts.parts{k},{o.part.class},'exact'))=k; 74 | dp(strmatch(VOCopts.parts{k},{d.part.class},'exact'))=k; 75 | end 76 | % bag of detected parts = bag of gt parts? 77 | if all(sort(op)==sort(dp)) 78 | % find possible matches (same type + overlap) 79 | M=zeros(length(op)); 80 | for k=1:length(dp) 81 | bb=str2double({d.part(k).bndbox.xmin d.part(k).bndbox.ymin ... 82 | d.part(k).bndbox.xmax d.part(k).bndbox.ymax}); 83 | for l=find(op==dp(k)) 84 | bbgt=o.part(l).bbox; 85 | bi=[max(bb(1),bbgt(1)) ; max(bb(2),bbgt(2)) ; min(bb(3),bbgt(3)) ; min(bb(4),bbgt(4))]; 86 | iw=bi(3)-bi(1)+1; 87 | ih=bi(4)-bi(2)+1; 88 | if iw>0 & ih>0 89 | % compute overlap as area of intersection / area of union 90 | ua=(bb(3)-bb(1)+1)*(bb(4)-bb(2)+1)+... 91 | (bbgt(3)-bbgt(1)+1)*(bbgt(4)-bbgt(2)+1)-... 92 | iw*ih; 93 | ov=iw*ih/ua; 94 | M(k,l)=ov>=VOCopts.minoverlap; 95 | end 96 | end 97 | end 98 | % valid assignments for all part types? 99 | tp(di)=1; 100 | for k=1:VOCopts.nparts 101 | v=(op==k); 102 | % each part matchable and sufficient matches? 103 | if ~(all(any(M(:,v)))&&sum(any(M(:,v),2))>=sum(v)) 104 | tp(di)=0; 105 | fp(di)=1; 106 | break 107 | end 108 | end 109 | else 110 | fp(di)=1; % wrong bag of parts 111 | end 112 | else 113 | fp(di)=1; % wrong number of parts 114 | end 115 | 116 | if tp(di) 117 | det(oi)=1; 118 | end 119 | end 120 | end 121 | 122 | % compute precision/recall 123 | 124 | fp=cumsum(fp); 125 | tp=cumsum(tp); 126 | v=tp+fp>0; 127 | rec=tp(v)/n; 128 | prec=tp(v)./(fp(v)+tp(v)); 129 | 130 | % compute average precision 131 | 132 | ap=0; 133 | for t=0:0.1:1 134 | p=max(prec(rec>=t)); 135 | if isempty(p) 136 | p=0; 137 | end 138 | ap=ap+p/11; 139 | end 140 | 141 | if draw 142 | % plot precision/recall 143 | plot(rec,prec,'-'); 144 | grid; 145 | xlabel 'recall' 146 | ylabel 'precision' 147 | title(sprintf('subset: %s, AP = %.3f',VOCopts.testset,ap)); 148 | end 149 | -------------------------------------------------------------------------------- /src/VOCcode/VOCevalseg.m: -------------------------------------------------------------------------------- 1 | %VOCEVALSEG Evaluates a set of segmentation results. 2 | % VOCEVALSEG(VOCopts,ID); prints out the per class and overall 3 | % segmentation accuracies. Accuracies are given using the intersection/union 4 | % metric: 5 | % true positives / (true positives + false positives + false negatives) 6 | % 7 | % [ACCURACIES,AVACC,CONF] = VOCEVALSEG(VOCopts,ID) returns the per class 8 | % percentage ACCURACIES, the average accuracy AVACC and the confusion 9 | % matrix CONF. 10 | % 11 | % [ACCURACIES,AVACC,CONF,RAWCOUNTS] = VOCEVALSEG(VOCopts,ID) also returns 12 | % the unnormalised confusion matrix, which contains raw pixel counts. 13 | function [accuracies,avacc,conf,rawcounts] = VOCevalseg(VOCopts,id) 14 | 15 | % image test set 16 | [gtids,t]=textread(sprintf(VOCopts.seg.imgsetpath,VOCopts.testset),'%s %d'); 17 | 18 | % number of labels = number of classes plus one for the background 19 | num = VOCopts.nclasses+1; 20 | confcounts = zeros(num); 21 | count=0; 22 | tic; 23 | for i=1:length(gtids) 24 | % display progress 25 | if toc>1 26 | fprintf('test confusion: %d/%d\n',i,length(gtids)); 27 | drawnow; 28 | tic; 29 | end 30 | 31 | imname = gtids{i}; 32 | 33 | % ground truth label file 34 | gtfile = sprintf(VOCopts.seg.clsimgpath,imname); 35 | [gtim,map] = imread(gtfile); 36 | gtim = double(gtim); 37 | 38 | % results file 39 | resfile = sprintf(VOCopts.seg.clsrespath,id,VOCopts.testset,imname); 40 | [resim,map] = imread(resfile); 41 | resim = double(resim); 42 | 43 | % Check validity of results image 44 | maxlabel = max(resim(:)); 45 | if (maxlabel>VOCopts.nclasses), 46 | error('Results image ''%s'' has out of range value %d (the value should be <= %d)',imname,maxlabel,VOCopts.nclasses); 47 | end 48 | 49 | szgtim = size(gtim); szresim = size(resim); 50 | if any(szgtim~=szresim) 51 | error('Results image ''%s'' is the wrong size, was %d x %d, should be %d x %d.',imname,szresim(1),szresim(2),szgtim(1),szgtim(2)); 52 | end 53 | 54 | %pixel locations to include in computation 55 | locs = gtim<255; 56 | 57 | % joint histogram 58 | sumim = 1+gtim+resim*num; 59 | hs = histc(sumim(locs),1:num*num); 60 | count = count + numel(find(locs)); 61 | confcounts(:) = confcounts(:) + hs(:); 62 | end 63 | 64 | % confusion matrix - first index is true label, second is inferred label 65 | %conf = zeros(num); 66 | conf = 100*confcounts./repmat(1E-20+sum(confcounts,2),[1 size(confcounts,2)]); 67 | rawcounts = confcounts; 68 | 69 | % Percentage correct labels measure is no longer being used. Uncomment if 70 | % you wish to see it anyway 71 | %overall_acc = 100*sum(diag(confcounts)) / sum(confcounts(:)); 72 | %fprintf('Percentage of pixels correctly labelled overall: %6.3f%%\n',overall_acc); 73 | 74 | accuracies = zeros(VOCopts.nclasses,1); 75 | fprintf('Accuracy for each class (intersection/union measure)\n'); 76 | for j=1:num 77 | 78 | gtj=sum(confcounts(j,:)); 79 | resj=sum(confcounts(:,j)); 80 | gtjresj=confcounts(j,j); 81 | % The accuracy is: true positive / (true positive + false positive + false negative) 82 | % which is equivalent to the following percentage: 83 | accuracies(j)=100*gtjresj/(gtj+resj-gtjresj); 84 | 85 | clname = 'background'; 86 | if (j>1), clname = VOCopts.classes{j-1};end; 87 | fprintf(' %14s: %6.3f%%\n',clname,accuracies(j)); 88 | end 89 | accuracies = accuracies(1:end); 90 | avacc = mean(accuracies); 91 | fprintf('-------------------------\n'); 92 | fprintf('Average accuracy: %6.3f%%\n',avacc); 93 | -------------------------------------------------------------------------------- /src/VOCcode/VOCinit.m: -------------------------------------------------------------------------------- 1 | clear VOCopts 2 | 3 | % use VOC2007 or VOC2008 data 4 | 5 | VOC2007=true; % set true to use VOC2007 data (should be used only for test) 6 | 7 | % dataset 8 | 9 | if VOC2007 10 | VOCopts.dataset='VOC2007'; 11 | else 12 | VOCopts.dataset='VOC2008'; 13 | end 14 | 15 | % get devkit directory with forward slashes 16 | devkitroot = '/home/dhoiem/data/pascal07/VOCdevkit'; 17 | %strrep(fileparts(fileparts(mfilename('fullpath'))),'\','/') 18 | 19 | % change this path to point to your copy of the PASCAL VOC data 20 | VOCopts.datadir=[devkitroot '/']; 21 | 22 | % change this path to a writable directory for your results 23 | VOCopts.resdir=[devkitroot '/results/' VOCopts.dataset '/']; 24 | 25 | % change this path to a writable local directory for the example code 26 | VOCopts.localdir=[devkitroot '/local/' VOCopts.dataset '/']; 27 | 28 | % initialize the training set 29 | 30 | VOCopts.trainset='train'; % use train for development 31 | % VOCopts.trainset='trainval'; % use train+val for final challenge 32 | 33 | % initialize the test set 34 | 35 | VOCopts.testset='test'; % use validation data for development test set 36 | % VOCopts.testset='test'; % use test set for final challenge 37 | 38 | % initialize main challenge paths 39 | 40 | VOCopts.annopath=[VOCopts.datadir VOCopts.dataset '/Annotations/%s.xml']; 41 | VOCopts.imgpath=[VOCopts.datadir VOCopts.dataset '/JPEGImages/%s.jpg']; 42 | VOCopts.imgsetpath=[VOCopts.datadir VOCopts.dataset '/ImageSets/Main/%s.txt']; 43 | VOCopts.clsimgsetpath=[VOCopts.datadir VOCopts.dataset '/ImageSets/Main/%s_%s.txt']; 44 | VOCopts.clsrespath=[VOCopts.resdir 'Main/%s_cls_' VOCopts.testset '_%s.txt']; 45 | VOCopts.detrespath=[VOCopts.resdir 'Main/%s_det_' VOCopts.testset '_%s.txt']; 46 | 47 | % initialize segmentation task paths 48 | 49 | VOCopts.seg.clsimgpath=[VOCopts.datadir VOCopts.dataset '/SegmentationClass/%s.png']; 50 | VOCopts.seg.instimgpath=[VOCopts.datadir VOCopts.dataset '/SegmentationObject/%s.png']; 51 | 52 | VOCopts.seg.imgsetpath=[VOCopts.datadir VOCopts.dataset '/ImageSets/Segmentation/%s.txt']; 53 | 54 | VOCopts.seg.clsresdir=[VOCopts.resdir 'Segmentation/%s_%s_cls']; 55 | VOCopts.seg.instresdir=[VOCopts.resdir 'Segmentation/%s_%s_inst']; 56 | VOCopts.seg.clsrespath=[VOCopts.seg.clsresdir '/%s.png']; 57 | VOCopts.seg.instrespath=[VOCopts.seg.instresdir '/%s.png']; 58 | 59 | % initialize layout task paths 60 | 61 | VOCopts.layout.imgsetpath=[VOCopts.datadir VOCopts.dataset '/ImageSets/Layout/%s.txt']; 62 | VOCopts.layout.respath=[VOCopts.resdir 'Layout/%s_layout_' VOCopts.testset '.xml']; 63 | 64 | % initialize the VOC challenge options 65 | 66 | % VOC2008 classes 67 | 68 | VOCopts.classes={... 69 | 'aeroplane' 70 | 'bicycle' 71 | 'bird' 72 | 'boat' 73 | 'bottle' 74 | 'bus' 75 | 'car' 76 | 'cat' 77 | 'chair' 78 | 'cow' 79 | 'diningtable' 80 | 'dog' 81 | 'horse' 82 | 'motorbike' 83 | 'person' 84 | 'pottedplant' 85 | 'sheep' 86 | 'sofa' 87 | 'train' 88 | 'tvmonitor'}; 89 | 90 | VOCopts.nclasses=length(VOCopts.classes); 91 | 92 | VOCopts.poses={... 93 | 'Unspecified' 94 | 'SideFaceLeft' 95 | 'SideFaceRight' 96 | 'Frontal' 97 | 'Rear'}; 98 | 99 | VOCopts.nposes=length(VOCopts.poses); 100 | 101 | VOCopts.parts={... 102 | 'head' 103 | 'hand' 104 | 'foot'}; 105 | 106 | VOCopts.maxparts=[1 2 2]; % max of each of above parts 107 | 108 | VOCopts.nparts=length(VOCopts.parts); 109 | 110 | VOCopts.minoverlap=0.5; 111 | 112 | % annotation cache for evaluation 113 | 114 | VOCopts.annocachepath=[VOCopts.localdir '%s_anno.mat']; 115 | 116 | % options for example implementations 117 | 118 | VOCopts.exfdpath=[VOCopts.localdir '%s_fd.mat']; 119 | -------------------------------------------------------------------------------- /src/VOCcode/VOClabelcolormap.m: -------------------------------------------------------------------------------- 1 | % VOCLABELCOLORMAP Creates a label color map such that adjacent indices have different 2 | % colors. Useful for reading and writing index images which contain large indices, 3 | % by encoding them as RGB images. 4 | % 5 | % CMAP = VOCLABELCOLORMAP(N) creates a label color map with N entries. 6 | function cmap = labelcolormap(N) 7 | 8 | if nargin==0 9 | N=256 10 | end 11 | cmap = zeros(N,3); 12 | for i=1:N 13 | id = i-1; r=0;g=0;b=0; 14 | for j=0:7 15 | r = bitor(r, bitshift(bitget(id,1),7 - j)); 16 | g = bitor(g, bitshift(bitget(id,2),7 - j)); 17 | b = bitor(b, bitshift(bitget(id,3),7 - j)); 18 | id = bitshift(id,-3); 19 | end 20 | cmap(i,1)=r; cmap(i,2)=g; cmap(i,3)=b; 21 | end 22 | cmap = cmap / 255; 23 | -------------------------------------------------------------------------------- /src/VOCcode/VOCreadrecxml.m: -------------------------------------------------------------------------------- 1 | function rec = VOCreadrecxml(path) 2 | 3 | x=VOCreadxml(path); 4 | x=x.annotation; 5 | 6 | rec=rmfield(x,'object'); 7 | 8 | rec.size.width=str2double(rec.size.width); 9 | rec.size.height=str2double(rec.size.height); 10 | rec.size.depth=str2double(rec.size.depth); 11 | 12 | rec.segmented=strcmp(rec.segmented,'1'); 13 | 14 | rec.imgname=[x.folder '/JPEGImages/' x.filename]; 15 | rec.imgsize=str2double({x.size.width x.size.height x.size.depth}); 16 | rec.database=rec.source.database; 17 | 18 | for i=1:length(x.object) 19 | rec.objects(i)=xmlobjtopas(x.object(i)); 20 | end 21 | 22 | function p = xmlobjtopas(o) 23 | 24 | p.class=o.name; 25 | 26 | if isfield(o,'pose') 27 | if strcmp(o.pose,'Unspecified') 28 | p.view=''; 29 | else 30 | p.view=o.pose; 31 | end 32 | else 33 | p.view=''; 34 | end 35 | 36 | if isfield(o,'truncated') 37 | p.truncated=strcmp(o.truncated,'1'); 38 | else 39 | p.truncated=false; 40 | end 41 | 42 | if isfield(o,'occluded') 43 | p.occluded=strcmp(o.occluded,'1'); 44 | else 45 | p.occluded=false; 46 | end 47 | 48 | if isfield(o,'difficult') 49 | p.difficult=strcmp(o.difficult,'1'); 50 | else 51 | p.difficult=false; 52 | end 53 | 54 | p.label=['PAS' p.class p.view]; 55 | if p.truncated 56 | p.label=[p.label 'Trunc']; 57 | end 58 | if p.occluded 59 | p.label=[p.label 'Occ']; 60 | end 61 | if p.difficult 62 | p.label=[p.label 'Diff']; 63 | end 64 | 65 | p.orglabel=p.label; 66 | 67 | p.bbox=str2double({o.bndbox.xmin o.bndbox.ymin o.bndbox.xmax o.bndbox.ymax}); 68 | 69 | p.bndbox.xmin=str2double(o.bndbox.xmin); 70 | p.bndbox.ymin=str2double(o.bndbox.ymin); 71 | p.bndbox.xmax=str2double(o.bndbox.xmax); 72 | p.bndbox.ymax=str2double(o.bndbox.ymax); 73 | 74 | if isfield(o,'polygon') 75 | warning('polygon unimplemented'); 76 | p.polygon=[]; 77 | else 78 | p.polygon=[]; 79 | end 80 | 81 | if isfield(o,'mask') 82 | warning('mask unimplemented'); 83 | p.mask=[]; 84 | else 85 | p.mask=[]; 86 | end 87 | 88 | if isfield(o,'part')&&~isempty(o.part) 89 | p.hasparts=true; 90 | for i=1:length(o.part) 91 | p.part(i)=xmlobjtopas(o.part(i)); 92 | end 93 | else 94 | p.hasparts=false; 95 | p.part=[]; 96 | end 97 | -------------------------------------------------------------------------------- /src/VOCcode/VOCreadxml.m: -------------------------------------------------------------------------------- 1 | function rec = VOCreadxml(path) 2 | 3 | if length(path)>5&&strcmp(path(1:5),'http:') 4 | xml=urlread(path)'; 5 | else 6 | f=fopen(path,'r'); 7 | xml=fread(f,'*char')'; 8 | fclose(f); 9 | end 10 | rec=VOCxml2struct(xml); 11 | -------------------------------------------------------------------------------- /src/VOCcode/VOCwritexml.m: -------------------------------------------------------------------------------- 1 | function VOCwritexml(rec, path) 2 | 3 | fid=fopen(path,'w'); 4 | writexml(fid,rec,0); 5 | fclose(fid); 6 | 7 | function xml = writexml(fid,rec,depth) 8 | 9 | fn=fieldnames(rec); 10 | for i=1:length(fn) 11 | f=rec.(fn{i}); 12 | if ~isempty(f) 13 | if isstruct(f) 14 | for j=1:length(f) 15 | fprintf(fid,'%s',repmat(char(9),1,depth)); 16 | fprintf(fid,'<%s>\n',fn{i}); 17 | writexml(fid,rec.(fn{i})(j),depth+1); 18 | fprintf(fid,'%s',repmat(char(9),1,depth)); 19 | fprintf(fid,'\n',fn{i}); 20 | end 21 | else 22 | if ~iscell(f) 23 | f={f}; 24 | end 25 | for j=1:length(f) 26 | fprintf(fid,'%s',repmat(char(9),1,depth)); 27 | fprintf(fid,'<%s>',fn{i}); 28 | if ischar(f{j}) 29 | fprintf(fid,'%s',f{j}); 30 | elseif isnumeric(f{j})&&numel(f{j})==1 31 | fprintf(fid,'%s',num2str(f{j})); 32 | else 33 | error('unsupported type'); 34 | end 35 | fprintf(fid,'\n',fn{i}); 36 | end 37 | end 38 | end 39 | end 40 | 41 | -------------------------------------------------------------------------------- /src/VOCcode/VOCxml2struct.m: -------------------------------------------------------------------------------- 1 | function res = VOCxml2struct(xml) 2 | 3 | xml(xml==9|xml==10|xml==13)=[]; 4 | 5 | [res,xml]=parse(xml,1,[]); 6 | 7 | function [res,ind]=parse(xml,ind,parent) 8 | 9 | res=[]; 10 | if ~isempty(parent)&&xml(ind)~='<' 11 | i=findchar(xml,ind,'<'); 12 | res=trim(xml(ind:i-1)); 13 | ind=i; 14 | [tag,ind]=gettag(xml,i); 15 | if ~strcmp(tag,['/' parent]) 16 | error('<%s> closed with <%s>',parent,tag); 17 | end 18 | else 19 | while ind<=length(xml) 20 | [tag,ind]=gettag(xml,ind); 21 | if strcmp(tag,['/' parent]) 22 | return 23 | else 24 | [sub,ind]=parse(xml,ind,tag); 25 | if isstruct(sub) 26 | if isfield(res,tag) 27 | n=length(res.(tag)); 28 | fn=fieldnames(sub); 29 | for f=1:length(fn) 30 | res.(tag)(n+1).(fn{f})=sub.(fn{f}); 31 | end 32 | else 33 | res.(tag)=sub; 34 | end 35 | else 36 | if isfield(res,tag) 37 | if ~iscell(res.(tag)) 38 | res.(tag)={res.(tag)}; 39 | end 40 | res.(tag){end+1}=sub; 41 | else 42 | res.(tag)=sub; 43 | end 44 | end 45 | end 46 | end 47 | end 48 | 49 | function i = findchar(str,ind,chr) 50 | 51 | i=[]; 52 | while ind<=length(str) 53 | if str(ind)==chr 54 | i=ind; 55 | break 56 | else 57 | ind=ind+1; 58 | end 59 | end 60 | 61 | function [tag,ind]=gettag(xml,ind) 62 | 63 | if ind>length(xml) 64 | tag=[]; 65 | elseif xml(ind)=='<' 66 | i=findchar(xml,ind,'>'); 67 | if isempty(i) 68 | error('incomplete tag'); 69 | end 70 | tag=xml(ind+1:i-1); 71 | ind=i+1; 72 | else 73 | error('expected tag'); 74 | end 75 | 76 | function s = trim(s) 77 | 78 | for i=1:numel(s) 79 | if ~isspace(s(i)) 80 | s=s(i:end); 81 | break 82 | end 83 | end 84 | for i=numel(s):-1:1 85 | if ~isspace(s(i)) 86 | s=s(1:i); 87 | break 88 | end 89 | end 90 | 91 | -------------------------------------------------------------------------------- /src/analyzeFalsePositives.m: -------------------------------------------------------------------------------- 1 | function result = analyzeFalsePositives(dataset, dataset_params, ann, objind, similar_ind, det, normalizedCount) 2 | % result = analyzeFalsePositives(dataset, dataset_params, ann, objind, similar_ind, det, normalizedCount) 3 | 4 | switch lower(dataset) 5 | case {'voc', 'voc_compatible'} 6 | 7 | result = analyzeFalsePositives_VOC(dataset, dataset_params, ann, objind, similar_ind, det, normalizedCount); 8 | 9 | otherwise 10 | error('dataset %s is unknown\n', dataset); 11 | end 12 | 13 | function result = analyzeFalsePositives_VOC(dataset, dataset_params, ann, objind, similar_ind, det, normalizedCount) 14 | 15 | [sv, si] = sort(det.conf, 'descend'); 16 | det.bbox = det.bbox(si, :); 17 | det.conf = det.conf(si); 18 | det.rnum = det.rnum(si); 19 | 20 | objname = dataset_params.objnames_all{objind}; 21 | 22 | % Regular 23 | [det, gt] = matchDetectionsWithGroundTruth(dataset, dataset_params, objname, ann, det, 'strong'); 24 | npos = sum(~[gt.isdiff]); 25 | result.all = averagePrecisionNormalized(det.conf, det.label, npos, normalizedCount); 26 | result.iscorrect = (det.label>=0); 27 | 28 | % Ignore localization error: remove detections that are duplicates or have 29 | % poor localization 30 | det2 = matchDetectionsWithGroundTruth(dataset, dataset_params, objname, ann, det, 'weak'); 31 | result.isloc = (det.label==-1) & (det2.label>=0); 32 | 33 | % Code below sets confidence of localization errors to -Inf 34 | conf = det.conf; 35 | conf(result.isloc) = -Inf; 36 | result.ignoreloc = averagePrecisionNormalized(conf, det.label, npos, normalizedCount); 37 | 38 | % Code below reassigns poor localizations to correct detections 39 | det2.conf(det2.isduplicate) = -Inf; 40 | result.fixloc = averagePrecisionNormalized(det2.conf, det2.label, npos, normalizedCount); 41 | 42 | conf = det.conf; 43 | conf(~result.isloc & (det.label==-1)) = -Inf; 44 | result.onlyloc = averagePrecisionNormalized(conf, det.label, npos, normalizedCount); 45 | 46 | % Ignore similar objects 47 | confuse_sim = false(det.N, 1); 48 | if ~isempty(similar_ind) 49 | for o2 = 1:numel(similar_ind) 50 | sim_name = dataset_params.objnames_all{similar_ind(o2)}; 51 | det2_s(o2) = matchDetectionsWithGroundTruth(dataset, dataset_params, ... 52 | sim_name, ann, det, 'weak'); 53 | end 54 | conf = det.conf; 55 | confuse_sim = (any(cat(2, det2_s.label)>=0, 2)) & (det.label==-1) & (~result.isloc); 56 | conf(confuse_sim) = -Inf; 57 | result.ignoresimilar = averagePrecisionNormalized(conf, det.label, npos, normalizedCount); 58 | conf = det.conf; 59 | conf(~confuse_sim & (det.label==-1)) = -Inf; 60 | result.onlysimilar = averagePrecisionNormalized(conf, det.label, npos, normalizedCount); 61 | end 62 | result.issim = confuse_sim; 63 | 64 | % Ignore background detections (all other false positives) 65 | bg_error = (~result.isloc) & (det.label==-1) & (~result.issim); 66 | result.isbg = bg_error; 67 | conf = det.conf; 68 | conf(bg_error) = -Inf; 69 | result.ignorebg = averagePrecisionNormalized(conf, det.label, npos, normalizedCount); 70 | conf = det.conf; 71 | conf(~bg_error & (det.label==-1)) = -Inf; 72 | result.onlybg = averagePrecisionNormalized(conf, det.label, npos, normalizedCount); 73 | 74 | % Record false positives with other (non-similar) objects 75 | isother = zeros(size(result.isbg)); 76 | for k = setdiff(1:numel(dataset_params.objnames_all), [similar_ind ; objind]) 77 | other_name = dataset_params.objnames_all{k}; 78 | detk = matchDetectionsWithGroundTruth(dataset, dataset_params, other_name, ann, det, 'weak'); 79 | isother = isother | (~result.iscorrect & ~result.issim & ~result.isloc & detk.label>=0); 80 | end 81 | result.isother = isother; 82 | result.isbg_notobj = result.isbg & ~result.isother; 83 | 84 | % Ignore localization error and similar objects 85 | conf = det2.conf; 86 | conf(confuse_sim) = -Inf; 87 | result.ignorelocsim = averagePrecisionNormalized(conf, det2.label, npos, normalizedCount); 88 | 89 | % Get counts of types of false positives for topN detections 90 | nclasses = numel(dataset_params.objnames_all); 91 | topN = [-100 sum(~[gt.isdiff])]; % topN: -X means top X false positives; +X means top X of all detections 92 | result.confuse_count.object = zeros(nclasses, numel(topN)); 93 | result.confuse_count.correct = zeros(1, numel(topN)); 94 | result.confuse_count.loc = zeros(1, numel(topN)); 95 | result.confuse_count.bg = zeros(1, numel(topN)); 96 | for n = 1:numel(topN) 97 | if topN(n)<0 98 | topN(n) = find(cumsum(det.label==-1)==-topN(n), 1, 'first'); 99 | end 100 | detn.bbox = det.bbox(1:topN(n), :); 101 | detn.conf = det.conf(1:topN(n)); 102 | detn.rnum = det.rnum(1:topN(n)); 103 | det2 = matchDetectionsWithGroundTruth(dataset, dataset_params, objname, ann, detn, 'strong'); 104 | iscorrect = det2.label>=0; 105 | det2 = matchDetectionsWithGroundTruth(dataset, dataset_params, objname, ann, detn, 'weak'); 106 | isloc = (det2.label>=0) & ~iscorrect; 107 | isobj = false(topN(n), nclasses); 108 | objov = zeros(topN(n), nclasses); 109 | for k = setdiff(1:nclasses, objind) 110 | name = dataset_params.objnames_all{k}; 111 | det2 = matchDetectionsWithGroundTruth(dataset, dataset_params, name, ann, detn, 'weak'); 112 | isobj(:, k) = (det2.label>=0) & ~isloc & ~iscorrect; 113 | objov(isobj(:, k), k) = det2.ov(isobj(:, k)); 114 | end 115 | [mv, mi] = max(objov, [], 2); 116 | mi(mv==0) = 0; 117 | isobj = false(topN(n), 1); 118 | isobj(mi>0) = true; 119 | isbg = ~iscorrect & ~isloc & ~isobj; 120 | for k = setdiff(1:nclasses, objind) 121 | result.confuse_count.object(k, n) = sum(mi==k); 122 | end 123 | result.confuse_count.total(n) = topN(n); 124 | result.confuse_count.correct(n) = sum(iscorrect); 125 | result.confuse_count.loc(n) = sum(isloc); 126 | result.confuse_count.bg(n) = sum(isbg); 127 | result.confuse_count.similarobj(n) = sum(result.confuse_count.object(similar_ind, n)); 128 | result.confuse_count.otherobj(n) = topN(n)-sum(iscorrect)-sum(isloc)-sum(isbg)-result.confuse_count.similarobj(n); 129 | end 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /src/analyzeSensitivity.m: -------------------------------------------------------------------------------- 1 | function [res1, res2, base, attnames] = analyzeSensitivity(result, rec) 2 | % Computes the residual in predicting object confidence 3 | % (precision) given each set of 0, 1, or 2 attributes 4 | 5 | attnames = {'area', 'aspect', 'occ_level', 'truncated'}; 6 | for o = 1:numel(result) 7 | 8 | gt = result(o).gt; 9 | pn = gt.pn; % object confidence (normalized precision) 10 | 11 | keep = true(gt.N, 1); 12 | for k = 1:gt.N 13 | if rec(gt.rnum(k)).objects(gt.onum(k)).difficult 14 | keep(k) = false; 15 | continue; 16 | end; 17 | end 18 | 19 | att = zeros(gt.N, numel(attnames)); 20 | att_max = zeros(1, numel(attnames)); 21 | for f = 1:numel(attnames) 22 | if ~isstruct(gt.(attnames{f})) 23 | att_max(f) = max(gt.(attnames{f})); 24 | att(:, f) = gt.(attnames{f})(:); 25 | end 26 | % below: not clear how to deal with attributes that are binary vectors 27 | % else 28 | % attnames2 = fieldnames(gt.(attnames{f})); 29 | % na = 1; 30 | % for k = 1:numel(attnames2) 31 | % na = na*max(gt.(attnames{f}).(attnames2{k})).^na; 32 | % att(:, f) = att(:, f) + (k-1) 33 | % binatt(k) = repmat(gt.(fnames{f}).(fnames2{k})(:), [1 na])==repmat(1:na, [gt.N 1]); 34 | % att(:, end+(1:na)) = repmat(gt.(fnames{f}).(fnames2{k})(:), [1 na])==repmat(1:na, [gt.N 1]); 35 | % end 36 | % end 37 | end 38 | 39 | [res1{o}, res2{o}, base{o}] = getAttributeResiduals(att(keep, :), pn(keep)); 40 | 41 | end 42 | 43 | 44 | function [res1, res2, base] = getAttributeResiduals(att, pn) 45 | 46 | N = numel(pn); 47 | default = mean(pn); 48 | 49 | % residual without attributes 50 | base = sqrt(sum(getResidual(pn, default))/N); 51 | 52 | % residual for each attribute by itself 53 | res1 = zeros(N, size(att, 2)); 54 | for a = 1:size(att, 2); 55 | vals = unique(att(:, a)); 56 | for v = 1:numel(vals) 57 | ind = att(:, a)==vals(v); 58 | res1(ind, a) = getResidual(pn(ind), default); 59 | end 60 | end 61 | res1 = sqrt(sum(res1)/N); 62 | 63 | % residual for pairs of attributes 64 | res2 = zeros(N, size(att, 2), size(att, 2)); 65 | for a1 = 1:size(att, 2) 66 | vals1 = unique(att(:, a1)); 67 | for a2 = 1:size(att, 2) 68 | vals2 = unique(att(:, a2)); 69 | for v1 = 1:numel(vals1) 70 | for v2 = 1:numel(vals2) 71 | ind = (att(:, a1)==vals1(v1)) & (att(:, a2)==vals2(v2)); 72 | if any(ind) 73 | res2(ind, a1, a2) = getResidual(pn(ind), default); 74 | end 75 | end 76 | end 77 | end 78 | end 79 | res2 = sqrt(sum(res2, 1)/N); 80 | res2 = squeeze(res2); 81 | 82 | function res = getResidual(pn, default) 83 | N = numel(pn); 84 | if N == 1 85 | res = (default-pn).^2; 86 | return; 87 | end 88 | 89 | sum_pn = sum(pn); 90 | 91 | res = zeros(size(pn)); 92 | for k =1:numel(pn) 93 | res(k) = (pn(k) - (sum_pn-pn(k))/(N-1)).^2; 94 | end -------------------------------------------------------------------------------- /src/analyzeTrueDetections.m: -------------------------------------------------------------------------------- 1 | function result = analyzeTrueDetections(dataset, dataset_params, objname, det, ann, normalizedCount, localization) 2 | % result = analyzeTrueDetections(dataset, dataset_params, objname, det, ann, normalizedCount, localization) 3 | % 4 | % Analyzes the performance for various subsets of the objects 5 | % 6 | % Input: 7 | % dataset: name of the dataset (e.g., VOC) 8 | % dataset_params: parameters of the dataset 9 | % objname: name of the object class 10 | % det.(bbox, conf, rnum): object detection results 11 | % ann: dataset annotations 12 | % normalizeCount: the pseudo-number of objects for normalized precision 13 | % localization: 'weak' or 'strong' to specify localization criteria 14 | % 15 | % Output: 16 | % result: set of precision-recall statistics 17 | 18 | 19 | switch lower(dataset) 20 | case {'voc', 'voc_compatible'} 21 | 22 | result = analyzeTrueDetections_VOC(dataset, dataset_params, objname, ann, det, normalizedCount, localization); 23 | 24 | otherwise 25 | error('dataset %s is unknown\n', dataset); 26 | end 27 | 28 | result.name = objname; 29 | 30 | 31 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 32 | function result = analyzeTrueDetections_VOC(dataset, dataset_params, objname, ann, det, normalizedCount, localization) 33 | 34 | rec = ann.rec; 35 | 36 | [det.conf, si] = sort(det.conf, 'descend'); 37 | det.bbox = det.bbox(si, :); 38 | det.rnum = det.rnum(si); 39 | 40 | [det, gt] = matchDetectionsWithGroundTruth(dataset, dataset_params, objname, ann, det, localization); 41 | 42 | result.localization = localization; 43 | 44 | result.gt = gt; 45 | result.gt.bbox_conf = zeros(gt.N, 4); 46 | result.gt.bbox_conf(gt.detnum>0, 1:4) = det.bbox(gt.detnum(gt.detnum>0), :); 47 | result.gt.bbox_ov = zeros(gt.N, 4); 48 | result.gt.bbox_ov(gt.detnum_ov>0, 1:4) = det.bbox(gt.detnum_ov(gt.detnum_ov>0), :); 49 | 50 | result.det.bbox = det.bbox; 51 | 52 | result.det.conf = det.conf; 53 | 54 | %% Precision-recall curves 55 | 56 | % Overall 57 | npos = sum(~[gt.isdiff]); 58 | result.all = averagePrecisionNormalized(det.conf, det.label, npos, normalizedCount); 59 | 60 | result.gt.pn = zeros(gt.N, 1); 61 | result.gt.pn(gt.detnum>0) = result.all.pni(gt.detnum(gt.detnum>0)); 62 | result.gt.pn_ov = zeros(gt.N, 1); 63 | result.gt.pn_ov(gt.detnum_ov>0) = result.all.pni(gt.detnum_ov(gt.detnum_ov>0)); 64 | 65 | % Occlusion 66 | result.gt.occ_level = zeros(gt.N, 1); 67 | for level = 1:4 68 | deto = det; 69 | npos = 0; 70 | for k = 1:gt.N 71 | if gt.isdiff(k), continue; end; 72 | r = gt.rnum(k); 73 | o = gt.onum(k); 74 | if rec(r).objects(o).detailedannotation 75 | result.gt.occ_level(k) = rec(r).objects(o).details.occ_level; 76 | if rec(r).objects(o).details.occ_level~=level; 77 | i = (det.label==1 & det.gtnum==k); 78 | deto.label(i) = 0; 79 | else 80 | npos = npos+1; 81 | end 82 | end 83 | end 84 | result.occ(level) = averagePrecisionNormalized(deto.conf, deto.label, npos, normalizedCount); 85 | end 86 | 87 | % Truncation 88 | result.gt.truncated = zeros(gt.N, 1); 89 | for val = 0:1 90 | deto = det; 91 | npos = 0; 92 | for k = 1:gt.N 93 | if gt.isdiff(k), continue; end; 94 | r = gt.rnum(k); 95 | o = gt.onum(k); 96 | if rec(r).objects(o).truncated~=val 97 | result.gt.truncated(k) = rec(r).objects(o).truncated; 98 | i = (det.label==1 & det.gtnum==k); 99 | deto.label(i) = 0; 100 | else 101 | npos = npos+1; 102 | end 103 | end 104 | result.truncated(val+1) = averagePrecisionNormalized(deto.conf, deto.label, npos, normalizedCount); 105 | end 106 | 107 | % BBox Area 108 | bb = gt.bbox(~[gt.isdiff], :); 109 | gtarea = (bb(:, 3)-bb(:, 1)+1).*(bb(:, 4)-bb(:, 2)+1); 110 | [sa, si] = sort(gtarea, 'ascend'); 111 | athresh = [0 sa(round([1/10 3/10 7/10 9/10]*size(bb,1)))']; 112 | alabel(~[gt.isdiff]) = sum(repmat(gtarea, [1 5])>repmat(athresh, [size(bb, 1) 1]), 2); 113 | alabel(logical([gt.isdiff])) = 0; 114 | result.gt.area = alabel; 115 | for a = 1:5 116 | deto = det; 117 | npos = sum(alabel==a &~ [gt.isdiff]'); 118 | ind = find(deto.label==1); 119 | gti = deto.gtnum(ind); 120 | ind = ind(alabel(gti)~=a); 121 | deto.label(ind) = 0; 122 | result.area(a) = averagePrecisionNormalized(deto.conf, deto.label, npos, normalizedCount); 123 | end 124 | areathresh = athresh; 125 | 126 | % BBox Height 127 | bb = gt.bbox(~[gt.isdiff], :); 128 | gtheight = (bb(:, 4)-bb(:, 2)+1); 129 | %gtarea = (bb(:, 3)-bb(:, 1)+1).*(bb(:, 4)-bb(:, 2)+1); 130 | [sa, si] = sort(gtheight, 'ascend'); 131 | athresh = [0 sa(round([1/10 3/10 7/10 9/10]*size(bb,1)))']; 132 | alabel(~[gt.isdiff]) = sum(repmat(gtheight, [1 5])>repmat(athresh, [size(bb, 1) 1]), 2); 133 | alabel(logical([gt.isdiff])) = 0; 134 | for a = 1:5 135 | deto = det; 136 | npos = sum(alabel==a &~ [gt.isdiff]'); 137 | ind = find(deto.label==1); 138 | gti = deto.gtnum(ind); 139 | ind = ind(alabel(gti)~=a); 140 | deto.label(ind) = 0; 141 | result.height(a) = averagePrecisionNormalized(deto.conf, deto.label, npos, normalizedCount); 142 | end 143 | result.gt.height = alabel; 144 | heightthresh = athresh; 145 | 146 | 147 | % Aspect Ratio 148 | bb = gt.bbox(~[gt.isdiff], :); 149 | gtaspect = (bb(:, 3)-bb(:, 1)+1)./(bb(:, 4)-bb(:, 2)+1); 150 | [sa, si] = sort(gtaspect, 'ascend'); 151 | athresh = [0 sa(round([1/10 3/10 7/10 9/10]*size(bb,1)))']; 152 | alabel(~[gt.isdiff]) = sum(repmat(gtaspect, [1 5])>repmat(athresh, [size(bb, 1) 1]), 2); 153 | alabel(logical([gt.isdiff])) = 0; 154 | for a = 1:5 155 | deto = det; 156 | npos = sum(alabel==a &~ [gt.isdiff]'); 157 | ind = find(deto.label==1); 158 | gti = deto.gtnum(ind); 159 | ind = ind(alabel(gti)~=a); 160 | deto.label(ind) = 0; 161 | result.aspect(a) = averagePrecisionNormalized(deto.conf, deto.label, npos, normalizedCount); 162 | end 163 | result.gt.aspect = alabel; 164 | aspectthresh = athresh; 165 | 166 | 167 | % Parts 168 | i = find(~[gt.isdiff], 1, 'first'); 169 | if rec(gt.rnum(i)).objects(gt.onum(i)).detailedannotation 170 | pnames = fieldnames(rec(gt.rnum(i)).objects(gt.onum(i)).details.part_visible); 171 | for p = 1:numel(pnames) 172 | name = pnames{p}; 173 | for val = 0:1 174 | deto = det; 175 | npos = 0; 176 | for k = 1:gt.N 177 | r = gt.rnum(k); 178 | o = gt.onum(k); 179 | if rec(r).objects(o).detailedannotation 180 | result.gt.part.(name)(k) = rec(r).objects(o).details.part_visible.(name); 181 | if rec(r).objects(o).details.part_visible.(name)~=val 182 | deto.label(det.label==1 & det.gtnum==k) = 0; 183 | else 184 | npos = npos+1; 185 | end 186 | end 187 | end 188 | result.part.(name)(val+1) = averagePrecisionNormalized(deto.conf, deto.label, npos, normalizedCount); 189 | end 190 | end 191 | end 192 | 193 | % Side 194 | i = find(~[gt.isdiff], 1, 'first'); 195 | if rec(gt.rnum(i)).objects(gt.onum(i)).detailedannotation 196 | pnames = fieldnames(rec(gt.rnum(i)).objects(gt.onum(i)).details.side_visible); 197 | for p = 1:numel(pnames) 198 | name = pnames{p}; 199 | for val = 0:1 200 | deto = det; 201 | npos = 0; 202 | for k = 1:gt.N 203 | r = gt.rnum(k); 204 | o = gt.onum(k); 205 | if rec(r).objects(o).detailedannotation 206 | result.gt.side.(name)(k) = rec(r).objects(o).details.side_visible.(name); 207 | if rec(r).objects(o).details.side_visible.(name)~=val 208 | deto.label(det.label==1 & det.gtnum==k) = 0; 209 | else 210 | npos = npos+1; 211 | end 212 | end 213 | end 214 | result.side.(name)(val+1) = averagePrecisionNormalized(deto.conf, deto.label, npos, normalizedCount); 215 | end 216 | end 217 | end 218 | 219 | %% Statistics of missed vs. detected 220 | % result.counts stores counts of properties of all and missed objects 221 | % result.overlap stores maximum overlap of different kinds of objects 222 | missedthresh = 0.05; 223 | 224 | missed = true(gt.N, 1); 225 | missed(det.gtnum(result.all.pni>=missedthresh & det.label==1)) = false; 226 | missed(gt.isdiff) = false; 227 | found = ~missed; 228 | found(gt.isdiff) = false; 229 | 230 | % occlusion/truncation 231 | gtoccludedL = result.gt.occ_level(:)>=2 | result.gt.truncated(:); 232 | gtoccludedM = result.gt.occ_level(:)>=3 | result.gt.truncated(:); 233 | result.counts.missed.total = sum(missed); 234 | result.counts.missed.occludedL = sum(missed.*gtoccludedL(:)); 235 | result.counts.missed.occludedM = sum(missed.*gtoccludedM(:)); 236 | result.counts.all.total = sum(missed)+sum(found); 237 | result.counts.all.occludedL = sum(gtoccludedL); 238 | result.counts.all.occludedM = sum(gtoccludedM); 239 | 240 | result.overlap.all.all = mean(gt.ov); 241 | gtnum = det.gtnum(det.gtnum==1); 242 | result.overlap.detected.all = mean(gt.ov(gtnum)); 243 | ind = gtoccludedL(gtnum); 244 | result.overlap.detected.occludedL = mean(gt.ov(gtnum(ind))); 245 | result.overlap.all.occludedL = mean(gt.ov(gtoccludedL)); 246 | ind = gtoccludedM(gtnum); 247 | result.overlap.detected.occludedM = mean(gt.ov(gtnum(ind))); 248 | result.overlap.all.occludedM = mean(gt.ov(gtoccludedM)); 249 | 250 | % area 251 | alabel = result.gt.area(:); 252 | alabel(logical([gt.isdiff])) = 0; 253 | result.counts.missed.area = hist(alabel(missed & alabel>0), 1:5); 254 | result.counts.all.area = hist(alabel(alabel>0), 1:5); 255 | 256 | for k = 1:5 257 | ind = det.gtnum>0; 258 | ind(ind) = alabel(det.gtnum(ind))==k; 259 | result.overlap.detected.area(k) = mean(gt.ov(det.gtnum(ind))); 260 | result.overlap.all.area(k) = mean(gt.ov(alabel==k)); 261 | end 262 | 263 | % aspect 264 | alabel = result.gt.aspect(:); 265 | alabel(logical([gt.isdiff])) = 0; 266 | result.counts.all.aspectratio = hist(alabel(alabel>0), 1:5); 267 | result.counts.missed.aspectratio = hist(alabel(missed & alabel>0), 1:5); 268 | 269 | for k = 1:5 270 | ind = det.gtnum>0; 271 | ind(ind) = alabel(det.gtnum(ind))==k; 272 | result.overlap.detected.aspectratio(k) = mean(gt.ov(det.gtnum(ind))); 273 | result.overlap.all.aspectratio(k) = mean(gt.ov(alabel==k)); 274 | end 275 | 276 | 277 | 278 | -------------------------------------------------------------------------------- /src/averagePrecisionNormalized.m: -------------------------------------------------------------------------------- 1 | function result = averagePrecisionNormalized(conf, label, npos, nnorm) 2 | % result = averagePrecisionNormalized(conf, label, npos, nnorm) 3 | % 4 | % Computes full interpolated average precision, first normalizing the 5 | % precision values. 6 | % Normally, p = tp ./ (fp + tp), but this is sensitive to the density of 7 | % positive examples. For normalized precision, 8 | % tp2 = (tp*N/Npos); p_norm = tp2 ./ (fp + tp2); 9 | % 10 | % Input: 11 | % conf(ndet, 1): confidence of each detection 12 | % label(ndet, 1): label of each detection (-1, 1; 0=don't care) 13 | % npos: the number of ground truth positive examples 14 | % nnorm: the normalized value for number of positives (for normalized AP) 15 | % 16 | % Output: 17 | % result.(labels, conf, npos, nnorm, r, p, pn, ap, apn, ap_std, apn_std): 18 | % the precision-recall and normalized precision-recall curves with AP 19 | % and standard error of AP 20 | % 21 | 22 | [sv, si] = sort(conf, 'descend'); 23 | label = label(si); 24 | 25 | tp = cumsum(label==1); 26 | fp = cumsum(label==-1); 27 | conf = sv; 28 | 29 | r = tp / npos; 30 | p = tp ./ (tp + fp); 31 | 32 | tpn = tp*nnorm/npos; 33 | pn = tpn ./ (tpn + fp); 34 | 35 | result = struct('labels', label, 'conf', conf, 'r', r, 'p', p, 'pn', pn); 36 | result.npos = npos; 37 | result.nnorm = nnorm; 38 | 39 | 40 | % compute interpolated precision and normalized precision 41 | istp = (label==1); 42 | Np = numel(r); 43 | for i = Np-1:-1:1 44 | p(i) = max(p(i), p(i+1)); 45 | pn(i) = max(pn(i), pn(i+1)); 46 | end 47 | result.pi = p; 48 | result.pni = pn; 49 | result.ap = mean(p(istp))*r(end); 50 | result.apn = mean(pn(istp))*r(end); 51 | 52 | missed = zeros(npos-sum(label==1),1); 53 | result.ap_stderr = std([p(istp(:)) ; missed])/sqrt(npos); 54 | result.apn_stderr = std([pn(istp(:)) ; missed])/sqrt(npos); 55 | -------------------------------------------------------------------------------- /src/computeAPForObjectSubset.m: -------------------------------------------------------------------------------- 1 | function [ap fraction] = computeAPForObjectSubset(result, varargin) 2 | % [ap fraction] = computeAPForObjectSubset(result, varargin) 3 | % 4 | % Computes AP for the subset of objects specified. Specify characteristics 5 | % with triplets of type (e.g., area or truncated), possible range of values 6 | % (e.g., 1:5 for size), and indices of selected values. Requires that 7 | % result.gt.(type) and result.(type) both exist. 8 | % 9 | % Format: computeAPForObjectSubset(result, type1, value_indices1, 10 | % possible_values1, type2, value_indices2, possible_values2, ...) 11 | % 12 | % Example: 13 | % [ap, fraction] = computeAPForObjectSubset(result(1), 'area', 1:5, [3 4 5], 'truncated', [0:1], 0); 14 | % Returns AP for objects of area = 3-5 (med to large) and truncated=0. 15 | % Fraction is the % of objects that match that criterion. 16 | 17 | conf = result.all.conf; 18 | labels = result.all.labels; 19 | 20 | fits = ~result.gt.isdiff; 21 | 22 | for k = 1:3:numel(varargin) 23 | 24 | type = varargin{k}; 25 | values = varargin{k+2}; 26 | possible_values = varargin{k+1}; 27 | 28 | tmplabels = [result.(type)(values).labels]; 29 | labels(labels==1) = any(tmplabels(labels==1, :), 2); 30 | 31 | tmp = result.gt.(type); 32 | fits = fits & any(repmat(tmp(:), [1 numel(values)])==repmat(possible_values(values), [numel(result.gt.(type)) 1]), 2); 33 | 34 | end 35 | 36 | pr = averagePrecisionNormalized(conf, labels, sum(fits), result(1).all.nnorm); 37 | ap = pr.ap; 38 | 39 | fraction = sum(fits)/result.all.npos; 40 | disp(num2str([ap fraction])) -------------------------------------------------------------------------------- /src/displayAnalysisResults.m: -------------------------------------------------------------------------------- 1 | function displayAnalysisResults(results_all, titlename) 2 | 3 | close all 4 | 5 | drawline = true; 6 | makeMultiCategoryPlot(1, results_all, 'occ', [titlename ': Occlusion'], 1, {'0', 'L', 'M', 'H'}, drawline); 7 | makeMultiCategoryPlot(2, results_all, 'area', [titlename ': BBox Area'], 1, {'XS', 'S', 'M', 'L', 'XL'}, drawline); 8 | makeMultiCategoryPlot(3, results_all, 'height', [titlename ': BBox Height'], 1, {'XS', 'S', 'M', 'L', 'XL'}, drawline); 9 | makeMultiCategoryPlot(4, results_all, 'aspect', [titlename ': Aspect Ratio'], 1, {'XT', 'T', 'M', 'W', 'XW'}, drawline); 10 | makeMultiCategoryPlot(5, results_all, 'truncated', [titlename ': Truncation'], 1, {'N', 'T'}, drawline); 11 | f=5; 12 | 13 | fs = 8; 14 | 15 | % Visible parts 16 | f=f+1; 17 | tickstr = {}; 18 | np=0; 19 | 20 | for o = 1:numel(results_all) 21 | pnames = fieldnames(results_all(o).part); 22 | for p = 1:numel(pnames) 23 | np=np+1; 24 | results_all(o).tmp((p-1)*2+(1:2)) = results_all(o).part.(pnames{p}); 25 | %tickstr(end+1) = {sprintf('%s\non/off', pnames{p})}; 26 | end 27 | end 28 | drawline = false; 29 | makeMultiCategoryPlot(f, results_all, 'tmp', [titlename ': Parts Visible'], 1, tickstr, drawline); 30 | n=0; 31 | for o = 1:numel(results_all) 32 | pnames = fieldnames(results_all(o).part); 33 | n=n+1; 34 | for p = 1:numel(pnames) 35 | name = pnames{p}; if numel(name)>5, name = removeVowels(name); end; 36 | text(n+1, -0.05, sprintf('%s\n0/1', name), 'fontsize', fs); 37 | n = n+2; 38 | end 39 | end 40 | results_all = rmfield(results_all, 'tmp'); 41 | 42 | % Visible sides 43 | f=f+1; 44 | tickstr = {}; 45 | np=0; 46 | for o = 1:numel(results_all) 47 | pnames = fieldnames(results_all(o).side); 48 | for p = 1:numel(pnames) 49 | np=np+1; 50 | results_all(o).tmp((p-1)*2+(1:2)) = results_all(o).side.(pnames{p}); 51 | %tickstr(end+1) = {sprintf('%s\non/off', pnames{p})}; 52 | end 53 | end 54 | drawline = false; 55 | makeMultiCategoryPlot(f, results_all, 'tmp', [titlename ': Sides Visible'], 1, tickstr, drawline); 56 | n=0; 57 | for o = 1:numel(results_all) 58 | pnames = fieldnames(results_all(o).side); 59 | n=n+1; 60 | for p = 1:numel(pnames) 61 | name = pnames{p}; if numel(name)>5, name = removeVowels(name); end; 62 | text(n+1, -0.05, sprintf('%s\n0/1', name), 'fontsize', fs); 63 | n = n+2; 64 | end 65 | end 66 | results_all = rmfield(results_all, 'tmp'); 67 | 68 | 69 | 70 | function makeMultiCategoryPlot(f, results, rname, title_str, xtickstep, xticklab, drawline) 71 | 72 | fs = 10; 73 | setupplot(f); 74 | 75 | nobj = numel(results); 76 | 77 | rangex = 0; 78 | maxy = 0; 79 | xticks = []; 80 | firsttick = zeros(nobj,1); 81 | for o = 1:nobj 82 | result = results(o); 83 | nres = numel(results(o).(rname)); 84 | rangex = rangex(end)+1+(1:nres); 85 | plotapnbars(result.(rname), rangex, drawline); 86 | maxy = max(maxy, round(max(([result.(rname).apn]+0.15))*10)/10); 87 | h=plot(rangex([1 end]), [1 1]*result.all.apn, 'k--', 'linewidth', 1); 88 | firsttick(o) = rangex(1); 89 | xticks = [xticks rangex(1:xtickstep:end)]; 90 | end 91 | maxy = min(maxy, 1); 92 | if numel(xticklab)==nres 93 | xticklab = repmat(xticklab, [1 nobj]); 94 | end 95 | axis([0 rangex(end)+1 0 maxy]); 96 | for o = 1:numel(results) 97 | if strcmp(results(o).name, 'diningtable') 98 | results(o).name = 'table'; 99 | elseif strcmp(results(o).name, 'aeroplane') 100 | results(o).name = 'airplane'; 101 | end 102 | text(firsttick(o), maxy-0.05, results(o).name, 'fontsize', fs); 103 | end 104 | title(title_str, 'fontsize', fs); 105 | set(gca, 'xtick', xticks); 106 | %set(gca, 'ytick', 0:0.1:maxy); 107 | set(gca, 'xticklabel', xticklab); 108 | set(gca, 'ygrid', 'on') 109 | set(gca, 'xgrid', 'on') 110 | set(gca, 'fontsize', fs); 111 | set(gca, 'ticklength', [0.001 0.001]); 112 | 113 | 114 | function plotapnbars(resall, x, drawline) 115 | for k = 1:numel(resall) 116 | res =resall(k); 117 | if isnan(res.apn), res.apn = 0; end 118 | if ~isnan(res.apn_stderr) 119 | errorbar(x(k), res.apn, res.apn_stderr, 'r', 'linewidth', 1); 120 | end 121 | hold on; 122 | plot(x(k), res.apn, '+', 'linewidth', 1, 'markersize', 5); 123 | text(x(k)+0.12, res.apn, sprintf('%0.2f', res.apn), 'fontsize', 8); 124 | end 125 | if drawline 126 | plot(x, [resall.apn], 'b-', 'linewidth', 1); 127 | else % draw every other 128 | for i=1:2:numel(x) 129 | plot(x([i i+1]), [resall([i i+1]).apn], 'b-', 'linewidth', 1); 130 | end 131 | end 132 | %axis([0 x(end+1) numel(resall)+1 0 ceil(max([resall.apn]+[resall.apn_stderr]+0.1)*10)/10]) 133 | 134 | function str = removeVowels(str) 135 | for v = 'aeiou' 136 | str(str==v) = []; 137 | end 138 | 139 | 140 | function setupplot(f) 141 | figure(f), hold off 142 | -------------------------------------------------------------------------------- /src/displayAverageSensitivityImpactPlot.m: -------------------------------------------------------------------------------- 1 | function displayAverageSensitivityImpactPlot(results_all, titlename) 2 | 3 | close all 4 | 5 | fs = 12; 6 | 7 | fnames = {'occ', 'truncated', 'area', 'aspect', 'side', 'part'}; 8 | xticklab = {'occ', 'trn', 'size', 'asp', 'view', 'part'}; 9 | 10 | valid = true(size(fnames)); 11 | for f = 1:numel(fnames) 12 | if ~isfield(results_all(1), fnames{f}) 13 | valid(f) = false; 14 | continue; 15 | end 16 | % for o = 1:numel(results_all) 17 | % if isfield(results_all(o).(fnames{f}), 'apn') && ... 18 | % any(isnan([results_all(o).(fnames{f}).apn])) 19 | % valid(f) = false; % at least one category is missing, so ignore 20 | % continue; 21 | % end 22 | % end 23 | for o = 1:numel(results_all) 24 | maxval(o,f) = getMaxVal([results_all(o).(fnames{f})], 'apn'); 25 | minval(o,f) = getMinVal([results_all(o).(fnames{f})], 'apn'); 26 | end 27 | end 28 | maxval = maxval(:, valid); minval = minval(:, valid); 29 | fnames = fnames(valid); xticklab = xticklab(valid); 30 | 31 | maxval = mean(maxval, 1); 32 | minval = mean(minval, 1); 33 | tmp = [results_all.all]; 34 | avgval = mean([tmp.apn]); 35 | 36 | figure(1), hold off; 37 | plot([1 numel(fnames)], [avgval avgval], 'k--', 'linewidth', 1); 38 | hold on; 39 | errorbar(1:numel(fnames), avgval*ones(1, numel(fnames)), avgval-minval, maxval-avgval, 'r+', 'linewidth', 1); 40 | for x = 1:numel(fnames) 41 | text(x+0.12, minval(x), sprintf('%0.3f', minval(x)), 'fontsize', fs-2); 42 | text(x+0.12, maxval(x), sprintf('%0.3f', maxval(x)), 'fontsize', fs-2); 43 | end 44 | text(0.1, avgval, sprintf('%0.3f', avgval), 'fontsize', fs-2); 45 | 46 | ymax = min(round((max(maxval)+0.15)*10)/10,1); 47 | axis([0 numel(fnames)+1 0 ymax]); 48 | 49 | set(gca, 'xtick', 1:numel(fnames)); 50 | set(gca, 'xticklabel', xticklab); 51 | set(gca, 'ygrid', 'on') 52 | set(gca, 'xgrid', 'on') 53 | set(gca, 'fontsize', fs); 54 | set(gca, 'ticklength', [0.001 0.001]); 55 | title([titlename ': Sensitivity and Impact']) 56 | 57 | 58 | 59 | 60 | %% Gets the maximum value of a particular variable name for any field in the structure 61 | function maxy = getMaxVal(s, fname, maxy) 62 | if ~exist('maxy', 'var') || isempty(maxy) 63 | maxy = -Inf; 64 | end 65 | if numel(s)>1 66 | for k = 1:numel(s) 67 | maxy = max(maxy, getMaxVal(s(k), fname, maxy)); 68 | end 69 | return; 70 | end 71 | names = fieldnames(s); 72 | for k = 1:numel(names) 73 | if ~isstruct(s.(names{k})) && ~strcmp(names{k}, fname) 74 | continue; 75 | end 76 | for j = 1:numel(s.(names{k})) 77 | if strcmp(names{k}, fname) 78 | if s.npos>=5 % special case 79 | maxy = max(maxy, s.(fname)(j)); 80 | end 81 | else 82 | maxy = max(maxy, getMaxVal(s.(names{k})(j), fname, maxy)); 83 | end 84 | end 85 | end 86 | 87 | 88 | function miny = getMinVal(s, fname, miny) 89 | if ~exist('miny', 'var') || isempty(miny) 90 | miny = Inf; 91 | end 92 | if numel(s)>1 93 | for k = 1:numel(s) 94 | miny = min(miny, getMinVal(s(k), fname, miny)); 95 | end 96 | return; 97 | end 98 | names = fieldnames(s); 99 | for k = 1:numel(names) 100 | if ~isstruct(s.(names{k})) && ~strcmp(names{k}, fname) 101 | continue; 102 | end 103 | for j = 1:numel(s.(names{k})) 104 | if strcmp(names{k}, fname) 105 | if s.npos>=5 % special case 106 | miny = min(miny, s.(fname)(j)); 107 | end 108 | else 109 | miny = min(miny, getMinVal(s.(names{k})(j), fname, miny)); 110 | end 111 | end 112 | end 113 | 114 | 115 | %% Removes vowels from a string 116 | function str = removeVowels(str) 117 | for v = 'aeiou' 118 | str(str==v) = []; 119 | end 120 | 121 | -------------------------------------------------------------------------------- /src/displayCharacteristicPerClassPlots.m: -------------------------------------------------------------------------------- 1 | function displayCharacteristicPerClassPlots(results_all, titlename) 2 | 3 | close all 4 | 5 | fs = 8; 6 | 7 | for o = 1:numel(results_all) 8 | % makeMultiCharacteristicPlot(o, results_all(o), ... 9 | % {'occ', 'truncated', 'area', 'aspect', 'p' ,'v'}, ... 10 | % [titlename ': ' results_all(o).name], ... 11 | % {'Occlusion', 'Truncation', 'Area', 'Aspect', 'Parts', 'Viewpoint'}, ... 12 | % 13 | % 14 | titlestr = [titlename ': ' results_all(o).name]; 15 | result = results_all(o); 16 | 17 | maxy = getMaxVal(result, 'apn'); 18 | yrange = [0 min(round((maxy+0.15)*10)/10,1)]; 19 | 20 | %maxy = max([result.occ.apn result.truncated.apn result.area.apn result.aspect.apn]); 21 | 22 | figure(o), hold off 23 | drawline = true; 24 | xrange = (1:4); 25 | makeMultiCharacteristicPlot(o, result, 'occ', 'Occlusn.', titlestr, xrange, yrange, {'N', 'L', 'M', 'H'}, drawline); 26 | hold on; 27 | xrange = xrange(end)+1+(1:2); 28 | makeMultiCharacteristicPlot(o, result, 'truncated', 'Trnc.', titlestr, xrange, yrange, {'N', 'T'}, drawline); 29 | xrange = xrange(end)+1+(1:5); 30 | makeMultiCharacteristicPlot(o, result, 'area', 'BBox Area', titlestr, xrange, yrange, {'XS', 'S', 'M', 'L', 'XL'}, drawline); 31 | xrange = xrange(end)+1+(1:5); 32 | makeMultiCharacteristicPlot(o, result, 'aspect', 'Aspect Rat.', titlestr, xrange, yrange, {'XT', 'T', 'M', 'W', 'XW'}, drawline); 33 | 34 | 35 | % visible side 36 | if isfield(result, 'side') 37 | pnames = fieldnames(result.side); 38 | for p = 1:numel(pnames) 39 | result.s((p-1)*2+(1:2)) = result.side.(pnames{p}); 40 | if p==1 41 | xrange = [xrange(end)+1+(1:2)]; 42 | else 43 | xrange = [xrange xrange(end)+0.5+(1:2)]; 44 | end 45 | end 46 | drawline = false; 47 | tickstr = repmat({' '}, 1, 2*numel(pnames)); 48 | makeMultiCharacteristicPlot(o, result, 's', 'Sides Visible', titlestr, xrange, yrange, tickstr, drawline); 49 | for p = 1:numel(pnames) 50 | name = pnames{p}; if numel(name)>5, name = removeVowels(name); end; 51 | text(xrange((p-1)*2+1), -0.071*yrange(2), sprintf('%s\n0/1', name), 'fontsize', fs); 52 | end 53 | end 54 | 55 | % parts 56 | if isfield(result, 'part') 57 | pnames = fieldnames(result.part); 58 | for p = 1:numel(pnames) 59 | result.p((p-1)*2+(1:2)) = result.part.(pnames{p}); 60 | if p==1 61 | xrange = [xrange(end)+1+(1:2)]; 62 | else 63 | xrange = [xrange xrange(end)+0.5+(1:2)]; 64 | end 65 | end 66 | drawline = false; 67 | tickstr = repmat({' '}, 1, 2*numel(pnames)); 68 | makeMultiCharacteristicPlot(o, result, 'p', 'Parts Visible', titlestr, xrange, yrange, tickstr, drawline); 69 | for p = 1:numel(pnames) 70 | name = pnames{p}; if numel(name)>5, name = removeVowels(name); end; 71 | text(xrange((p-1)*2+1), -0.071*yrange(2), sprintf('%s\n0/1', name), 'fontsize', fs); 72 | end 73 | end 74 | 75 | 76 | end 77 | 78 | 79 | return; 80 | 81 | % Visible parts 82 | f=f+1; 83 | tickstr = {}; 84 | np=0; 85 | 86 | for o = 1:numel(results_all) 87 | pnames = fieldnames(results_all(o).part); 88 | for p = 1:numel(pnames) 89 | np=np+1; 90 | results_all(o).tmp((p-1)*2+(1:2)) = results_all(o).part.(pnames{p}); 91 | %tickstr(end+1) = {sprintf('%s\non/off', pnames{p})}; 92 | end 93 | end 94 | drawline = false; 95 | makeMultiCategoryPlot(f, results_all, 'tmp', [titlename ': Parts Visible'], 1, tickstr, drawline); 96 | n=0; 97 | for o = 1:numel(results_all) 98 | pnames = fieldnames(results_all(o).part); 99 | n=n+1; 100 | for p = 1:numel(pnames) 101 | name = pnames{p}; if numel(name)>5, name = removeVowels(name); end; 102 | text(n+1, -0.05, sprintf('%s\n0/1', name), 'fontsize', fs); 103 | n = n+2; 104 | end 105 | end 106 | results_all = rmfield(results_all, 'tmp'); 107 | 108 | % Visible sides 109 | f=f+1; 110 | tickstr = {}; 111 | np=0; 112 | for o = 1:numel(results_all) 113 | pnames = fieldnames(results_all(o).side); 114 | for p = 1:numel(pnames) 115 | np=np+1; 116 | results_all(o).tmp((p-1)*2+(1:2)) = results_all(o).side.(pnames{p}); 117 | %tickstr(end+1) = {sprintf('%s\non/off', pnames{p})}; 118 | end 119 | end 120 | drawline = false; 121 | makeMultiCategoryPlot(f, results_all, 'tmp', [titlename ': Sides Visible'], 1, tickstr, drawline); 122 | n=0; 123 | for o = 1:numel(results_all) 124 | pnames = fieldnames(results_all(o).side); 125 | n=n+1; 126 | for p = 1:numel(pnames) 127 | name = pnames{p}; if numel(name)>5, name = removeVowels(name); end; 128 | text(n+1, -0.05, sprintf('%s\n0/1', name), 'fontsize', fs); 129 | n = n+2; 130 | end 131 | end 132 | results_all = rmfield(results_all, 'tmp'); 133 | 134 | 135 | 136 | %% Extends current plot with given characteristic performance 137 | function makeMultiCharacteristicPlot(f, result, rname, subtitle, title_str, xticks, yrange, xticklab, drawline) 138 | 139 | fs = 10; 140 | figure(f); 141 | 142 | 143 | plotapnbars(result.(rname), xticks, drawline); 144 | 145 | curraxis = axis; 146 | maxy = max(curraxis(4), round(max(([result.(rname).apn]+0.15))*10)/10); 147 | h=plot(xticks([1 end]), [1 1]*result.all.apn, 'k--', 'linewidth', 1); 148 | 149 | maxy = min(maxy, 1); 150 | axis([0 xticks(end)+1 yrange]); % set to max of current maxy and new maxy 151 | text(xticks(1), yrange(2)-0.05, subtitle, 'fontsize', fs); 152 | 153 | title(title_str, 'fontsize', fs); 154 | 155 | if xticks(1)>1 156 | xticks = cat(2, get(gca, 'xtick'), xticks); 157 | xticklab = cat(1, get(gca, 'xticklabel'), xticklab(:)); 158 | end 159 | 160 | set(gca, 'xtick', xticks); 161 | %set(gca, 'ytick', 0:0.1:maxy); 162 | set(gca, 'xticklabel', xticklab); 163 | set(gca, 'ygrid', 'on') 164 | set(gca, 'xgrid', 'on') 165 | set(gca, 'fontsize', fs); 166 | set(gca, 'ticklength', [0.001 0.001]); 167 | 168 | 169 | %% Gets the maximum value of a particular variable name for any field in the structure 170 | function maxy = getMaxVal(s, fname, maxy) 171 | if ~exist('maxy', 'var') || isempty(maxy) 172 | maxy = -Inf; 173 | end 174 | names = fieldnames(s); 175 | for k = 1:numel(names) 176 | if ~isstruct(s.(names{k})) && ~strcmp(names{k}, fname) 177 | continue; 178 | end 179 | for j = 1:numel(s.(names{k})) 180 | if strcmp(names{k}, fname) 181 | maxy = max(maxy, s.(fname)(j)); 182 | else 183 | maxy = max(maxy, getMaxVal(s.(names{k})(j), fname, maxy)); 184 | end 185 | end 186 | end 187 | 188 | 189 | %% Plots error bards for apn 190 | function plotapnbars(resall, x, drawline) 191 | for k = 1:numel(resall) 192 | res =resall(k); 193 | if isnan(res.apn), res.apn = 0; end 194 | if ~isnan(res.apn_stderr) 195 | errorbar(x(k), res.apn, res.apn_stderr, 'r', 'linewidth', 1); 196 | end 197 | hold on; 198 | plot(x(k), res.apn, '+', 'linewidth', 1, 'markersize', 5); 199 | text(x(k)+0.12, res.apn, sprintf('%0.2f', res.apn), 'fontsize', 8); 200 | end 201 | if drawline 202 | plot(x, [resall.apn], 'b-', 'linewidth', 1); 203 | else % draw every other 204 | for i=1:2:numel(x) 205 | plot(x([i i+1]), [resall([i i+1]).apn], 'b-', 'linewidth', 1); 206 | end 207 | end 208 | %axis([0 x(end+1) numel(resall)+1 0 ceil(max([resall.apn]+[resall.apn_stderr]+0.1)*10)/10]) 209 | 210 | 211 | %% Removes vowels from a string 212 | function str = removeVowels(str) 213 | for v = 'aeiou' 214 | str(str==v) = []; 215 | end 216 | 217 | -------------------------------------------------------------------------------- /src/displayDetectionTrend.m: -------------------------------------------------------------------------------- 1 | function displayDetectionTrend(result, tics, titlestr) 2 | % displayDetectionTrend(result, tics, titlestr) 3 | % 4 | % Displays stacked area plots showing trend of detections/false positives 5 | % with rank, along with recall for strong and weak localization. If a 6 | % group of objects is analyzed (numel(result)>1), the number of fps and 7 | % recall is averaged across categories 8 | % 9 | 10 | 11 | if numel(result)==1 12 | npos = result.all.npos; 13 | else 14 | tmp = [result.all]; 15 | npos = round(mean([tmp.npos])); 16 | end 17 | 18 | ncor = getCumulativeCount({result.iscorrect}); 19 | nsim = getCumulativeCount({result.issim}); 20 | nbg = getCumulativeCount({result.isbg_notobj}); 21 | nloc = getCumulativeCount({result.isloc}); 22 | noth = getCumulativeCount({result.isother}); 23 | ntotal = ncor+nsim+nbg+nloc+nbg+noth; 24 | 25 | ncor = getFpCounts(ncor, ntotal, tics*npos); 26 | nsim = getFpCounts(nsim, ntotal, tics*npos); 27 | nbg = getFpCounts(nbg, ntotal, tics*npos); 28 | nloc = getFpCounts(nloc, ntotal, tics*npos); 29 | noth = getFpCounts(noth, ntotal, tics*npos); 30 | 31 | ntotal = ncor+nsim+nbg+nloc+noth; 32 | 33 | figure(3), hold off 34 | area(1:numel(tics), [ncor(:) nloc(:) nsim(:) noth(:) nbg(:)] ./ repmat(ntotal(:), [1 5]) * 100); 35 | set(gca, 'xtick', 1:numel(tics)); 36 | set(gca, 'xticklabel', num2cell(tics)) 37 | set(gca,'Layer','top') 38 | colormap([[255 255 255]/255 ; [79 129 189]/255 ; [192 80 77]/255 ; [77 192 80]/255*1.2 ; [128 100 162]/255]); 39 | set(gca, 'fontsize', 16); 40 | axis([1 numel(tics) 0 100]) 41 | legend({'Cor', 'Loc', 'Sim', 'Oth', 'BG'}, 'location', 'southeast') 42 | title(titlestr); 43 | xlabel(sprintf('total detections (x %d)', npos)); 44 | ylabel('percentage of each type'); 45 | 46 | hold on 47 | if numel(result)==1 48 | recall_weak = result.fixloc.r(min(round(tics*npos), numel(result.fixloc.r))); 49 | recall_strong = result.all.r(min(round(tics*npos), numel(result.all.r))); 50 | else 51 | recall_weak = 0; 52 | recall_strong = 0; 53 | for k = 1:numel(result) 54 | nposk = result(k).all.npos; 55 | recall_weak = recall_weak + result(k).fixloc.r(min(round(tics*nposk), numel(result(k).fixloc.r)))/numel(result); 56 | recall_strong = recall_strong + result(k).all.r(min(round(tics*nposk), numel(result(k).all.r)))/numel(result); 57 | end 58 | end 59 | plot(1:numel(tics), recall_strong*100, '-r', 'linewidth', 3); 60 | plot(1:numel(tics), recall_weak*100, '--r', 'linewidth', 3); 61 | 62 | % figure(4), 63 | % set(gcf, 'DefaultAxesColorOrder', [[79 129 189]/255 ; [192 80 77]/255 ; [77 192 80]/255*1.2 ; [128 100 162]/255]); 64 | % plot(1:numel(nfp), [nloc(:) nsim(:) noth(:) nbg(:)] ./ repmat(ntotal(:), [1 4])*100, 'linewidth', 3); 65 | % set(gca, 'xtick', 1:numel(nfp)); 66 | % set(gca, 'xticklabel', num2cell(nfp)) 67 | % set(gca, 'fontsize', 16); 68 | % axis([1 numel(nfp) 0 100]) 69 | % legend({'Loc', 'Sim', 'Oth', 'BG'}) 70 | % title(titlestr); 71 | % xlabel('total false positives') 72 | % ylabel('percentage of each type') 73 | % 74 | % figure(5), 75 | % set(gcf, 'DefaultAxesColorOrder', [[192 80 77]/255 ; [77 192 80]/255*1.2 ; [128 100 162]/255]); 76 | % plot(1:numel(nfp), [nsim(:) noth(:) nbg(:)] ./ repmat(ntotal(:)-nloc(:), [1 3])*100, 'linewidth', 3); 77 | % set(gca, 'xtick', 1:numel(nfp)); 78 | % set(gca, 'xticklabel', num2cell(nfp)) 79 | % %colormap([[192 80 77]/255 ; [77 192 80]/255*1.2 ; [128 100 162]/255]); 80 | % set(gca, 'fontsize', 16); 81 | % axis([1 numel(nfp) 0 100]) 82 | % legend({'Sim', 'Oth', 'BG'}) 83 | % title(titlestr); 84 | % xlabel('total false positives') 85 | % ylabel('pctg of each type (excluding loc)') 86 | 87 | 88 | function count = getCumulativeCount(n) 89 | count = double(n{1}); 90 | for k = 2:numel(n) 91 | if numel(n{k})>numel(count) 92 | tmp = count; 93 | count = double(n{k}); 94 | count(1:numel(tmp)) = double(count(1:numel(tmp))) + double(tmp); 95 | else 96 | count(1:numel(n{k})) = double(count(1:numel(n{k}))) + double(n{k}); 97 | end 98 | end 99 | count = cumsum(count); 100 | 101 | function count = getFpCounts(tmpc, total, nfp) 102 | count = zeros(size(nfp)); 103 | t = 1; 104 | for k = 1:numel(tmpc) 105 | while t<=numel(nfp) && nfp(t)<=total(k) 106 | count(t) = tmpc(k); 107 | t = t+1; 108 | end 109 | if t > numel(nfp) 110 | break; 111 | end 112 | end -------------------------------------------------------------------------------- /src/displayDetectionTrend2.m: -------------------------------------------------------------------------------- 1 | function displayDetectionTrend2(result, tics, titlestr) 2 | % displayDetectionTrend(result, tics, titlestr) 3 | % 4 | % Displays stacked area plots showing trend of detections/false positives 5 | % with rank, along with recall for strong and weak localization. If a 6 | % group of objects is analyzed (numel(result)>1), the number of fps and 7 | % recall is averaged across categories 8 | % 9 | 10 | tmp = [result.all]; 11 | npos = {tmp.npos}; 12 | 13 | ncor = cellfun(@(x) getCumulativeCount({x}), {result.iscorrect}, 'UniformOutput', false); 14 | nsim = cellfun(@(x) getCumulativeCount({x}), {result.issim}, 'UniformOutput', false); 15 | nbg = cellfun(@(x) getCumulativeCount({x}), {result.isbg_notobj}, 'UniformOutput', false); 16 | nloc = cellfun(@(x) getCumulativeCount({x}), {result.isloc}, 'UniformOutput', false); 17 | noth = cellfun(@(x) getCumulativeCount({x}), {result.isother}, 'UniformOutput', false); 18 | 19 | ntotal = cellfun(@(x1, x2, x3, x4, x5) x1+x2+x3+x4+x5, ncor, nsim, nbg, nloc, noth, 'UniformOutput', false); 20 | 21 | ncor = cellfun(@(x, y, z) getFpCounts(x, y, tics*z), ncor, ntotal, npos, 'UniformOutput', false); 22 | nsim = cellfun(@(x, y, z) getFpCounts(x, y, tics*z), nsim, ntotal, npos, 'UniformOutput', false); 23 | nbg = cellfun(@(x, y, z) getFpCounts(x, y, tics*z), nbg, ntotal, npos, 'UniformOutput', false); 24 | nloc = cellfun(@(x, y, z) getFpCounts(x, y, tics*z), nloc, ntotal, npos, 'UniformOutput', false); 25 | noth = cellfun(@(x, y, z) getFpCounts(x, y, tics*z), noth, ntotal, npos, 'UniformOutput', false); 26 | 27 | ntotal = cellfun(@(x1, x2, x3, x4, x5) x1+x2+x3+x4+x5, ncor, nsim, nbg, nloc, noth, 'UniformOutput', false); 28 | 29 | ncor = mean(cell2mat(ncor(:)), 1); 30 | nsim = mean(cell2mat(nsim(:)), 1); 31 | nbg = mean(cell2mat(nbg(:)), 1); 32 | nloc = mean(cell2mat(nloc(:)), 1); 33 | noth = mean(cell2mat(noth(:)), 1); 34 | 35 | npos = round(mean(cell2mat(npos(:)), 1)); 36 | ntotal = mean(cell2mat(ntotal(:)), 1); 37 | 38 | figure(3), hold off 39 | area(1:numel(tics), [ncor(:) nloc(:) nsim(:) noth(:) nbg(:)] ./ repmat(ntotal(:), [1 5]) * 100); 40 | set(gca, 'xtick', 1:numel(tics)); 41 | set(gca, 'xticklabel', num2cell(tics)) 42 | set(gca,'Layer','top') 43 | colormap([[255 255 255]/255 ; [79 129 189]/255 ; [192 80 77]/255 ; [77 192 80]/255*1.2 ; [128 100 162]/255]); 44 | set(gca, 'fontsize', 16); 45 | axis([1 numel(tics) 0 100]) 46 | legend({'Cor', 'Loc', 'Sim', 'Oth', 'BG'}, 'location', 'southeast') 47 | title(titlestr); 48 | xlabel(sprintf('total detections (x %d)', npos)); 49 | ylabel('percentage of each type'); 50 | 51 | hold on 52 | if numel(result)==1 53 | recall_weak = result.fixloc.r(min(round(tics*npos), numel(result.fixloc.r))); 54 | recall_strong = result.all.r(min(round(tics*npos), numel(result.all.r))); 55 | else 56 | recall_weak = 0; 57 | recall_strong = 0; 58 | for k = 1:numel(result) 59 | nposk = result(k).all.npos; 60 | recall_weak = recall_weak + result(k).fixloc.r(min(round(tics*nposk), numel(result(k).fixloc.r)))/numel(result); 61 | recall_strong = recall_strong + result(k).all.r(min(round(tics*nposk), numel(result(k).all.r)))/numel(result); 62 | end 63 | end 64 | plot(1:numel(tics), recall_strong*100, '-r', 'linewidth', 3); 65 | plot(1:numel(tics), recall_weak*100, '--r', 'linewidth', 3); 66 | 67 | % figure(4), 68 | % set(gcf, 'DefaultAxesColorOrder', [[79 129 189]/255 ; [192 80 77]/255 ; [77 192 80]/255*1.2 ; [128 100 162]/255]); 69 | % plot(1:numel(nfp), [nloc(:) nsim(:) noth(:) nbg(:)] ./ repmat(ntotal(:), [1 4])*100, 'linewidth', 3); 70 | % set(gca, 'xtick', 1:numel(nfp)); 71 | % set(gca, 'xticklabel', num2cell(nfp)) 72 | % set(gca, 'fontsize', 16); 73 | % axis([1 numel(nfp) 0 100]) 74 | % legend({'Loc', 'Sim', 'Oth', 'BG'}) 75 | % title(titlestr); 76 | % xlabel('total false positives') 77 | % ylabel('percentage of each type') 78 | % 79 | % figure(5), 80 | % set(gcf, 'DefaultAxesColorOrder', [[192 80 77]/255 ; [77 192 80]/255*1.2 ; [128 100 162]/255]); 81 | % plot(1:numel(nfp), [nsim(:) noth(:) nbg(:)] ./ repmat(ntotal(:)-nloc(:), [1 3])*100, 'linewidth', 3); 82 | % set(gca, 'xtick', 1:numel(nfp)); 83 | % set(gca, 'xticklabel', num2cell(nfp)) 84 | % %colormap([[192 80 77]/255 ; [77 192 80]/255*1.2 ; [128 100 162]/255]); 85 | % set(gca, 'fontsize', 16); 86 | % axis([1 numel(nfp) 0 100]) 87 | % legend({'Sim', 'Oth', 'BG'}) 88 | % title(titlestr); 89 | % xlabel('total false positives') 90 | % ylabel('pctg of each type (excluding loc)') 91 | 92 | 93 | function count = getCumulativeCount(n) 94 | count = double(n{1}); 95 | for k = 2:numel(n) 96 | if numel(n{k})>numel(count) 97 | tmp = count; 98 | count = double(n{k}); 99 | count(1:numel(tmp)) = double(count(1:numel(tmp))) + double(tmp); 100 | else 101 | count(1:numel(n{k})) = double(count(1:numel(n{k}))) + double(n{k}); 102 | end 103 | end 104 | count = cumsum(count); 105 | 106 | function count = getFpCounts(tmpc, total, nfp) 107 | count = zeros(size(nfp)); 108 | t = 1; 109 | for k = 1:numel(tmpc) 110 | while t<=numel(nfp) && nfp(t)<=total(k) 111 | count(t) = tmpc(k); 112 | t = t+1; 113 | end 114 | if t > numel(nfp) 115 | break; 116 | end 117 | end -------------------------------------------------------------------------------- /src/displayExtraAnnotations.m: -------------------------------------------------------------------------------- 1 | function displayExtraAnnotations(imdir, rec, cls) 2 | 3 | for r = 1:numel(rec) 4 | for o = 1:numel(rec(r).objects) 5 | if rec(r).objects(o).detailedannotation && ... 6 | (strcmpi(rec(r).objects(o).class, cls) || strcmpi(cls, 'all')) 7 | details = rec(r).objects(o).details; 8 | im = imread(fullfile(imdir, rec(r).filename)); 9 | figure(1), hold off, imshow(im) 10 | bbox = rec(r).objects(o).bbox; 11 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'r', 'linewidth', 3); 12 | 13 | fprintf('%s: %d %d\n', rec(r).objects(o).class, r, o); 14 | fprintf('Occlusion: %d\n', details.occ_level); 15 | fprintf('Area: %d\n', details.bbox_area); 16 | fprintf('Aspect Ratio: %0.2f\n', details.bbox_aspectratio); 17 | fprintf('Parts Visible: \n'); 18 | pnames = fieldnames(details.part_visible); 19 | for p = 1:numel(pnames) 20 | fprintf(' %s: %d \n', pnames{p}, details.part_visible.(pnames{p})); 21 | end 22 | snames = fieldnames(details.side_visible); 23 | for p = 1:numel(snames) 24 | fprintf(' %s: %d \n', snames{p}, details.side_visible.(snames{p})); 25 | end 26 | fprintf('\n'); 27 | pause; 28 | end 29 | end 30 | end -------------------------------------------------------------------------------- /src/displayFPTrend.m: -------------------------------------------------------------------------------- 1 | function displayFPTrend(result, nfp, titlestr) 2 | % displayFPTrend(result, nfp) 3 | % 4 | % Displays stacked area plots showing trend of false positives with rank 5 | 6 | nsim = getCumulativeCount({result.issim}); 7 | nbg = getCumulativeCount({result.isbg_notobj}); 8 | nloc = getCumulativeCount({result.isloc}); 9 | noth = getCumulativeCount({result.isother}); 10 | ntotal = nsim+nbg+nloc+nbg+noth; 11 | 12 | nsim = getFpCounts(nsim, ntotal, nfp); 13 | nbg = getFpCounts(nbg, ntotal, nfp); 14 | nloc = getFpCounts(nloc, ntotal, nfp); 15 | noth = getFpCounts(noth, ntotal, nfp); 16 | 17 | ntotal = nsim+nbg+nloc+noth; 18 | 19 | figure(3), hold off 20 | area(1:numel(nfp), [nloc(:) nsim(:) noth(:) nbg(:)] ./ repmat(ntotal(:), [1 4]) * 100); 21 | set(gca, 'xtick', 1:numel(nfp)); 22 | set(gca, 'xticklabel', num2cell(nfp)) 23 | set(gca,'Layer','top') 24 | colormap([[79 129 189]/255 ; [192 80 77]/255 ; [77 192 80]/255*1.2 ; [128 100 162]/255]); 25 | set(gca, 'fontsize', 16); 26 | axis([1 numel(nfp) 0 100]) 27 | legend({'Loc', 'Sim', 'Oth', 'BG'}) 28 | title(titlestr); 29 | xlabel('total false positives') 30 | ylabel('percentage of each type') 31 | 32 | 33 | figure(4), 34 | set(gcf, 'DefaultAxesColorOrder', [[79 129 189]/255 ; [192 80 77]/255 ; [77 192 80]/255*1.2 ; [128 100 162]/255]); 35 | plot(1:numel(nfp), [nloc(:) nsim(:) noth(:) nbg(:)] ./ repmat(ntotal(:), [1 4])*100, 'linewidth', 3); 36 | set(gca, 'xtick', 1:numel(nfp)); 37 | set(gca, 'xticklabel', num2cell(nfp)) 38 | set(gca, 'fontsize', 16); 39 | axis([1 numel(nfp) 0 100]) 40 | legend({'Loc', 'Sim', 'Oth', 'BG'}) 41 | title(titlestr); 42 | xlabel('total false positives') 43 | ylabel('percentage of each type') 44 | 45 | figure(5), 46 | set(gcf, 'DefaultAxesColorOrder', [[192 80 77]/255 ; [77 192 80]/255*1.2 ; [128 100 162]/255]); 47 | plot(1:numel(nfp), [nsim(:) noth(:) nbg(:)] ./ repmat(ntotal(:)-nloc(:), [1 3])*100, 'linewidth', 3); 48 | set(gca, 'xtick', 1:numel(nfp)); 49 | set(gca, 'xticklabel', num2cell(nfp)) 50 | %colormap([[192 80 77]/255 ; [77 192 80]/255*1.2 ; [128 100 162]/255]); 51 | set(gca, 'fontsize', 16); 52 | axis([1 numel(nfp) 0 100]) 53 | legend({'Sim', 'Oth', 'BG'}) 54 | title(titlestr); 55 | xlabel('total false positives') 56 | ylabel('pctg of each type (excluding loc)') 57 | 58 | 59 | function count = getCumulativeCount(n) 60 | count = n{1}; 61 | for k = 2:numel(n) 62 | if numel(n{k})>numel(count) 63 | tmp = count; 64 | count = n{k}; 65 | count(1:numel(tmp)) = count(1:numel(tmp))+tmp; 66 | else 67 | count(1:numel(n{k})) = count(1:numel(n{k})) + n{k}; 68 | end 69 | end 70 | count = cumsum(count); 71 | 72 | function count = getFpCounts(tmpc, total, nfp) 73 | count = zeros(size(nfp)); 74 | t = 1; 75 | for k = 1:numel(tmpc) 76 | while t<=numel(nfp) && nfp(t)<=total(k) 77 | count(t) = tmpc(k); 78 | t = t+1; 79 | end 80 | if t > numel(nfp) 81 | break; 82 | end 83 | end -------------------------------------------------------------------------------- /src/displayFalsePositiveImpactPlot.m: -------------------------------------------------------------------------------- 1 | function displayFalsePositiveImpactPlot(resultfp, titlename_bar, titlename_pie) 2 | 3 | close all 4 | 5 | %% Impact Bar Chart 6 | 7 | fs = 16; 8 | xticklab = {'L', 'S', 'B', 'LS', 'LB', 'SB'}; 9 | 10 | figure(1), hold off; 11 | 12 | tmp = [resultfp.all]; 13 | AP = mean([tmp.ap]); 14 | 15 | R = 0; 16 | for k = 1:numel(resultfp) 17 | R = R+tmp(k).r(end)/numel(resultfp); 18 | end 19 | 20 | tmp = [resultfp.ignoreloc]; 21 | L = mean([tmp.ap]); 22 | tmp = [resultfp.ignoresimilar]; 23 | S = mean([tmp.ap]); 24 | tmp = [resultfp.ignorebg]; 25 | B = mean([tmp.ap]); 26 | tmp = [resultfp.fixloc]; 27 | Lfix = mean([tmp.ap]); 28 | tmp = [resultfp.onlyloc]; 29 | SB = mean([tmp.ap]); 30 | tmp = [resultfp.onlysimilar]; 31 | LB = mean([tmp.ap]); 32 | tmp = [resultfp.onlybg]; 33 | LS = mean([tmp.ap]); 34 | 35 | 36 | %plot([1 3], [AP AP], 'k--', 'linewidth', 1); 37 | 38 | hold on 39 | 40 | barh(3, max(Lfix-AP,0), 'FaceColor', [79 129 189]/255); 41 | barh(3, max(L-AP,0), 'FaceColor', [79 129 189]/255*0.8); 42 | barh(2, max(S-AP,0), 'FaceColor', [192 80 77]/255); 43 | barh(1, max(B-AP,0), 'FaceColor', [128 100 162]/255); 44 | 45 | xlim = [0 ceil((max([Lfix L S B]-AP)+0.005)*20)/20]; 46 | set(gca, 'xlim', xlim); 47 | %set(gca, 'xtick', 0:0.05:xlim(2)); 48 | set(gca, 'xminortick', 'on'); 49 | set(gca, 'ticklength', get(gca, 'ticklength')*4); 50 | 51 | set(gca, 'ytick', 1:3) 52 | set(gca, 'yticklabel', {'B', 'S', 'L'}); 53 | set(gca, 'fontsize', fs); 54 | 55 | title(titlename_bar) 56 | 57 | 58 | %% FP Count Pie Chart 59 | 60 | figure(2), hold off; 61 | 62 | 63 | tmp =[resultfp.confuse_count]; 64 | total = sum(cat(1, tmp.total)); 65 | N = numel(total); 66 | total = total(N); 67 | 68 | correct = sum(cat(1, tmp.correct)); 69 | correct = correct(N)/total; 70 | 71 | sim = sum(cat(1, tmp.similarobj)); 72 | sim = sim(N)/total; 73 | 74 | oth = sum(cat(1, tmp.otherobj)); 75 | oth = oth(N)/total; 76 | 77 | loc = sum(cat(1, tmp.loc)); 78 | loc = loc(N)/total; 79 | 80 | bg = sum(cat(1, tmp.bg)); 81 | bg = bg(N)/total; 82 | 83 | 84 | pie([correct loc sim oth bg], ... 85 | {['Cor: ' num2str(round(correct*100)) '%'], ... 86 | ['Loc: ' num2str(round(loc*100)) '%'], ... 87 | ['Sim: ' num2str(round(sim*100)) '%'], ... 88 | ['Oth: ' num2str(round(oth*100)) '%'], ... 89 | ['BG: ' num2str(round(bg*100)) '%']}); %, 'fontsize', fs+16, 'fontweight', 'bold'); 90 | title(titlename_pie, 'fontsize', 12, 'fontweight', 'bold') 91 | 92 | 93 | % barh(3, max(Lfix-AP,0), 'FaceColor', [79 129 189]/255); 94 | % barh(3, max(L-AP,0), 'FaceColor', [79 129 189]/255*0.8); 95 | % barh(2, max(S-AP,0), 'FaceColor', [192 80 77]/255); 96 | % barh(1, max(B-AP,0), 'FaceColor', [128 100 162]/255); 97 | 98 | colormap([1 1 1 ; [79 129 189]/255 ; [192 80 77]/255 ; [77 192 80]/255*1.2 ; [128 100 162]/255]); 99 | 100 | % 101 | % tmp = 102 | % L = mean([tmp.ap]); 103 | % tmp = [resultfp.ignoresimilar]; 104 | % S = mean([tmp.ap]); 105 | % tmp = [resultfp.ignorebg]; 106 | % B = mean([tmp.ap]); 107 | % tmp = [resultfp.fixloc]; 108 | % Lfix = mean([tmp.ap]); 109 | % tmp = [resultfp.onlyloc]; 110 | % SB = mean([tmp.ap]); 111 | % tmp = [resultfp.onlysimilar]; 112 | % LB = mean([tmp.ap]); 113 | % tmp = [resultfp.onlybg]; 114 | % LS = mean([tmp.ap]); 115 | % 116 | % for k = numel(resultfp(1).confuse_count.total) %only writing out last case 117 | % for o = 1:numel(result) 118 | % count = resultfp(o).confuse_count; 119 | % name = repmat(' ', [1 15]); name(1:numel(result(o).name)) = upper(result(o).name); 120 | % total = count.total(k) - count.correct(k); 121 | % nfp(o, 1:5) = [total [count.loc(k) count.similarobj(k) count.otherobj(k) count.bg(k)]./total]; 122 | % fprintf(fid, ['%s\t%d\t' repmat('%0.3f\t', [1 4]) '\n'], name, nfp(o, 1), nfp(o, 2:end)); 123 | % end 124 | % fprintf(fid, ['%s \t%d\t' repmat('%0.3f\t', [1 4]) '\n'], 'animals', round(mean(nfp(animals, 1))), mean(nfp(animals, 2:end))); 125 | % fprintf(fid, ['%s \t%d\t' repmat('%0.3f\t', [1 4]) '\n'], 'vehicles', round(mean(nfp(vehicles, 1))), mean(nfp(vehicles, 2:end))); 126 | % fprintf(fid, ['%s \t%d\t' repmat('%0.3f\t', [1 4]) '\n'], 'furniture', round(mean(nfp(furniture, 1))), mean(nfp(furniture, 2:end))); 127 | % 128 | % fprintf(fid, [repmat(' ', [1 15]) repmat('%s\t', [1 numel(allnames)]) '\n'], allnames{:}); 129 | % for o = 1:numel(result) 130 | % count = result(o).confuse_count; 131 | % total = count.total(k) - count.correct(k); 132 | % name = repmat(' ', [1 15]); name(1:numel(result(o).name)) = upper(result(o).name); 133 | % fprintf(fid, ['%s\t' repmat('%0.3f\t', [1 numel(count.object(:, k))]) '\n'], name, count.object(:, k)'./total); 134 | % end 135 | % 136 | % end 137 | 138 | 139 | % bar(1, L, 'r'); 140 | % bar(2, S, 'g'); 141 | % bar(3, B, 'b'); 142 | % 143 | % bar(4, LS, 'y'); 144 | % bar(5, LB, 'm'); 145 | % bar(6, SB, 'c'); 146 | 147 | %plot([1 3], [R R], 'k-', 'linewidth', 1); 148 | 149 | % axis([0.5 6.5 AP R]); 150 | % 151 | % yticklab = {sprintf('%0.2f', AP), sprintf('%0.2f', R)}; 152 | % set(gca, 'ytick', sort([AP R])); 153 | % set(gca, 'yticklabel', {yticklab{1}(2:end), yticklab{2}(2:end)}); 154 | % set(gca, 'xtick', 1:6); 155 | % set(gca, 'xticklabel', xticklab); 156 | % set(gca, 'fontsize', fs); 157 | % title(titlename) 158 | -------------------------------------------------------------------------------- /src/displayGtConfidencePredictions.m: -------------------------------------------------------------------------------- 1 | function displayGtConfidencePredictions(imdir, rec, result, outdir, N) 2 | % displayGtConfidencePredictions(imdir, rec, gt, outdir) 3 | % 4 | % Sorts objects by their normalized precision, minus the average of the 5 | % average normalized precision for their characteristics. For example, a 6 | % medium-sized side-view of an airplane is likely to have a high APn. 7 | % 8 | % Input: 9 | % imdir: the directory of images 10 | % rec: the PASCAL annotations structure 11 | % result: output of the analyzeTrueDetections function 12 | 13 | for o = 1:numel(result) 14 | gt = result(o).gt; 15 | pn = gt.pn; 16 | 17 | predpn = zeros(size(pn)); 18 | 19 | attributes = zeros(gt.N, 4); 20 | keep = true(gt.N, 1); 21 | for k = 1:gt.N 22 | if rec(gt.rnum(k)).objects(gt.onum(k)).difficult, 23 | keep(k) = false; 24 | continue; 25 | end; 26 | attributes(k, :) = [result(o).occ(gt.occ_level(k)).apn ... 27 | result(o).truncated(gt.truncated(k)+1).apn ... 28 | result(o).area(gt.area(k)).apn ... 29 | result(o).aspect(gt.aspect(k)).apn]; 30 | end 31 | 32 | keep = find(keep); 33 | 34 | if 0 35 | %attributes = gt2attributes(gt); 36 | attributes(:, end+1) = ones(gt.N, 1); 37 | keep = find(~gt.isdiff & (pn>0)); 38 | 39 | lambda = 0.05; 40 | 41 | w = robust_lsqfit(attributes(keep(2:2:end), :), pn(keep(2:2:end)), lambda); 42 | disp(num2str(w')) 43 | predpn = attributes*w; 44 | predpn = min(max(predpn, 0), 1); 45 | 46 | else 47 | attributes = gt2attributes(gt); 48 | %w = robustfit(attributes(keep, :), pn(keep)); 49 | w = regress(pn(keep), [ones(numel(keep), 1) attributes(keep, :)]); 50 | disp(num2str(w(2:end)')) 51 | predpn = attributes*w(2:end)+w(1); 52 | predpn = min(max(predpn, 0), 1); 53 | end 54 | diffpn = predpn-pn; 55 | [sv, si] = sort(diffpn, 'descend'); 56 | %si = keep(1:end)'; 57 | 58 | for k = keep(:)' 59 | 60 | if exist('N', 'var') && ~isempty(N) 61 | if find(keep==k)>N 62 | break; 63 | end 64 | end 65 | 66 | if rec(gt.rnum(si(k))).objects(gt.onum(si(k))).difficult, continue; end; 67 | im = imread(fullfile(imdir, rec(gt.rnum(si(k))).filename)); 68 | bbox = rec(gt.rnum(si(k))).objects(gt.onum(si(k))).bbox; 69 | figure(1), hold off, imagesc(im); axis image, axis off; 70 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'r', 'linewidth', 3); 71 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'k-', 'linewidth', 1); 72 | bboxgt = bbox; 73 | 74 | if 1 || all(gt.bbox_conf(si(k), :)==0) 75 | bbox = gt.bbox_ov(si(k), :); 76 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'b--', 'linewidth', 3); 77 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'k--', 'linewidth', 1); 78 | text(bbox(1)+3, bbox(2), sprintf('%0.3f',gt.pn_ov(si(k))), 'backgroundcolor', [1 1 1], 'fontsize', 10); 79 | end 80 | %title(sprintf('%s: pred=%0.3f, actual=%0.3f, bestov=%0.3f', result(o).name, predpn(si(k)), pn(si(k)), gt.pn_ov(si(k)))); 81 | 82 | bbox = gt.bbox_conf(si(k), :); 83 | if ~all(bbox==0) 84 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'g-', 'linewidth', 3); 85 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'k-', 'linewidth', 1); 86 | text(bbox(1)+3, bbox(2), sprintf('%0.3f',pn(si(k))), 'backgroundcolor', [1 1 1], 'fontsize', 10); 87 | end 88 | 89 | text(bboxgt(3)-30, bboxgt(2), sprintf('%0.3f',predpn(si(k))), 'backgroundcolor', [1 1 1], 'fontsize', 10, 'fontangle', 'italic'); 90 | 91 | if exist('outdir', 'var') && ~isempty(outdir) 92 | numstr = num2str(k+10000); 93 | print('-f1', '-dpdf', fullfile(outdir, [result(o).name '_tp_' numstr(2:end) '.pdf'])); 94 | else 95 | pause; 96 | end 97 | end 98 | end 99 | 100 | %% Get binary attributes of object 101 | function att = gt2attributes(gt) 102 | 103 | att = []; 104 | fnames = {'area', 'aspect', 'occ_level', 'truncated'}; %, 'occ_level', 'truncated', 'part', 'side'}; % 'height'}; 105 | for f = 1:numel(fnames) 106 | if ~isstruct(gt.(fnames{f})) 107 | na = max(gt.(fnames{f})); 108 | att(:, end+(1:na)) = repmat(gt.(fnames{f})(:), [1 na])==repmat(1:na, [gt.N 1]); 109 | else 110 | fnames2 = fieldnames(gt.(fnames{f})); 111 | for k = 1:numel(fnames2) 112 | na = max(gt.(fnames{f}).(fnames2{k})); 113 | att(:, end+(1:na)) = repmat(gt.(fnames{f}).(fnames2{k})(:), [1 na])==repmat(1:na, [gt.N 1]); 114 | end 115 | end 116 | end 117 | %att = att - repmat(mean(att, 1), [gt.N 1]); 118 | %att = att ./ repmat(std(att, 1), [gt.N 1]); 119 | 120 | %% Robust least squares fit 121 | function w = robust_lsqfit(x, y, lambda) 122 | % find weih 123 | w = zeros(size(x, 2), 1); 124 | sigma = 0.01; 125 | warning off; 126 | for k = 1:5 127 | w = fminunc(@(w)regresscost(w, x, y, sigma,lambda), w); 128 | pred = x*w; 129 | %pred = min(max(x*w,0),1); 130 | err = sqrt((y-pred).^2); 131 | sigma = median(err)*1.5; 132 | end 133 | 134 | 135 | function err = regresscost(w, x, y, sigma, lambda) 136 | %pred = min(max(x*w,0),1); 137 | pred = x*w; 138 | err = (y-pred).^2; 139 | err = sum(err ./ (err + sigma.^2)); 140 | err = err + sum(abs(w))*lambda; 141 | -------------------------------------------------------------------------------- /src/displayPerCharacteristicPlots.m: -------------------------------------------------------------------------------- 1 | function displayPerCharacteristicPlots(results_all, titlename) 2 | 3 | close all 4 | 5 | drawline = true; 6 | makeMultiCategoryPlot(1, results_all, 'occ', [titlename ': Occlusion'], 1, {'N', 'L', 'M', 'H'}, drawline); 7 | makeMultiCategoryPlot(2, results_all, 'area', [titlename ': BBox Area'], 1, {'XS', 'S', 'M', 'L', 'XL'}, drawline); 8 | makeMultiCategoryPlot(3, results_all, 'height', [titlename ': BBox Height'], 1, {'XS', 'S', 'M', 'L', 'XL'}, drawline); 9 | makeMultiCategoryPlot(4, results_all, 'aspect', [titlename ': Aspect Ratio'], 1, {'XT', 'T', 'M', 'W', 'XW'}, drawline); 10 | makeMultiCategoryPlot(5, results_all, 'truncated', [titlename ': Truncation'], 1, {'N', 'T'}, drawline); 11 | f=5; 12 | 13 | fs = 8; 14 | 15 | % Visible parts 16 | f=f+1; 17 | tickstr = {}; 18 | np=0; 19 | 20 | for o = 1:numel(results_all) 21 | if isfield(results_all(o), 'part') 22 | pnames = fieldnames(results_all(o).part); 23 | for p = 1:numel(pnames) 24 | np=np+1; 25 | results_all(o).tmp((p-1)*2+(1:2)) = results_all(o).part.(pnames{p}); 26 | %tickstr(end+1) = {sprintf('%s\non/off', pnames{p})}; 27 | end 28 | end 29 | end 30 | drawline = false; 31 | makeMultiCategoryPlot(f, results_all, 'tmp', [titlename ': Parts Visible'], 1, tickstr, drawline); 32 | axisval = axis; 33 | n=0; 34 | for o = 1:numel(results_all) 35 | if isfield(results_all(o), 'part') 36 | pnames = fieldnames(results_all(o).part); 37 | n=n+1; 38 | for p = 1:numel(pnames) 39 | name = pnames{p}; if numel(name)>5, name = removeVowels(name); end; 40 | text(n+1, -0.071*axisval(4), sprintf('%s\n0/1', name), 'fontsize', fs); 41 | n = n+2; 42 | end 43 | end 44 | end 45 | if isfield(results_all, 'tmp') 46 | results_all = rmfield(results_all, 'tmp'); 47 | end 48 | 49 | % Visible sides 50 | f=f+1; 51 | tickstr = {}; 52 | np=0; 53 | for o = 1:numel(results_all) 54 | if isfield(results_all(o), 'side') 55 | pnames = fieldnames(results_all(o).side); 56 | for p = 1:numel(pnames) 57 | np=np+1; 58 | results_all(o).tmp((p-1)*2+(1:2)) = results_all(o).side.(pnames{p}); 59 | %tickstr(end+1) = {sprintf('%s\non/off', pnames{p})}; 60 | end 61 | end 62 | end 63 | drawline = false; 64 | makeMultiCategoryPlot(f, results_all, 'tmp', [titlename ': Sides Visible'], 1, tickstr, drawline); 65 | axisval = axis; 66 | n=0; 67 | for o = 1:numel(results_all) 68 | if isfield(results_all(o), 'side') 69 | pnames = fieldnames(results_all(o).side); 70 | n=n+1; 71 | for p = 1:numel(pnames) 72 | name = pnames{p}; if numel(name)>5, name = removeVowels(name); end; 73 | text(n+1, -0.071*axisval(4), sprintf('%s\n0/1', name), 'fontsize', fs); 74 | n = n+2; 75 | end 76 | end 77 | end 78 | if isfield(results_all, 'tmp') 79 | results_all = rmfield(results_all, 'tmp'); 80 | end 81 | 82 | 83 | 84 | function makeMultiCategoryPlot(f, results, rname, title_str, xtickstep, xticklab, drawline) 85 | 86 | fs = 10; 87 | setupplot(f); 88 | 89 | if ~isfield(results(1), rname) || any(isnan([results(1).(rname).apn])) 90 | return; 91 | end 92 | 93 | nobj = numel(results); 94 | 95 | rangex = 0; 96 | maxy = 0; 97 | xticks = []; 98 | firsttick = zeros(nobj,1); 99 | for o = 1:nobj 100 | result = results(o); 101 | nres = numel(results(o).(rname)); 102 | rangex = rangex(end)+1+(1:nres); 103 | plotapnbars(result.(rname), rangex, drawline); 104 | maxy = max(maxy, round(max(([result.(rname).apn]+0.15))*10)/10); 105 | h=plot(rangex([1 end]), [1 1]*result.all.apn, 'k--', 'linewidth', 1); 106 | firsttick(o) = rangex(1); 107 | xticks = [xticks rangex(1:xtickstep:end)]; 108 | end 109 | maxy = min(maxy, 1); 110 | if numel(xticklab)==nres 111 | xticklab = repmat(xticklab, [1 nobj]); 112 | end 113 | axis([0 rangex(end)+1 0 maxy]); 114 | for o = 1:numel(results) 115 | if strcmp(results(o).name, 'diningtable') 116 | results(o).name = 'table'; 117 | elseif strcmp(results(o).name, 'aeroplane') 118 | results(o).name = 'airplane'; 119 | end 120 | text(firsttick(o), maxy-0.05, results(o).name, 'fontsize', fs); 121 | end 122 | title(title_str, 'fontsize', fs); 123 | set(gca, 'xtick', xticks); 124 | %set(gca, 'ytick', 0:0.1:maxy); 125 | set(gca, 'xticklabel', xticklab); 126 | set(gca, 'ygrid', 'on') 127 | set(gca, 'xgrid', 'on') 128 | set(gca, 'fontsize', fs); 129 | set(gca, 'ticklength', [0.001 0.001]); 130 | 131 | 132 | function plotapnbars(resall, x, drawline) 133 | for k = 1:numel(resall) 134 | res =resall(k); 135 | if isnan(res.apn), res.apn = 0; end 136 | if ~isnan(res.apn_stderr) 137 | errorbar(x(k), res.apn, res.apn_stderr, 'r', 'linewidth', 1); 138 | end 139 | hold on; 140 | plot(x(k), res.apn, '+', 'linewidth', 1, 'markersize', 5); 141 | text(x(k)+0.12, res.apn, sprintf('%0.2f', res.apn), 'fontsize', 8); 142 | end 143 | if drawline 144 | plot(x, [resall.apn], 'b-', 'linewidth', 1); 145 | else % draw every other 146 | for i=1:2:numel(x) 147 | plot(x([i i+1]), [resall([i i+1]).apn], 'b-', 'linewidth', 1); 148 | end 149 | end 150 | %axis([0 x(end+1) numel(resall)+1 0 ceil(max([resall.apn]+[resall.apn_stderr]+0.1)*10)/10]) 151 | 152 | function str = removeVowels(str) 153 | for v = 'aeiou' 154 | str(str==v) = []; 155 | end 156 | 157 | 158 | function setupplot(f) 159 | figure(f), hold off 160 | -------------------------------------------------------------------------------- /src/displayRankedPositives.m: -------------------------------------------------------------------------------- 1 | function displayRankedPositives(imdir, rec, result) 2 | % displayRankedPositives(imdir, rec, gt) 3 | % 4 | % Sorts objects within a subset (defined by parameters within the code) 5 | % according to their normalized precision and display 6 | % 7 | % Input: 8 | % imdir: the directory of images 9 | % rec: the PASCAL annotations structure 10 | % result: output of the analyzeTrueDetections function 11 | 12 | % Sets which subset of positive examples to consider 13 | occ_range = (0:4); 14 | area_range = 5; 15 | truncated_range = (0:1); 16 | aspect_range = (0:5); 17 | difficult_range = 0; 18 | 19 | for o = 1:numel(result) 20 | gt = result(o).gt; 21 | pn = gt.pn; 22 | 23 | keep = true(gt.N, 1); 24 | for k = 1:gt.N 25 | keep(k) = any(gt.isdiff(k)==difficult_range) & any(gt.occ_level(k)==occ_range) & ... 26 | any(gt.truncated(k)==truncated_range) & any(gt.area(k)==area_range) & ... 27 | any(gt.aspect(k)==aspect_range); 28 | end 29 | 30 | disp([result.name ' ' num2str(mean(pn(keep)))]) 31 | [sv, si] = sort(pn, 'descend'); 32 | 33 | for k = 1:gt.N 34 | i = si(k); 35 | if ~keep(i), continue; end; 36 | im = imread(fullfile(imdir, rec(gt.rnum(si(k))).filename)); 37 | bbox = rec(gt.rnum(si(k))).objects(gt.onum(si(k))).bbox; 38 | figure(1), hold off, imagesc(im); axis image, axis off; 39 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'r', 'linewidth', 3); 40 | 41 | bbox = gt.bbox_ov(si(k), :); 42 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'b-', 'linewidth', 3); 43 | text(bbox(1)+3, bbox(2)+15, sprintf('%0.3f',gt.pn_ov(si(k))), 'backgroundcolor', [1 1 1], 'fontsize', 10); 44 | %title(sprintf('%s: pred=%0.3f, actual=%0.3f, bestov=%0.3f', result(o).name, predpn(si(k)), pn(si(k)), gt.pn_ov(si(k)))); 45 | 46 | bbox = gt.bbox_conf(si(k), :); 47 | if ~all(bbox==0) 48 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'g--', 'linewidth', 3); 49 | text(bbox(1)+3, bbox(2)+15, sprintf('%0.3f',pn(si(k))), 'backgroundcolor', [1 1 1], 'fontsize', 10); 50 | end 51 | pause; 52 | end 53 | end 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/displayTopFP.m: -------------------------------------------------------------------------------- 1 | function displayTopFP(dataset, dataset_params, ann, objname, result, det, outdir, N) 2 | % displayTopFP(imdir, rec, result, det, gt, outdir, N) 3 | % 4 | % Displays N of the top false positives. Images are saved if outdir is 5 | % set. Otherwise, pause is called after each image. 6 | 7 | switch lower(dataset) 8 | case 'voc' 9 | displayTopFP_VOC(dataset, dataset_params, ann, objname, result, det, outdir, N); 10 | otherwise 11 | error('unknown datset: %s', dataset); 12 | end 13 | 14 | function displayTopFP_VOC(dataset, dataset_params, ann, objname, result, det, outdir, N) 15 | 16 | rec = ann.rec; 17 | 18 | close all 19 | for o = 1:numel(result) 20 | 21 | [sv, si] = sort(det(o).conf, 'descend'); 22 | det(o).conf = det(o).conf(si); 23 | det(o).rnum = det(o).rnum(si); 24 | det(o).bbox = det(o).bbox(si, :); 25 | 26 | det2 = matchDetectionsWithGroundTruth(dataset, dataset_params, objname, ann, det, 'strong'); 27 | 28 | pi = result(o).all.pi; 29 | recall = result(o).all.r; 30 | 31 | isbg = result(o).isbg & ~result(o).isother; 32 | isoth = result(o).isother; 33 | isloc = result(o).isloc; 34 | issim = result(o).issim; 35 | indfp = find(isbg | isloc | issim | isoth); 36 | 37 | %[sv, si] = sort(pi(indfp), 'descend'); 38 | %indfp = indfp(si); 39 | 40 | for k = 1:numel(indfp) 41 | 42 | if exist('N', 'var') && ~isempty(N) 43 | if k>N 44 | break; 45 | end 46 | end 47 | 48 | 49 | i = indfp(k); 50 | 51 | im = imread(fullfile(dataset_params.imdir, rec(det(o).rnum(i)).filename)); 52 | bbox = round(det(o).bbox(i, :)); 53 | 54 | figure(1), hold off, imagesc(im); axis image, axis off; 55 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'g-', 'linewidth', 4.5); 56 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'k-', 'linewidth', 1.5); 57 | 58 | typestr = ''; 59 | if isbg(i), typestr = 'bg'; end 60 | if issim(i), typestr = 'sim'; end 61 | if isloc(i), typestr = 'loc'; end 62 | if isoth(i), typestr = 'oth'; end 63 | 64 | [imh, imw, imb] = size(im); 65 | text(1, imh-11, sprintf('%s (%s): ov=%0.2f 1-r=%0.2f',result(o).name, typestr, det2.ov(i), 1-recall(i)), 'backgroundcolor', [1 1 1], 'fontsize', 22); 66 | 67 | if exist('outdir', 'var') && ~isempty(outdir) 68 | numstr = num2str(k+10000); 69 | print('-f1', '-dpdf', fullfile(outdir, [result(o).name '_fp_' numstr(2:end) '.pdf'])); 70 | imwrite(im(bbox(2):bbox(4), bbox(1):bbox(3), :), fullfile(outdir, [result(o).name '_fpwindow_' typestr '_' numstr(2:end) '.jpg'])); 71 | else 72 | pause; 73 | end 74 | end 75 | end -------------------------------------------------------------------------------- /src/matchDetectionsWithGroundTruth.m: -------------------------------------------------------------------------------- 1 | function [det, gt] = matchDetectionsWithGroundTruth(dataset, dataset_params, objname, ann, det, localization) 2 | % [det, gt] = matchDetectionsWithGroundTruth(dataset, dataset_params, objname, ann, det, localization) 3 | % 4 | % Determines which detections are correct based on dataset and localization 5 | % criteria. See matchDetectionsWithGroundTruth_VOC documentation (below) for 6 | % details. 7 | % 8 | 9 | switch lower(dataset) 10 | case {'voc', 'voc_compatible'} 11 | o = strcmp(dataset_params.objnames_all, objname); 12 | gt = ann.gt(o); 13 | [det, gt] = matchDetectionsWithGroundTruth_VOC(dataset_params, gt, det, localization); 14 | otherwise 15 | error('unknown dataset: %s', dataset); 16 | end 17 | 18 | 19 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 | function [det, gt] = matchDetectionsWithGroundTruth_VOC(dataset_params, gt, det, localization) 21 | % [det, gt] = matchDetectionsWithGroundTruth_VOC(dataset_params, det, gt, localization) 22 | % 23 | % Returns the intersection over union, intersection/object, and 24 | % intersection/gt areas and index of closest ground truth for each 25 | % detection 26 | % 27 | % Input: 28 | % Dataset parameters: 29 | % dataset_params.(iuthresh_weak, idthresh_weak, iuthresh_strong, idthresh_strong) 30 | % Ground truth anntoations: 31 | % gt.(bbox, rnum, isdiff) 32 | % Object detection results: 33 | % det.(bbox, conf, rnum) 34 | % Localization criteria: 'weak' or 'strong' 35 | % 36 | % Output 37 | % Adds to the input det struct: 38 | % the index of best-matching ground truth (gtnum), the corresponding 39 | % overlap measures, the label (1=true, 0=difficult, -1=false), and whether 40 | % the detection is a duplicate (label=-1 in this case) 41 | % det.(bbox, conf, rnum, gtnum, isdiff, ov, ov_obj, ov_gt, label, isduplicate) 42 | % Adds to the input gt struct: 43 | % (1) index (detnum) of highest scoring detection with ov>ovthresh; 44 | % (2) index (detnum_ov) of maximum overlap detection 45 | % (3) the overlaps with the detection of maximum overlap (ov, ov_obj, 46 | % ov_gt), which may not be the same detection 47 | % gt.(bbox, rnum, isdiff, detnum): 48 | 49 | 50 | switch localization 51 | case 'weak' % also duplicate detections are ignored, per last line 52 | iuthresh = dataset_params.iuthresh_weak; % intersection/union threshold 53 | idthresh = dataset_params.idthresh_weak; % intersection/det_area threshold 54 | case 'strong' 55 | iuthresh = dataset_params.iuthresh_strong; 56 | idthresh = dataset_params.idthresh_strong; 57 | otherwise 58 | error('invalid localization criterion: %s', localization) 59 | end 60 | 61 | 62 | Ngt = size(gt.bbox, 1); 63 | gt.detnum = zeros(Ngt, 1); 64 | gt.detnum_ov = zeros(Ngt, 1); 65 | gt.ov = zeros(Ngt, 1); 66 | gt.ov_obj = zeros(Ngt, 1); 67 | gt.ov_gt = zeros(Ngt, 1); 68 | 69 | 70 | Nd = size(det.bbox, 1); 71 | det.gtnum = zeros(Nd, 1); 72 | det.ov = zeros(Nd, 1); 73 | det.ov_obj = zeros(Nd, 1); 74 | det.ov_gt = zeros(Nd, 1); 75 | det.isdiff = zeros(Nd, 1); 76 | det.label = -ones(Nd, 1); 77 | det.isduplicate = false(Nd, 1); 78 | 79 | isdetected = zeros(Ngt, 1); 80 | [sv, si] = sort(det.conf, 'descend'); 81 | 82 | for dtmp = 1:Nd 83 | 84 | d = si(dtmp); 85 | 86 | indgt = find(gt.rnum == det.rnum(d)); 87 | 88 | if isempty(indgt), continue; end 89 | 90 | bbgt = gt.bbox(indgt, [1 3 2 4]); % ground truth in same image 91 | box = det.bbox(d, [1 3 2 4]); % detection window 92 | 93 | bi=[max(box(1),bbgt(:, 1)) max(box(3),bbgt(:, 3)) ... 94 | min(box(2),bbgt(:, 2)) min(box(4),bbgt(:, 4))]; 95 | 96 | iw=bi(:, 3)-bi(:, 1)+1; 97 | ih=bi(:, 4)-bi(:, 2)+1; 98 | 99 | ind = find(iw >0 & ih > 0); % others have no intersection 100 | if ~isempty(ind) 101 | gtarea = (bbgt(ind, 2)-bbgt(ind, 1)+1).*(bbgt(ind, 4)-bbgt(ind, 3)+1); 102 | detarea = (box(2)-box(1)+1)*(box(4)-box(3)+1); 103 | intersectArea = iw(ind).*ih(ind); 104 | unionArea =gtarea + detarea - intersectArea; 105 | 106 | i = find(((intersectArea ./ unionArea) >= iuthresh) & ... 107 | ((intersectArea ./ detarea) >= idthresh)... 108 | & (~isdetected(indgt(ind)))); 109 | if ~isempty(i) % correct detection 110 | [det.ov(d), i] = max((intersectArea ./ unionArea) .* (~isdetected(indgt(ind)))); 111 | gti = indgt(ind(i)); 112 | if gt.isdiff(gti) 113 | det.label(d) = 0; 114 | det.isdiff(d) = 1; 115 | else 116 | det.label(d) = 1; 117 | end 118 | gt.detnum(gti) = d; 119 | isdetected(gti) = 1; 120 | else % no correct detection, or extra detection 121 | [det.ov(d), i] = max(intersectArea ./ unionArea); 122 | gti = indgt(ind(i)); 123 | if det.ov(d)>=iuthresh && ((intersectArea(i) ./ detarea) >= idthresh) 124 | det.isduplicate(d) = true; 125 | end 126 | end 127 | 128 | det.ov_obj(d) = intersectArea(i) ./ detarea; 129 | det.ov_gt(d) = intersectArea(i) ./ gtarea(i); 130 | det.gtnum(d) = gti; 131 | 132 | if det.ov(d) > gt.ov(gti) 133 | gt.ov(gti) = det.ov(d); 134 | gt.ov_obj(gti) = intersectArea(i) ./ detarea; 135 | gt.ov_gt(gti) = intersectArea(i) ./ gtarea(i); 136 | gt.detnum_ov(gti) = d; 137 | end 138 | 139 | end 140 | end 141 | 142 | if strcmp(localization, 'weak') 143 | det.label(det.isduplicate) = 0; 144 | end -------------------------------------------------------------------------------- /src/pie.m: -------------------------------------------------------------------------------- 1 | function hh = pie(varargin) 2 | %PIE Pie chart. 3 | % PIE(X) draws a pie plot of the data in the vector X. The values in X 4 | % are normalized via X/SUM(X) to determine the area of each slice of pie. 5 | % If SUM(X) <= 1.0, the values in X directly specify the area of the pie 6 | % slices. Only a partial pie will be drawn if SUM(X) < 1. 7 | % 8 | % PIE(X,EXPLODE) is used to specify slices that should be pulled out from 9 | % the pie. The vector EXPLODE must be the same size as X. The slices 10 | % where EXPLODE is non-zero will be pulled out. 11 | % 12 | % PIE(...,LABELS) is used to label each pie slice with cell array LABELS. 13 | % LABELS must be the same size as X and can only contain strings. 14 | % 15 | % PIE(AX,...) plots into AX instead of GCA. 16 | % 17 | % H = PIE(...) returns a vector containing patch and text handles. 18 | % 19 | % Example 20 | % pie([2 4 3 5],{'North','South','East','West'}) 21 | % 22 | % See also PIE3. 23 | 24 | % Clay M. Thompson 3-3-94 25 | % Copyright 1984-2005 The MathWorks, Inc. 26 | % $Revision: 1.16.4.8 $ $Date: 2005/10/28 15:54:38 $ 27 | 28 | % Parse possible Axes input 29 | [cax,args,nargs] = axescheck(varargin{:}); 30 | error(nargchk(1,3,nargs,'struct')); 31 | 32 | x = args{1}(:); % Make sure it is a vector 33 | args = args(2:end); 34 | 35 | nonpositive = (x <= 0); 36 | if all(nonpositive) 37 | error('MATLAB:pie:NoPositiveData',... 38 | 'Must have positive data in the pie chart.'); 39 | end 40 | if any(nonpositive) 41 | warning('MATLAB:pie:NonPositiveData',... 42 | 'Ignoring non-positive data in pie chart.'); 43 | x(nonpositive) = []; 44 | end 45 | xsum = sum(x); 46 | if xsum > 1+sqrt(eps), x = x/xsum; end 47 | 48 | % Look for labels 49 | if nargs>1 && iscell(args{end}) 50 | txtlabels = args{end}; 51 | if any(nonpositive) 52 | txtlabels(nonpositive) = []; 53 | end 54 | args(end) = []; 55 | else 56 | for i=1:length(x) 57 | if x(i)<.01, 58 | txtlabels{i} = '< 1%'; 59 | else 60 | txtlabels{i} = sprintf('%d%%',round(x(i)*100)); 61 | end 62 | end 63 | end 64 | 65 | % Look for explode 66 | if isempty(args), 67 | explode = zeros(size(x)); 68 | else 69 | explode = args{1}; 70 | if any(nonpositive) 71 | explode(nonpositive) = []; 72 | end 73 | end 74 | 75 | explode = explode(:); % Make sure it is a vector 76 | 77 | if length(txtlabels)~=0 && length(x)~=length(txtlabels), 78 | error(id('StringLengthMismatch'),'Cell array of strings must be the same length as X.'); 79 | end 80 | 81 | if length(x) ~= length(explode), 82 | error(id('ExploreLengthMismatch'),'X and EXPLODE must be the same length.'); 83 | end 84 | 85 | cax = newplot(cax); 86 | next = lower(get(cax,'NextPlot')); 87 | hold_state = ishold(cax); 88 | 89 | theta0 = pi/2; 90 | maxpts = 100; 91 | inside = 1; 92 | 93 | h = []; 94 | for i=1:length(x) 95 | n = max(1,ceil(maxpts*x(i))); 96 | r = [0;ones(n+1,1);0]; 97 | theta = theta0 + [0;x(i)*(0:n)'/n;0]*2*pi; 98 | if inside, 99 | [xtext,ytext] = pol2cart(theta0 + x(i)*pi,.5); 100 | else 101 | [xtext,ytext] = pol2cart(theta0 + x(i)*pi,1.2); 102 | end 103 | [xx,yy] = pol2cart(theta,r); 104 | if explode(i), 105 | [xexplode,yexplode] = pol2cart(theta0 + x(i)*pi,.1); 106 | xtext = xtext + xexplode; 107 | ytext = ytext + yexplode; 108 | xx = xx + xexplode; 109 | yy = yy + yexplode; 110 | end 111 | theta0 = max(theta); 112 | h = [h,patch('XData',xx,'YData',yy,'CData',i*ones(size(xx)), ... 113 | 'FaceColor','Flat','parent',cax), ... 114 | text(xtext,ytext,txtlabels{i},... 115 | 'HorizontalAlignment','center','parent',cax, 'Fontsize', 10, 'Fontweight', 'bold')]; 116 | end 117 | 118 | if ~hold_state, 119 | view(cax,2); set(cax,'NextPlot',next); 120 | axis(cax,'equal','off',[-1.2 1.2 -1.2 1.2]) 121 | end 122 | 123 | if nargout>0, hh = h; end 124 | 125 | % Register handles with m-code generator 126 | % if ~isempty(h) 127 | % mcoderegister('Handles',h,'Target',h(1),'Name','pie'); 128 | % end 129 | 130 | function str=id(str) 131 | str = ['MATLAB:pie:' str]; 132 | -------------------------------------------------------------------------------- /src/readDatasetAnnotations.m: -------------------------------------------------------------------------------- 1 | function ann = readDatasetAnnotations(dataset, dataset_params) 2 | % ann = readDatasetAnnotations(dataset, dataset_params) 3 | % 4 | % Dataset-specific function to read and process annotations 5 | 6 | switch lower(dataset) 7 | case 'voc' 8 | outfn = fullfile(dataset_params.annotationdir, ... 9 | sprintf('%s_annotations_%s.mat', dataset_params.VOCset, dataset_params.imset)); 10 | if ~exist(outfn, 'file') 11 | rec = PASreadAllRecords(dataset_params.imset, 'main'); 12 | for o = 1:numel(dataset_params.objnames_extra) 13 | annotationpath = fullfile(dataset_params.annotationdir, 'gt_ved_%s.txt'); 14 | rec = updateRecordAnnotations(rec, annotationpath, dataset_params.objnames_extra{o}); 15 | end 16 | for r = 1:numel(rec) 17 | for n = 1:numel(rec(r).objects) 18 | if isfield(rec(r).objects(n), 'details') && ~isempty(rec(r).objects(n).details) 19 | rec(r).objects(n).detailedannotation = 1; 20 | else 21 | rec(r).objects(n).details = []; 22 | rec(r).objects(n).detailedannotation = 0; 23 | end 24 | end 25 | end 26 | 27 | % processes the annotations into a more easily usable form for ground 28 | % truth 29 | usediff = true; 30 | for o = 1:numel(dataset_params.objnames_all) 31 | objname = dataset_params.objnames_all{o}; 32 | [gt(o).ids, gt(o).bbox, gt(o).isdiff, gt(o).istrunc, gt(o).isocc, ... 33 | gt(o).details, gt(o).rnum, gt(o).onum] = PASgetObjects(rec, objname, usediff); 34 | gt(o).N = size(gt(o).bbox, 1); 35 | end 36 | 37 | ann.rec = rec; 38 | ann.gt = gt; 39 | 40 | save(outfn, 'ann'); 41 | else 42 | load(outfn, 'ann'); 43 | end 44 | otherwise 45 | error('dataset %s is unknown\n', dataset); 46 | end -------------------------------------------------------------------------------- /src/readDetections.m: -------------------------------------------------------------------------------- 1 | function det = readDetections(dataset, dataset_params, ann, objname) 2 | % det = readDetections(dataset, dataset_params, ann, objname) 3 | % 4 | % Reads object detections for class objname to be analyzed 5 | 6 | switch lower(dataset) 7 | 8 | case 'voc' 9 | 10 | rec = ann.rec; 11 | 12 | % reads detection results in format (file_id conf x1 y1 x2 y2) and outputs 13 | % the bounding box, confidence, and corresponding record index 14 | detfn = sprintf(dataset_params.detpath, objname); 15 | [ids,conf,x1,y1,x2,y2]=textread(detfn,'%s %f %f %f %f %f'); 16 | 17 | bbox = [x1 y1 x2 y2]; 18 | 19 | ind = conf >= dataset_params.confidence_threshold; 20 | bbox = bbox(ind, :); 21 | ids = ids(ind); 22 | conf = conf(ind); 23 | 24 | 25 | % constrain the bounding box to lie within the image and get the record 26 | % number 27 | bbox = max(bbox, 1); 28 | if exist('rec', 'var') 29 | recnum = zeros(size(conf)); 30 | for r = 1:numel(rec) 31 | ind = strcmp(ids, strtok(rec(r).filename, '.')); 32 | recnum(ind) = r; 33 | bbox(ind, 3) = min(bbox(ind, 3), rec(r).imgsize(1)); 34 | bbox(ind, 4) = min(bbox(ind, 4), rec(r).imgsize(2)); 35 | end 36 | end 37 | 38 | [det.bbox, det.conf, det.rnum] = deal(bbox, conf, recnum); 39 | det.nimages = numel(rec); 40 | det.N =size(det.bbox, 1); 41 | 42 | otherwise 43 | error('dataset %s unknown', dataset); 44 | end -------------------------------------------------------------------------------- /src/readGtData.m: -------------------------------------------------------------------------------- 1 | function [data, labels] = readGtData(name) 2 | % [data, labels] = readGtData(name) 3 | 4 | fid = fopen(name); 5 | line = fgetl(fid); 6 | labels = strtokAll(line); 7 | %line = fgetl(fid); 8 | data = zeros(10E6, numel(labels)); 9 | 10 | n = 0; 11 | while true 12 | line = fgetl(fid); 13 | if ~ischar(line), break, end 14 | if isempty(line), continue; end; 15 | n = n +1; 16 | data(n, :) = str2num(line); 17 | end 18 | data = data(1:n, :); 19 | fclose(fid); 20 | 21 | function strs = strtokAll(str) 22 | strs = {}; 23 | rest = str; 24 | while true 25 | [first, rest] = strtok(rest); 26 | strs{end+1} = first; 27 | if isempty(rest) 28 | break; 29 | end 30 | end 31 | 32 | -------------------------------------------------------------------------------- /src/setDatasetParameters.m: -------------------------------------------------------------------------------- 1 | function dataset_params = setDatasetParameters(dataset) 2 | % dataset_params = setDatasetParameters(dataset) 3 | % 4 | % Sets machine-specific and datset-specific parameters such as image paths. 5 | % 6 | % Required parameters: 7 | % imdir: directory containing images 8 | % objnames_all{nclasses}: names for each object class, order specifies 9 | % index for each class 10 | % objnames_extra{nclasses}: names of classes for more detailed analysis 11 | % (may only be relevant for VOC2007); if not available, set to {} 12 | % similar_classes{ngroups}: set of equivalence sets such that any pair of 13 | % classes in an equivalence set is considered similar (symmetric binary 14 | % confusion matrix can be encoded as a set of pairs); sets consist of 15 | % indices into classes given by objnames_all 16 | % summary_sets{nsets}: sets of indices that will be used to summarize 17 | % stastics 18 | % summary_setnames{nsets}: names of each set (e.g., animal) 19 | 20 | switch lower(dataset) 21 | case 'voc' 22 | dataset_params.imset = 'test'; % set used for analysis 23 | dataset_params.imdir = '/home/kwang/Documents/VOCdevkit/VOC2007/JPEGImages/'; % needs to be set for your computer 24 | dataset_params.VOCsourcepath = './VOCcode'; % change this for later VOC versions 25 | dataset_params.VOCset = 'VOC2007'; 26 | addpath(dataset_params.VOCsourcepath); 27 | dataset_params.annotationdir = '../annotations'; 28 | dataset_params.objnames_extra = {'aeroplane', 'bicycle', 'bird', 'boat', 'cat', ... 29 | 'chair', 'diningtable'}; % required parameter: specify objects with extra annotation -- set to empty set if not using VOC2007 30 | dataset_params.confidence_threshold = -Inf; % minimum confidence to be included in analysis (e.g., set to 0.01 to improve speed) 31 | 32 | % all object names 33 | dataset_params.objnames_all = {'aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', ... 34 | 'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike', 'person', ... 35 | 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor'}; 36 | 37 | % specify sets of similar objects 38 | animals = [3 8 10 12 13 15 17]; % animals + person (15) 39 | vehicles1 = [1 4 6 7 19 2 14]; % all vehicles (may want to exclude bicycle motorcycle) 40 | vehicles2 = [2 14]; % bicycle motorcycle 41 | furniture = [9 11 18]; % chair, table, sofa 42 | airobjects = [1 3]; % bird, airplane 43 | dataset_params.similar_classes = {animals, vehicles1, vehicles2, furniture, airobjects}; 44 | 45 | % specify summary sets 46 | dataset_params.summary_sets = cat(2, {[3 8 10 12 13 17], [1 4 6 7 19 2 14], [9 11 18]}); 47 | dataset_params.summary_setnames = {'animals', 'vehicles', 'furniture'}; 48 | 49 | % localization criteria 50 | dataset_params.iuthresh_weak = 0.1; % intersection/union threshold 51 | dataset_params.idthresh_weak = 0; % intersection/det_area threshold 52 | dataset_params.iuthresh_strong = 0.5; % intersection/union threshold 53 | dataset_params.idthresh_strong = 0; % intersection/det_area threshold 54 | 55 | end 56 | -------------------------------------------------------------------------------- /src/setDetectorInfo.m: -------------------------------------------------------------------------------- 1 | function [detpath, resultdir, detname] = setDetectorInfo(detector) 2 | % [detpath, resultdir, detname] = setDetectorInfo(detector) 3 | % 4 | % sets path etc for given detector 5 | 6 | switch detector 7 | case 'felzenszwalb_v2' 8 | detpath = '../detections/felzenszwalb_v2/fel_v2_VOC2007_%s_det.txt'; 9 | resultdir = '../results/felzenszwalb_v2'; 10 | detname = 'FGMR (v2)'; 11 | case 'felzenszwalb_v3' 12 | detpath = '../detections/felzenszwalb_v3/fel_v3_VOC2007_%s_det.txt'; 13 | resultdir = '../results/felzenszwalb_v3'; 14 | detname = 'FGMR (v3)'; 15 | case 'felzenszwalb_v4' 16 | detpath = '../detections/felzenszwalb_v4/fel_v4_VOC2007_%s_det.txt'; 17 | resultdir = '../results/felzenszwalb_v4'; 18 | detname = 'FGMR (v4)'; 19 | case 'vedaldi2009' 20 | detpath = '../detections/vedaldi2009/ts07full-%s-st0.txt'; 21 | resultdir = '../results/vedaldi2009'; 22 | detname = 'VGVZ 2009'; 23 | case 'cnn_v7-bb' 24 | detpath = '../detections/cnn_v7_bb/comp4_det_test_%s.txt'; 25 | resultdir = '../results/cnn_v7_bb'; 26 | detname = 'CNN v7 bb'; 27 | case 'candidate_detector1' 28 | detpath = '../detections/candidate_detector1/comp4_det_test_%s.txt'; 29 | resultdir = '../results/candidate_detector1'; 30 | detname = 'condidate_detector1'; 31 | case 'candidate_detector2' 32 | detpath = '../detections/candidate_detector2/comp4_det_test_%s.txt'; 33 | resultdir = '../results/candidate_detector2'; 34 | detname = 'condidate_detector2'; 35 | case 'candidate_detector3' 36 | detpath = '../detections/candidate_detector3/comp4_det_test_%s.txt'; 37 | resultdir = '../results/candidate_detector3'; 38 | detname = 'condidate_detector3'; 39 | case 'candidate_detector4' 40 | detpath = '../detections/candidate_detector4/comp4_det_test_%s.txt'; 41 | resultdir = '../results/candidate_detector4'; 42 | detname = 'condidate_detector4'; 43 | case 'candidate_detector5' 44 | detpath = '../detections/candidate_detector5/comp4_det_test_%s.txt'; 45 | resultdir = '../results/candidate_detector5'; 46 | detname = 'candidate_detector5'; 47 | otherwise 48 | error('unknown detector') 49 | end 50 | -------------------------------------------------------------------------------- /src/showSurprisingMisses.m: -------------------------------------------------------------------------------- 1 | function showSurprisingMisses(imdir, rec, result) 2 | % showSurprisingMisses(imdir, rec, gt) 3 | % 4 | % Sorts objects by their normalized precision, minus the average of the 5 | % average normalized precision for their characteristics. For example, a 6 | % medium-sized side-view of an airplane is likely to have a high APn. 7 | % 8 | % Input: 9 | % imdir: the directory of images 10 | % rec: the PASCAL annotations structure 11 | % result: output of the analyzeTrueDetections function 12 | 13 | for o = 1:numel(result) 14 | gt = result(o).gt; 15 | pn = gt.pn; 16 | 17 | predpn = zeros(size(pn)); 18 | 19 | attributes = zeros(gt.N, 4); 20 | keep = true(gt.N, 1); 21 | for k = 1:gt.N 22 | if rec(gt.rnum(k)).objects(gt.onum(k)).difficult, 23 | keep(k) = false; 24 | continue; 25 | end; 26 | attributes(k, :) = [result(o).occ(gt.occ_level(k)).apn ... 27 | result(o).truncated(gt.truncated(k)+1).apn ... 28 | result(o).area(gt.area(k)).apn ... 29 | result(o).aspect(gt.aspect(k)).apn]; 30 | 31 | %predpn(k) = (result(o).occ(gt.occ_level(k)).apn + ... 32 | % result(o).truncated(gt.truncated(k)+1).apn + ... 33 | % result(o).area(gt.area(k)).apn + ... 34 | % result(o).aspect(gt.aspect(k)).apn)/4; 35 | end 36 | 37 | w = robustfit(attributes(keep, :), pn(keep)); 38 | disp(num2str(w')) 39 | predpn = attributes*w(2:end) + w(1); 40 | 41 | diffpn = predpn-pn; 42 | [sv, si] = sort(diffpn, 'descend'); 43 | 44 | for k = 1:gt.N 45 | if rec(gt.rnum(si(k))).objects(gt.onum(si(k))).difficult, continue; end; 46 | im = imread(fullfile(imdir, rec(gt.rnum(si(k))).filename)); 47 | bbox = rec(gt.rnum(si(k))).objects(gt.onum(si(k))).bbox; 48 | figure(1), hold off, imagesc(im); axis image, axis off; 49 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'r', 'linewidth', 3); 50 | text(bbox(1)+3, bbox(2)+15, sprintf('%0.3f',predpn(si(k))), 'backgroundcolor', [1 1 1], 'fontsize', 10, 'fontangle', 'italic'); 51 | 52 | bbox = gt.bbox_ov(si(k), :); 53 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'b-', 'linewidth', 3); 54 | text(bbox(1)+3, bbox(2)+15, sprintf('%0.3f',gt.pn_ov(si(k))), 'backgroundcolor', [1 1 1], 'fontsize', 10); 55 | %title(sprintf('%s: pred=%0.3f, actual=%0.3f, bestov=%0.3f', result(o).name, predpn(si(k)), pn(si(k)), gt.pn_ov(si(k)))); 56 | 57 | bbox = gt.bbox_conf(si(k), :); 58 | if ~all(bbox==0) 59 | hold on, plot(bbox([1 1 3 3 1]), bbox([2 4 4 2 2]), 'g--', 'linewidth', 3); 60 | text(bbox(1)+3, bbox(2)+15, sprintf('%0.3f',pn(si(k))), 'backgroundcolor', [1 1 1], 'fontsize', 10); 61 | end 62 | %pause; 63 | end 64 | end 65 | 66 | function att = gt2attributes(gt) 67 | 68 | att = []; 69 | fnames = {'area', 'aspect', 'occ_level', 'truncated', 'part', 'side', 'height'}; 70 | for f = 1:numel(fnames) 71 | if ~isstruct(fnames{f}) 72 | na = max(gt.(fnames{f})); 73 | att(:, end+(1:na)) = repmat(gt.(fnames{f}), [1 na])==repmat(1:na, [gt.N 1]); 74 | else 75 | fnames2 = fieldnames(gt.(fnames{f})); 76 | for k = 1:numel(fnames2) 77 | na = max(gt.(fnames{f}).(fnames2{k})); 78 | att(:, end+(1:na)) = repmat(gt.(fnames{f}).(fnames2{k}), [1 na])==repmat(1:na, [gt.N 1]); 79 | end 80 | end 81 | end 82 | -------------------------------------------------------------------------------- /src/tmp/transferDetectionsScript.m: -------------------------------------------------------------------------------- 1 | for v = ['4'] 2 | fnpath = ['/mnt/disk2/datasets/pascal2010/detections_dpm_v' v '/%s_final_VOC2007_fgmr' v '/%sfgmr' v '.mat']; 3 | outpath = ['/home/dhoiem/src/detectionAnalysis/detections/felzenszwalb_v' v '/fel_v' v '_VOC2007_%s_det.txt']; 4 | 5 | allnames = {'aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', ... 6 | 'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike', 'person', ... 7 | 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor'}; 8 | 9 | for o = 1:numel(allnames) 10 | objname = allnames{o}; 11 | disp(objname) 12 | fid = fopen(sprintf(outpath, objname), 'w'); 13 | 14 | for r = 1:numel(rec) 15 | id = strtok(rec(r).filename, '.'); 16 | fn = sprintf(fnpath, objname, id); 17 | load(fn, 'detections'); 18 | if isempty(detections), continue; end; 19 | bbox = detections(:, 1:4); 20 | conf = detections(:, end); 21 | 22 | bbox(:, [1 2]) = max(bbox(:, [1 2]), 1); 23 | bbox(:, [3 4]) = min(bbox(:, [3 4]), repmat(rec(r).imgsize(1:2), [size(bbox, 1) 1])); 24 | 25 | maxov = 0.5; 26 | [bbox, conf] = pruneBBox(bbox, conf, [], [], maxov); 27 | 28 | for j=1:numel(conf) 29 | fprintf(fid,'%s %f %f %f %f %f\n',id,conf(j),bbox(j, :)); 30 | end 31 | end 32 | fclose(fid); 33 | end 34 | end -------------------------------------------------------------------------------- /src/updateRecordAnnotations.m: -------------------------------------------------------------------------------- 1 | function rec = updateRecordAnnotations(rec, annotationpath, cls) 2 | 3 | %[gids,gxmin,gymin,gxmax,gymax]=textread(sprintf(gttrdetpath,cls),'%s %f %f %f %f'); 4 | [data, labels] = readGtData(sprintf(annotationpath, cls)); 5 | 6 | 7 | %[gtids,imgsize,objsize,objrel,objcat,diff,trun,occl,view,part,group,ground,note]=... 8 | % textread(gtfn,'%s %f %f %f %s %d %d %d %s %s %d %s %s'); 9 | anni = 0; 10 | for r = 1:numel(rec) 11 | for o = 1:numel(rec(r).objects) 12 | if strcmp(rec(r).objects(o).class, cls) 13 | if ~rec(r).objects(o).difficult 14 | anni = anni + 1; 15 | 16 | bbox = rec(r).objects(o).bbox; 17 | if (bbox(3)-bbox(1)+1)*(bbox(4)-bbox(2)+1)~=data(anni, end-1) 18 | keyboard; 19 | end 20 | 21 | occ = data(anni, 3); 22 | if strcmp(cls, 'diningtable') 23 | parts = data(anni, 4:5); 24 | view = data(anni, 6:7); 25 | else 26 | parts = data(anni, 4:end-7); 27 | view = data(anni, end-6:end-2); 28 | end 29 | 30 | 31 | rec(r).objects(o).details = getDetailStructure(cls, occ, view, parts, bbox); 32 | 33 | end 34 | end 35 | end 36 | end 37 | 38 | function d = getDetailStructure(cls, occ, view, parts, bb) 39 | 40 | d = struct('occ_level', [], 'side_visible', [], 'part_visible', [], ... 41 | 'bbox_area', [], 'bbox_aspectratio', []); 42 | d.occ_level = occ+1; % = {1: none, 2:low, 3:medium, 4:high 43 | if strcmp(cls, 'diningtable') 44 | d.side_visible = struct('side', view(1), 'top', view(2)); 45 | elseif strcmp(cls, 'bicycle') 46 | d.side_visible = struct('bottom', view(1), 'front', view(2), ... 47 | 'rear', view(3), 'top', view(4), 'side', view(5)); 48 | else 49 | d.side_visible = struct('bottom', view(1), 'front', view(2), ... 50 | 'rear', view(3), 'side', view(4), 'top', view(5)); 51 | end 52 | 53 | % if strcmp(cls, 'aeroplane') || strcmp(cls, 'chair') || strcmp(cls, 'boat') 54 | % d.side_visible = struct('bottom', view(1), 'front', view(2), ... 55 | % 'top', view(3), 'side', view(4), 'rear', view(5)); 56 | % elseif strcmp(cls, 'cat') || strcmp(cls, 'bird') || strcmp(cls, 'bicycle') 57 | % d.side_visible = struct('bottom', view(1), 'front', view(2), ... 58 | % 'rear', view(3), 'side', view(4), 'top', view(5)); 59 | % end 60 | 61 | d.bbox_area = (bb(3)-bb(1)+1)*(bb(4)-bb(2)+1); 62 | d.bbox_aspectratio = (bb(3)-bb(1)+1)./(bb(4)-bb(2)+1); 63 | 64 | 65 | switch cls 66 | case 'aeroplane' 67 | pname = {'body', 'head', 'tail', 'wing'}; 68 | case 'bicycle' 69 | pname = {'body', 'handlebars', 'seat', 'wheel'}; 70 | case 'boat' 71 | pname = {'body', 'cabin', 'mast', 'paddle', 'sail', 'window'}; 72 | case 'bird' 73 | pname = {'body', 'face', 'beak', 'leg', 'tail', 'wing'}; 74 | case 'cat' 75 | pname = {'body', 'ear', 'face', 'leg', 'tail'}; 76 | case 'chair' 77 | pname = {'backrest', 'cushion', 'handrest', 'leg'}; 78 | case 'diningtable' 79 | pname = {'tableleg', 'tabletop'}; 80 | otherwise 81 | error('unknown class'); 82 | end 83 | for k = 1:numel(pname) 84 | d.part_visible.(pname{k}) = parts(k); 85 | end 86 | 87 | np = 0; 88 | partnames = fieldnames(d.part_visible); 89 | for k = 1:numel(partnames) 90 | np = np+d.part_visible.(partnames{k}); 91 | end 92 | if np~=sum(parts) 93 | error('part missassignment') 94 | end -------------------------------------------------------------------------------- /src/writeFPAnalysisSummary.m: -------------------------------------------------------------------------------- 1 | function writeFPAnalysisSummary(result, allnames, detname, fn) 2 | 3 | animals = [3 8 10 12 13 17]; % animals without person 4 | vehicles = [1 4 6 7 19 2 14]; % exclude bicycle motorcycle 5 | furniture = [9 11 18]; % chair, table, sofa 6 | 7 | 8 | for k =1:numel(allnames) 9 | allnames{k} = allnames{k}(1:min(5, numel(allnames{k}))); 10 | end 11 | 12 | fid = fopen(fn, 'w'); 13 | fprintf(fid, sprintf('False positive analysis: %s\n', detname)); 14 | fprintf(fid, sprintf('%s\n', date)); 15 | 16 | fprintf(fid, '\n'); 17 | fprintf(fid, 'Impact on Performance (AP)\n'); 18 | fprintf(fid, '- means none of that kind of FP; + means only that kind of FP\n'); 19 | fprintf(fid, ['Name' repmat(' ', [1 11]) 'All\t' 'Rec\t -Loc\t fxLoc \t +Loc\t -Sim\t +Sim\t ' ... 20 | '-BG\t +BG\t -LocSim\n']); 21 | for o = 1:numel(result) 22 | name = repmat(' ', [1 15]); name(1:numel(result(o).name)) = upper(result(o).name); 23 | improvement(o, 1:10) = [result(o).all.ap result(o).all.r(end) result(o).ignoreloc.ap result(o).fixloc.ap result(o).onlyloc.ap ... 24 | result(o).ignoresimilar.ap result(o).onlysimilar.ap ... 25 | result(o).ignorebg.ap result(o).onlybg.ap result(o).ignorelocsim.ap]; 26 | fprintf(fid, ['%s' repmat('%0.3f\t', [1 size(improvement,2)]) '\n'], name, improvement(o, :)); 27 | end 28 | if numel(allnames)==20 29 | fprintf(fid, ['%s \t' repmat('%0.3f\t', [1 size(improvement,2)]) '\n'], 'animals', mean(improvement(animals, :))); 30 | fprintf(fid, ['%s \t' repmat('%0.3f\t', [1 size(improvement,2)]) '\n'], 'vehicles', mean(improvement(vehicles, :))); 31 | fprintf(fid, ['%s \t' repmat('%0.3f\t', [1 size(improvement,2)]) '\n'], 'furniture', mean(improvement(furniture, :))); 32 | end 33 | 34 | if 0 % skipping APN 35 | fprintf(fid, '\n'); 36 | fprintf(fid, 'Impact on Performance (APn)\n'); 37 | fprintf(fid, '- means none of that kind of FP; + means only that kind of FP\n'); 38 | fprintf(fid, ['Name' repmat(' ', [1 11]) 'All\t Rec\t -Loc\t \t fxLoc \t +Loc\t -Sim\t +Sim\t ' ... 39 | '-BG\t +BG\t -LocSim\n']); 40 | for o = 1:numel(result) 41 | name = repmat(' ', [1 15]); name(1:numel(result(o).name)) = upper(result(o).name); 42 | improvement(o, 1:10) = [result(o).all.apn result(o).all.r(end) result(o).ignoreloc.apn result(o).fixloc.apn result(o).onlyloc.apn ... 43 | result(o).ignoresimilar.apn result(o).onlysimilar.apn ... 44 | result(o).ignorebg.apn result(o).onlybg.apn result(o).ignorelocsim.apn]; 45 | fprintf(fid, ['%s' repmat('%0.3f\t', [1 size(improvement,2)]) '\n'], name, improvement(o, :)); 46 | end 47 | fprintf(fid, ['%s \t' repmat('%0.3f\t', [1 size(improvement,2)]) '\n'], 'animals', mean(improvement(animals, :))); 48 | fprintf(fid, ['%s \t' repmat('%0.3f\t', [1 size(improvement,2)]) '\n'], 'vehicles', mean(improvement(vehicles, :))); 49 | fprintf(fid, ['%s \t' repmat('%0.3f\t', [1 size(improvement,2)]) '\n'], 'furniture', mean(improvement(furniture, :))); 50 | end 51 | 52 | for k = numel(result(1).confuse_count.total) %only writing out last case 53 | fprintf(fid, '\n'); 54 | fprintf(fid, 'Top FP (%d)\n', k); 55 | fprintf(fid, ['Name' repmat(' ', [1 11]) 'total\t loc\t sim\t other\t bg\n']); 56 | for o = 1:numel(result) 57 | count = result(o).confuse_count; 58 | name = repmat(' ', [1 15]); name(1:numel(result(o).name)) = upper(result(o).name); 59 | total = count.total(k) - count.correct(k); 60 | nfp(o, 1:5) = [total [count.loc(k) count.similarobj(k) count.otherobj(k) count.bg(k)]./total]; 61 | fprintf(fid, ['%s\t%d\t' repmat('%0.3f\t', [1 4]) '\n'], name, nfp(o, 1), nfp(o, 2:end)); 62 | end 63 | if numel(allnames)==20 64 | fprintf(fid, ['%s \t%d\t' repmat('%0.3f\t', [1 4]) '\n'], 'animals', round(mean(nfp(animals, 1))), mean(nfp(animals, 2:end))); 65 | fprintf(fid, ['%s \t%d\t' repmat('%0.3f\t', [1 4]) '\n'], 'vehicles', round(mean(nfp(vehicles, 1))), mean(nfp(vehicles, 2:end))); 66 | fprintf(fid, ['%s \t%d\t' repmat('%0.3f\t', [1 4]) '\n'], 'furniture', round(mean(nfp(furniture, 1))), mean(nfp(furniture, 2:end))); 67 | end 68 | 69 | fprintf(fid, [repmat(' ', [1 15]) repmat('%s\t', [1 numel(allnames)]) '\n'], allnames{:}); 70 | for o = 1:numel(result) 71 | count = result(o).confuse_count; 72 | total = count.total(k) - count.correct(k); 73 | name = repmat(' ', [1 15]); name(1:numel(result(o).name)) = upper(result(o).name); 74 | fprintf(fid, ['%s\t' repmat('%0.3f\t', [1 numel(count.object(:, k))]) '\n'], name, count.object(:, k)'./total); 75 | end 76 | 77 | end 78 | 79 | fclose(fid); -------------------------------------------------------------------------------- /src/writeMissedObjectCharacteristics.m: -------------------------------------------------------------------------------- 1 | function writeMissedObjectCharacteristics(result, detname, fn) 2 | 3 | fid = fopen(fn, 'w'); 4 | fprintf(fid, sprintf('Characteristics of missed objects: %s\n', detname)); 5 | fprintf(fid, sprintf('%s\n', date)); 6 | 7 | % per object 8 | for o = 1:numel(result) 9 | fprintf(fid,'\n'); 10 | fprintf(fid, '%s\n', upper(result(o).name)); 11 | all =result(o).counts.all; 12 | missed =result(o).counts.missed; 13 | fnames = fieldnames(all); 14 | for p = 1:numel(fnames) 15 | n = fnames{p}; 16 | mi = mutualinfo_ratio(all.(n)(:), missed.(n)(:)); 17 | for v = 1:numel(missed.(n)) 18 | fprintf(fid, '%s %d:\t missed = %d (%0.3f); \t total = %d (%0.3f); \t %% missed = %0.3f\n', n, v, missed.(n)(v), ... 19 | missed.(n)(v) ./ missed.total, all.(n)(v), all.(n)(v)./all.total, missed.(n)(v)./all.(n)(v)); 20 | end 21 | fprintf(fid, '%s\tmutual information ratio=%0.3f\n', n, mi); 22 | end 23 | end 24 | fclose(fid); 25 | 26 | 27 | function mi = mutualinfo_ratio(all_counts, missed_counts) 28 | % sum_(x,y) P(x,y) log [P(x,y)/(P(x)P(y))] 29 | % 30 | % sum_(i in ismissed, j in label) log P(ismissed=i, label=j) /(P(ismissed=i)P(label=j)) 31 | 32 | found_counts = all_counts - missed_counts; 33 | 34 | Pxy = [found_counts(:) missed_counts(:)] ./ sum(all_counts(:)); 35 | Px = sum(Pxy, 1); 36 | Py = sum(Pxy, 2); 37 | mi = 0; 38 | for i = 1:size(Pxy, 1) 39 | for j = 1:size(Pxy, 2) 40 | if Pxy(i, j) > 0 41 | mi = mi + Pxy(i, j)*log(Pxy(i, j)./(Px(j).*Py(i))); 42 | end 43 | end 44 | end 45 | 46 | p1 = sum(found_counts) / sum(all_counts); 47 | p0 = 1-p1; 48 | entropy = -sum(p0).*log(p0) - sum(p1).*log(p1); 49 | mi = mi / entropy; 50 | -------------------------------------------------------------------------------- /src/writeTexHeader.m: -------------------------------------------------------------------------------- 1 | function writeTexHeader(outdir, detname) 2 | 3 | 4 | if ~exist(outdir, 'file'), mkdir(outdir); end; 5 | global fid 6 | fid = fopen(fullfile(outdir, ['header.tex']), 'w'); 7 | 8 | pr('\\section{Info}\n'); 9 | pr('The \\textbf{%s} detector is analyzed. This is an automatically created document.\n\n', detname); 10 | 11 | 12 | fclose(fid); 13 | 14 | 15 | 16 | function pr(varargin) 17 | global fid; 18 | fprintf(fid, varargin{:}); 19 | -------------------------------------------------------------------------------- /src/writeTexObject.m: -------------------------------------------------------------------------------- 1 | function writeTexObject(name, outdir, gt) 2 | % writeTexObject(name, outdir, gt) 3 | % 4 | % Adds latex code to an existing file for one object: 5 | % * table displaying missed object characteristics (if gt is not empty) 6 | % * false positive trend plots 7 | % * examples of top false positives 8 | % * analysis of object characteristics 9 | % * difficult detections 10 | 11 | if ~exist(outdir, 'file'), mkdir(outdir); end; 12 | global fid 13 | fid = fopen(fullfile(outdir, [name '.tex']), 'w'); 14 | 15 | pr('\\section{%s}\n\n', name); 16 | 17 | % create table 18 | if ~isempty(gt) 19 | pr('\\begin{verbatim}\n'); 20 | pr('Characteristics: ntotal=%d ntrunc=%d \n', sum(~gt.isdiff), sum(gt.istrunc)); 21 | if ~isempty(gt.details{1}) 22 | details = cat(1, gt.details{:}); 23 | pr(' occlevel: None=%d Low=%d Med=%d High=%d\n', hist([details.occ_level], 1:4)); 24 | 25 | sv = [details.side_visible]; 26 | names = fieldnames(details(1).side_visible); 27 | pr(' side visible: \n'); 28 | for k = 1:numel(names) 29 | pr(' %s: Yes=%d No=%d \n', names{k}, sum([sv.(names{k})]==1), sum([sv.(names{k})]==0)); 30 | end 31 | pr(' part visible: \n'); 32 | sv = [details.part_visible]; 33 | names = fieldnames(details(1).part_visible); 34 | for k = 1:numel(names) 35 | pr(' %s: Yes=%d No=%d \n', names{k}, sum([sv.(names{k})]==1), sum([sv.(names{k})]==0)); 36 | end 37 | end 38 | pr('\\end{verbatim}\n'); 39 | pr('\n\n'); 40 | end 41 | 42 | if exist(fullfile(outdir(1:end-4), sprintf('plots_fp_trendarea_%s.pdf', name)), 'file') 43 | pr('\\begin{figure*}[hp]\n') 44 | pr('\\begin{center}\n'); 45 | pr('\\begin{tabular}{c c}\n'); 46 | pr('\\includegraphics[width=0.45\\textwidth]{../plots_fp_trendarea_%s.pdf} & \n', name); 47 | pr('\\includegraphics[width=0.45\\textwidth]{../plots_fp_dttrendarea_%s.pdf} \\\\ \n', name); 48 | pr('\\end{tabular}\n'); 49 | pr('\\end{center}\n'); 50 | pr('\\caption{\\textbf{False positive/detection trends with rank.} Left: stacked area plot showing fraction of FP of each type as the total number of FP increase. Right: type of detection as number of detections increases; line plots show recall as function of the number of objects (dashed=weak localization, solid=strong localization).}\n', name); 51 | pr('\\end{figure*}\n'); 52 | 53 | pr('\n\n'); 54 | end 55 | 56 | pr('\\begin{figure*}[hp]\n') 57 | pr('\\begin{tabular}{c c c c c}\n'); 58 | for k = 1:20 59 | nstr = num2str(k+10000); 60 | if mod(k, 5)==0 61 | pr('\\hspace{-0.17in}\n \\includegraphics[height=0.85in]{../fp/%s_fp_%s.pdf} \\\\ \n', name, nstr(2:end)); 62 | else 63 | pr('\\hspace{-0.17in}\n\\includegraphics[height=0.85in]{../fp/%s_fp_%s.pdf} & \n', name, nstr(2:end)); 64 | end 65 | end 66 | pr('\\end{tabular}\n'); 67 | pr('\\caption{\\textbf{Examples of top %s false positives}}\n', name); 68 | pr('\\end{figure*}\n'); 69 | 70 | 71 | pr('\n\n'); 72 | 73 | if exist(fullfile(outdir(1:end-4), sprintf('plots_%s_strong.pdf', name)), 'file') 74 | pr('\\begin{figure*}[hp]\n') 75 | pr('\\begin{center}\n'); 76 | pr('\\includegraphics[width=\\textwidth]{../plots_%s_strong.pdf} \\\\ \n', name); 77 | 78 | pr('\\end{center}\n'); 79 | pr('\\caption{\\textbf{Analysis of %s characteristics: } APn (+) wtih standard error bars (red). Black dashed lines indicate overall APn. See paper for further details.}\n', name); 80 | pr('\\end{figure*}\n'); 81 | 82 | pr('\n\n'); 83 | 84 | pr('\\begin{figure*}[hp]\n') 85 | pr('\\begin{tabular}{c c c c c}\n'); 86 | fn = dir(fullfile(outdir(1:end-4), 'tp', sprintf('%s*.pdf', name))); 87 | for k = 1:numel(fn) 88 | %nstr = num2str(k+10000); 89 | if mod(k, 5)==0 90 | pr('\\hspace{-0.17in}\n \\includegraphics[height=0.85in]{../tp/%s} \\\\ \n', fn(k).name); 91 | else 92 | pr('\\hspace{-0.17in}\n \\includegraphics[height=0.85in]{../tp/%s} & \n', fn(k).name); 93 | end 94 | end 95 | pr('\\end{tabular}\n'); 96 | pr('\\caption{\\textbf{Unexpectedly difficult %s detections: } Ground truth object is red; predicted confidence in italics; green box is highest scoring detection; blue box is highest scoring with overlap; detection confidence in upper-left corner.}\n', name); 97 | pr('\\end{figure*}\n'); 98 | end 99 | pr('\\clearpage\n'); 100 | fclose(fid); 101 | 102 | 103 | 104 | function pr(varargin) 105 | global fid; 106 | fprintf(fid, varargin{:}); 107 | --------------------------------------------------------------------------------