Accumulate per image evaluation results and store the result in self.eval. Does not support changing parameter settings from those used by self.evaluate()
(self)
| 122 | # >>>> End of code differences with original COCO API |
| 123 | |
| 124 | def accumulate(self): |
| 125 | """ |
| 126 | Accumulate per image evaluation results and store the result in self.eval. Does not |
| 127 | support changing parameter settings from those used by self.evaluate() |
| 128 | """ |
| 129 | print("Accumulating evaluation results...") |
| 130 | tic = time.time() |
| 131 | if not hasattr(self, "_evalImgs_cpp"): |
| 132 | print("Please run evaluate() first") |
| 133 | |
| 134 | self.eval = _C.COCOevalAccumulate(self._paramsEval, self._evalImgs_cpp) |
| 135 | |
| 136 | # recall is num_iou_thresholds X num_categories X num_area_ranges X num_max_detections |
| 137 | self.eval["recall"] = np.array(self.eval["recall"]).reshape( |
| 138 | self.eval["counts"][:1] + self.eval["counts"][2:] |
| 139 | ) |
| 140 | |
| 141 | # precision and scores are num_iou_thresholds X num_recall_thresholds X num_categories X |
| 142 | # num_area_ranges X num_max_detections |
| 143 | self.eval["precision"] = np.array(self.eval["precision"]).reshape( |
| 144 | self.eval["counts"] |
| 145 | ) |
| 146 | self.eval["scores"] = np.array(self.eval["scores"]).reshape(self.eval["counts"]) |
| 147 | toc = time.time() |
| 148 | print( |
| 149 | "COCOeval_opt.accumulate() finished in {:0.2f} seconds.".format(toc - tic) |
| 150 | ) |
no outgoing calls
no test coverage detected