Skip to content

Commit 4728256

Browse files
authored
chore: Move cv2 import inside load_video() function (#3768)
Signed-off-by: Netti, Alessio <[email protected]>
1 parent 06b914e commit 4728256

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tensorrt_llm/inputs/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import List, Union
22

3-
import cv2
43
import numpy as np
54
import requests
65
import torch
@@ -30,6 +29,8 @@ def load_video(
3029
num_frames: int = 10,
3130
format: str = "pt",
3231
device: str = "cuda") -> Union[List[Image.Image], List[torch.Tensor]]:
32+
import cv2
33+
3334
assert format in ["pt", "pil"], "format must be either Pytorch or PIL"
3435

3536
# Load video frames from a video file

0 commit comments

Comments
 (0)