(path, timesize=None)
| 24 | |
| 25 | |
| 26 | def 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 | |
| 46 | def plot_3d_motion_dico(x): |
no outgoing calls
no test coverage detected