MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / evaluate

Method evaluate

PATH/core/solvers/utils/peddet_tester_dev.py:140–165  ·  view source on GitHub ↗

: return: "AP", "MR", "JI", "Recall"

(self)

Source from the content-addressed store, hash-verified

138 return data_list
139
140 def evaluate(self):
141 """
142 : return: "AP", "MR", "JI", "Recall"
143 """
144 if self._distributed:
145 link.synchronize()
146 predictions_list = self.all_gather(self._predictions)
147 if link.get_rank() != 0:
148 return
149
150 proxy_number = time.time()
151 file_path = os.path.join('tmp', 'CrowdHuman', f'Iter-{proxy_number}.human')
152 self.save_results(self._predictions, file_path)
153 eval_results = self._evaluate_predictions_on_crowdhuman(self._gt_path, file_path)
154
155 res = {}
156 metric_names = ["AP", "MR", "JI", "Recall"]
157 for k, v in zip(metric_names, eval_results):
158 print(f"{k}: {v}")
159 res[k] = v
160 results = OrderedDict({"pedestrain_detection": res})
161 self._logger.info(results)
162 os.remove(file_path)
163 print(f"{file_path} deleted")
164
165 return results
166
167 def save_results(self, content, fpath):
168 os.makedirs(os.path.dirname(fpath), exist_ok=True)

Callers

nothing calls this directly

Calls 5

all_gatherMethod · 0.95
save_resultsMethod · 0.95
removeMethod · 0.80
infoMethod · 0.45

Tested by

no test coverage detected