MCPcopy Create free account
hub / github.com/MotrixLab/MotionDiffuse / list_cut_average

Function list_cut_average

text2motion/utils/utils.py:111–122  ·  view source on GitHub ↗
(ll, intervals)

Source from the content-addressed store, hash-verified

109
110
111def list_cut_average(ll, intervals):
112 if intervals == 1:
113 return ll
114
115 bins = math.ceil(len(ll) * 1.0 / intervals)
116 ll_new = []
117 for i in range(bins):
118 l_low = intervals * i
119 l_high = l_low + intervals
120 l_high = l_high if l_high < len(ll) else len(ll)
121 ll_new.append(np.mean(ll[l_low:l_high]))
122 return ll_new
123
124
125def motion_temporal_filter(motion, sigma=1):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected