MCPcopy Index your code
hub / github.com/SooLab/CGFormer / ProgressMeter

Class ProgressMeter

utils/misc.py:99–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97
98
99class ProgressMeter(object):
100 def __init__(self, num_batches, meters, prefix=""):
101 self.batch_fmtstr = self._get_batch_fmtstr(num_batches)
102 self.meters = meters
103 self.prefix = prefix
104
105 def display(self, batch):
106 entries = [self.prefix + self.batch_fmtstr.format(batch)]
107 entries += [str(meter) for meter in self.meters]
108 logger.info(" ".join(entries))
109
110 def _get_batch_fmtstr(self, num_batches):
111 num_digits = len(str(num_batches // 1))
112 fmt = "{:" + str(num_digits) + "d}"
113 return "[" + fmt + "/" + fmt.format(num_batches) + "]"
114
115
116def trainMetricGPU(output, target, threshold=0.35, pr_iou=0.5):

Callers 1

trainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected