MCPcopy
hub / github.com/Vchitect/Latte / update

Method update

tools/metrics/metric_utils.py:160–173  ·  view source on GitHub ↗
(self, cur_items: int)

Source from the content-addressed store, hash-verified

158 self.progress_fn(self.pfn_lo, self.pfn_total)
159
160 def update(self, cur_items: int):
161 assert (self.num_items is None) or (cur_items <= self.num_items), f"Wrong `items` values: cur_items={cur_items}, self.num_items={self.num_items}"
162 if (cur_items < self.batch_items + self.flush_interval) and (self.num_items is None or cur_items < self.num_items):
163 return
164 cur_time = time.time()
165 total_time = cur_time - self.start_time
166 time_per_item = (cur_time - self.batch_time) / max(cur_items - self.batch_items, 1)
167 if (self.verbose) and (self.tag is not None):
168 print(f'{self.tag:<19s} items {cur_items:<7d} time {dnnlib.util.format_time(total_time):<12s} ms/item {time_per_item*1e3:.2f}')
169 self.batch_time = cur_time
170 self.batch_items = cur_items
171
172 if (self.progress_fn is not None) and (self.num_items is not None):
173 self.progress_fn(self.pfn_lo + (self.pfn_hi - self.pfn_lo) * (cur_items / self.num_items), self.pfn_total)
174
175 def sub(self, tag=None, num_items=None, flush_interval=1000, rel_lo=0, rel_hi=1):
176 return ProgressMonitor(

Callers 12

fid50k_fullFunction · 0.45
kid50k_fullFunction · 0.45
is50kFunction · 0.45
fvd2048_16fFunction · 0.45
fvd2048_128fFunction · 0.45
fvd2048_128f_subsample8fFunction · 0.45
isv2048_ucfFunction · 0.45
fid50kFunction · 0.45
kid50kFunction · 0.45
loadMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected