MCPcopy Create free account
hub / github.com/PeizeSun/SparseR-CNN / print_csv_format

Function print_csv_format

detectron2/evaluation/testing.py:10–25  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

8
9
10def 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
28def verify_results(cfg, results):

Callers 3

do_testFunction · 0.90
testMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected