MCPcopy
hub / github.com/PaddlePaddle/PaddleOCR / SmoothedValue

Class SmoothedValue

ppocr/utils/stats.py:22–34  ·  view source on GitHub ↗

Track a series of values and provide access to smoothed values over a window or the global series average.

Source from the content-addressed store, hash-verified

20
21
22class SmoothedValue(object):
23 """Track a series of values and provide access to smoothed values over a
24 window or the global series average.
25 """
26
27 def __init__(self, window_size):
28 self.deque = collections.deque(maxlen=window_size)
29
30 def add_value(self, value):
31 self.deque.append(value)
32
33 def get_median_value(self):
34 return np.median(self.deque)
35
36
37def Time():

Callers 2

__init__Method · 0.85
updateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…