Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pufanyi committed Nov 27, 2024
1 parent 82a2001 commit ab96465
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lmms_eval/models/model_utils/load_video.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import base64
from io import BytesIO
from random import sample
from typing import Optional, Tuple
from typing import Optional, Tuple, Union

import av
import numpy as np
Expand Down Expand Up @@ -110,7 +110,7 @@ def read_video_pyav(video_path: str, *, num_frm: int = 8, fps: float = None, for
return np.stack([x.to_ndarray(format=format) for x in frames])


def read_video_pyav_pil(video_path: str, *, num_frm: int = 8, fps: float = None, format="rgb24", max_image_size: Optional[Tuple[int, int], int] = None, resize_strategy: str = "resize", force_include_last_frame=False):
def read_video_pyav_pil(video_path: str, *, num_frm: int = 8, fps: float = None, format="rgb24", max_image_size: Optional[Union[Tuple[int, int], int]] = None, resize_strategy: str = "resize", force_include_last_frame=False):
frames = read_video_pyav(video_path, num_frm=num_frm, fps=fps, format=format, force_include_last_frame=force_include_last_frame)
pil_frames = []
for frame in frames:
Expand Down

0 comments on commit ab96465

Please sign in to comment.