INNER CODE UNIT · Python

indices

OpenVGLab/OmniLottie · app.py:132

            indices = np.linspace(0, total_frames - 1, num_frames).astype(int)
            frames_np = vr.get_batch(indices).asnumpy()

            for f in frames_np:
                img = PILImage.fromarray(f)
                if max(img.size) > max_size:
                    img.thumbnail((max_size, max_size), PILImage.LANCZOS)
                frames.append(img)

        except Exception as e:
            raise ValueError(f"Failed to load video: {str(e)}")

    while len(frames) < num_frames:
        frames.append(frames[-1].copy())

    return frames

def build_messages(task_type, text_prompt=None, image=None, video_frames=None):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…