Unverified Commit d72299d4 authored by Jacob Zhong's avatar Jacob Zhong Committed by GitHub
Browse files

Make the cv2 dependency optional (#27780)


Signed-off-by: default avatarJacob <cmpute@qq.com>
parent 80679f10
......@@ -30,7 +30,6 @@ from io import BytesIO
from tempfile import NamedTemporaryFile
from typing import Any, cast
import cv2
import numpy as np
from PIL import Image
from transformers import PreTrainedTokenizerBase
......@@ -850,6 +849,8 @@ class RandomMultiModalDataset(RandomDataset):
Creates a video with random pixel values, encodes it to MP4 format,
and returns the content as bytes.
"""
import cv2
random_pixels = self._rng.integers(
0,
256,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment