Team Ai
Apppublic

OpenMotionLab/MotionGPT

sourceHugging Facemitupdated 1y agoView on Hugging Face
118likes
sampler.py16 linesDownload Raw Back to blender
1import numpy as np2 3def get_frameidx(*, mode, nframes, exact_frame, frames_to_keep):4    if mode == "sequence":5        frameidx = np.linspace(0, nframes - 1, frames_to_keep)6        frameidx = np.round(frameidx).astype(int)7        frameidx = list(frameidx)8    elif mode == "frame":9        index_frame = int(exact_frame*nframes)10        frameidx = [index_frame]11    elif mode == "video":12        frameidx = range(0, nframes)13    else:14        raise ValueError(f"Not support {mode} render mode")15    return frameidx16