From bb8472574f8c4cbbbe2c8f85021561dd796aa824 Mon Sep 17 00:00:00 2001 From: kelleyl Date: Thu, 26 Feb 2026 14:09:30 -0500 Subject: [PATCH] sort frame numbers --- mmif/utils/video_document_helper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mmif/utils/video_document_helper.py b/mmif/utils/video_document_helper.py index a1b9c59a..9da2a683 100644 --- a/mmif/utils/video_document_helper.py +++ b/mmif/utils/video_document_helper.py @@ -85,6 +85,8 @@ def extract_frames_as_images(video_document: Document, framenums: Iterable[int], :return: frames as a list of :py:class:`~numpy.ndarray` or :py:class:`~PIL.Image.Image` """ import cv2 + # sort frame numbers + framenums = sorted(framenums) if as_PIL: from PIL import Image frames = []