MCPcopy
hub / github.com/OpenMotionLab/MotionGPT / load_anim

Function load_anim

mGPT/render/visualize.py:26–43  ·  view source on GitHub ↗
(path, timesize=None)

Source from the content-addressed store, hash-verified

24
25
26def load_anim(path, timesize=None):
27 data = np.array(imageio.mimread(path, memtest=False)) #[..., :3]
28 if timesize is None:
29 return data
30
31 # take the last frame and put shadow repeat the last frame but with a little shadow
32 # lastframe = add_shadow(data[-1])
33 # alldata = np.tile(lastframe, (timesize, 1, 1, 1))
34 alldata = data
35
36 # debug fix mat dim
37 if len(data.shape) == 3 and len(alldata.shape) == 4:
38 data = data[:, None, :, :]
39
40 # copy the first frames
41 lenanim = data.shape[0]
42 alldata[:lenanim] = data[:lenanim]
43 return alldata
44
45
46def plot_3d_motion_dico(x):

Callers 1

pool_job_with_descFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected