Print main metrics in a format similar to Detectron, so that they are easy to copypaste into a spreadsheet. Args: results (OrderedDict[dict]): task_name -> {metric -> score}
(results)
| 8 | |
| 9 | |
| 10 | def print_csv_format(results): |
| 11 | """ |
| 12 | Print main metrics in a format similar to Detectron, |
| 13 | so that they are easy to copypaste into a spreadsheet. |
| 14 | |
| 15 | Args: |
| 16 | results (OrderedDict[dict]): task_name -> {metric -> score} |
| 17 | """ |
| 18 | assert isinstance(results, OrderedDict), results # unordered results cannot be properly printed |
| 19 | logger = logging.getLogger(__name__) |
| 20 | for task, res in results.items(): |
| 21 | # Don't print "AP-category" metrics since they are usually not tracked. |
| 22 | important_res = [(k, v) for k, v in res.items() if "-" not in k] |
| 23 | logger.info("copypaste: Task: {}".format(task)) |
| 24 | logger.info("copypaste: " + ",".join([k[0] for k in important_res])) |
| 25 | logger.info("copypaste: " + ",".join(["{0:.4f}".format(k[1]) for k in important_res])) |
| 26 | |
| 27 | |
| 28 | def verify_results(cfg, results): |
no outgoing calls
no test coverage detected