
'''simple docstring'''







import random
import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
					import torch

if is_vision_available():
					import PIL

					from transformers import FlavaImageProcessor
					from transformers.image_utils import PILImageResampling
					from transformers.models.flava.image_processing_flava import (
					    FLAVA_CODEBOOK_MEAN,
					    FLAVA_CODEBOOK_STD,
					    FLAVA_IMAGE_MEAN,
					    FLAVA_IMAGE_STD,
					)
else:
					__SCREAMING_SNAKE_CASE		:  Any        =      None
class  SCREAMING_SNAKE_CASE__       (  unittest.TestCase   ):
	def __init__(				self  ,    __UpperCamelCase  ,    __UpperCamelCase=7  ,    __UpperCamelCase=3  ,    __UpperCamelCase=30  ,    __UpperCamelCase=400  ,    __UpperCamelCase=True  ,    __UpperCamelCase=None  ,    __UpperCamelCase=True  ,    __UpperCamelCase=None  ,    __UpperCamelCase=None  ,    __UpperCamelCase=True  ,    __UpperCamelCase=1 / 255  ,    __UpperCamelCase=True  ,    __UpperCamelCase=FLAVA_IMAGE_MEAN  ,    __UpperCamelCase=FLAVA_IMAGE_STD  ,    __UpperCamelCase=14  ,    __UpperCamelCase=75  ,    __UpperCamelCase=None  ,    __UpperCamelCase=16  ,    __UpperCamelCase=0.3  ,    __UpperCamelCase=None  ,    __UpperCamelCase=True  ,    __UpperCamelCase=None  ,    __UpperCamelCase=None  ,    __UpperCamelCase=True  ,    __UpperCamelCase=None  ,    __UpperCamelCase=True  ,    __UpperCamelCase=True  ,    __UpperCamelCase=FLAVA_CODEBOOK_MEAN  ,    __UpperCamelCase=FLAVA_CODEBOOK_STD  ,    ):



					'''simple docstring'''






					__a       :     Union[str, Any]								=	size if size is not None else {"""height""": 224, """width""": 224}
					__a       :     Optional[int]								=	crop_size if crop_size is not None else {"""height""": 224, """width""": 224}
					__a       :     Union[str, Any]								=	codebook_size if codebook_size is not None else {"""height""": 112, """width""": 112}
					__a       :     Tuple								=	codebook_crop_size if codebook_crop_size is not None else {"""height""": 112, """width""": 112}

					__a       :     Optional[Any]								=	parent
					__a       :     str								=	batch_size
					__a       :     Dict								=	num_channels
					__a       :     Optional[Any]								=	do_resize
					__a       :     Dict								=	do_rescale
					__a       :     Optional[Any]								=	rescale_factor
					__a       :     Optional[Any]								=	min_resolution
					__a       :     Dict								=	max_resolution
					__a       :     Optional[int]								=	size
					__a       :     Tuple								=	resample if resample is not None else PILImageResampling.BICUBIC
					__a       :     Dict								=	do_normalize
					__a       :     Tuple								=	image_mean
					__a       :     int								=	image_std
					__a       :     Tuple								=	do_center_crop
					__a       :     int								=	crop_size

					__a       :     Dict								=	input_size_patches
					__a       :     Tuple								=	total_mask_patches
					__a       :     str								=	mask_group_max_patches
					__a       :     Union[str, Any]								=	mask_group_min_patches
					__a       :     Any								=	mask_group_min_aspect_ratio
					__a       :     List[Any]								=	mask_group_max_aspect_ratio

					__a       :     Optional[Any]								=	codebook_do_resize
					__a       :     Tuple								=	codebook_size
					__a       :     Optional[int]								=	codebook_resample if codebook_resample is not None else PILImageResampling.LANCZOS
					__a       :     Optional[Any]								=	codebook_do_center_crop
					__a       :     Any								=	codebook_crop_size
					__a       :     Tuple								=	codebook_do_map_pixels
					__a       :     str								=	codebook_do_normalize
					__a       :     Optional[int]								=	codebook_image_mean
					__a       :     List[str]								=	codebook_image_std
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					return {
					    "image_mean": self.image_mean,
					    "image_std": self.image_std,
					    "do_normalize": self.do_normalize,
					    "do_resize": self.do_resize,
					    "size": self.size,
					    "resample": self.resample,
					    "do_rescale": self.do_rescale,
					    "rescale_factor": self.rescale_factor,
					    "do_center_crop": self.do_center_crop,
					    "crop_size": self.crop_size,
					    "input_size_patches": self.input_size_patches,
					    "total_mask_patches": self.total_mask_patches,
					    "mask_group_max_patches": self.mask_group_max_patches,
					    "mask_group_min_patches": self.mask_group_min_patches,
					    "mask_group_min_aspect_ratio": self.mask_group_min_aspect_ratio,
					    "mask_group_max_aspect_ratio": self.mask_group_min_aspect_ratio,
					    "codebook_do_resize": self.codebook_do_resize,
					    "codebook_size": self.codebook_size,
					    "codebook_resample": self.codebook_resample,
					    "codebook_do_center_crop": self.codebook_do_center_crop,
					    "codebook_crop_size": self.codebook_crop_size,
					    "codebook_do_map_pixels": self.codebook_do_map_pixels,
					    "codebook_do_normalize": self.codebook_do_normalize,
					    "codebook_image_mean": self.codebook_image_mean,
					    "codebook_image_std": self.codebook_image_std,
					}
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					return (self.size["height"], self.size["width"])
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					return (
					    (self.input_size_patches, self.input_size_patches)
					    if not isinstance(self.input_size_patches  ,    __UpperCamelCase			)
					    else self.input_size_patches
					)

	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					return (self.codebook_size["height"], self.codebook_size["width"])







@require_torch
@require_vision
class  SCREAMING_SNAKE_CASE__       (  __UpperCamelCase			,					unittest.TestCase   ):
	lowercase__	    =							FlavaImageProcessor if is_vision_available() else None
	lowercase__	    =							None
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					__a       :     Tuple								=	FlavaImageProcessingTester(self			)
	@property
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					return self.image_processor_tester.prepare_image_processor_dict()
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					__a       :     Optional[int]								=	self.image_processing_class(**self.image_processor_dict			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """image_mean"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """image_std"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """do_normalize"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """do_resize"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """resample"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """crop_size"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """do_center_crop"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """do_rescale"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """rescale_factor"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """masking_generator"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """codebook_do_resize"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """codebook_size"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """codebook_resample"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """codebook_do_center_crop"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """codebook_crop_size"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """codebook_do_map_pixels"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """codebook_do_normalize"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """codebook_image_mean"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """codebook_image_std"""			)			)
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					__a       :     int								=	self.image_processing_class.from_dict(self.image_processor_dict			)
					self.assertEqual(image_processor.size  ,    {"""height""": 224, """width""": 224}			)
					self.assertEqual(image_processor.crop_size  ,    {"""height""": 224, """width""": 224}			)
					self.assertEqual(image_processor.codebook_size  ,    {"""height""": 112, """width""": 112}			)
					self.assertEqual(image_processor.codebook_crop_size  ,    {"""height""": 112, """width""": 112}			)

					__a       :     Optional[Any]								=	self.image_processing_class.from_dict(
					    self.image_processor_dict  ,    size=42  ,    crop_size=84  ,    codebook_size=33  ,    codebook_crop_size=66			)
					self.assertEqual(image_processor.size  ,    {"""height""": 42, """width""": 42}			)
					self.assertEqual(image_processor.crop_size  ,    {"""height""": 84, """width""": 84}			)
					self.assertEqual(image_processor.codebook_size  ,    {"""height""": 33, """width""": 33}			)
					self.assertEqual(image_processor.codebook_crop_size  ,    {"""height""": 66, """width""": 66}			)
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					pass
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					__a       :     List[Any]								=	self.image_processing_class(**self.image_processor_dict			)
					# create random PIL images
					__a       :     Any								=	prepare_image_inputs(self.image_processor_tester  ,    equal_resolution=__UpperCamelCase			)
					for image in image_inputs:
									self.assertIsInstance(__UpperCamelCase  ,    PIL.Image.Image			)

					# Test not batched input
					__a       :     Union[str, Any]								=	image_processing(image_inputs[0]  ,    return_tensors="""pt"""			)

					# Test no bool masked pos
					self.assertFalse("""bool_masked_pos""" in encoded_images			)

					__a							,	__a       :     List[Any]								=	self.image_processor_tester.get_expected_image_size()

					self.assertEqual(
					    encoded_images.pixel_values.shape  ,    (1, self.image_processor_tester.num_channels, expected_height, expected_width)  ,    )

					# Test batched
					__a       :     List[str]								=	image_processing(__UpperCamelCase  ,    return_tensors="""pt"""			)
					__a							,	__a       :     List[Any]								=	self.image_processor_tester.get_expected_image_size()

					# Test no bool masked pos
					self.assertFalse("""bool_masked_pos""" in encoded_images			)

					self.assertEqual(
					    encoded_images.pixel_values.shape  ,    (
					        self.image_processor_tester.batch_size,
					        self.image_processor_tester.num_channels,
					        expected_height,
					        expected_width,
					    )  ,    )
	def __lowerCamelCase    (				self  ,    __UpperCamelCase  ,    __UpperCamelCase			):



					'''simple docstring'''






					__a       :     Dict								=	self.image_processing_class(**self.image_processor_dict			)
					# create random tensors
					__a       :     int								=	prepare_image_inputs(self.image_processor_tester  ,    equal_resolution=__UpperCamelCase  ,    **__UpperCamelCase			)
					for image in image_inputs:
									self.assertIsInstance(__UpperCamelCase  ,    __UpperCamelCase			)

					# Test not batched input
					__a       :     Optional[int]								=	image_processing(image_inputs[0]  ,    return_tensors="""pt"""			)

					__a							,	__a       :     Tuple								=	self.image_processor_tester.get_expected_image_size()
					self.assertEqual(
					    encoded_images.pixel_values.shape  ,    (1, self.image_processor_tester.num_channels, expected_height, expected_width)  ,    )

					__a       :     int								=	image_processing(__UpperCamelCase  ,    return_image_mask=__UpperCamelCase  ,    return_tensors="""pt"""			)

					__a							,	__a       :     Tuple								=	self.image_processor_tester.get_expected_image_size()
					self.assertEqual(
					    encoded_images.pixel_values.shape  ,    (
					        self.image_processor_tester.batch_size,
					        self.image_processor_tester.num_channels,
					        expected_height,
					        expected_width,
					    )  ,    )

					__a							,	__a       :     Optional[Any]								=	self.image_processor_tester.get_expected_mask_size()
					self.assertEqual(
					    encoded_images.bool_masked_pos.shape  ,    (
					        self.image_processor_tester.batch_size,
					        expected_height,
					        expected_width,
					    )  ,    )

					# Test batched
					__a       :     Tuple								=	image_processing(__UpperCamelCase  ,    return_tensors="""pt"""			).pixel_values

					__a							,	__a       :     str								=	self.image_processor_tester.get_expected_image_size()
					self.assertEqual(
					    encoded_images.shape  ,    (
					        self.image_processor_tester.batch_size,
					        self.image_processor_tester.num_channels,
					        expected_height,
					        expected_width,
					    )  ,    )

					# Test masking
					__a       :     Optional[Any]								=	image_processing(__UpperCamelCase  ,    return_image_mask=__UpperCamelCase  ,    return_tensors="""pt"""			)

					__a							,	__a       :     Union[str, Any]								=	self.image_processor_tester.get_expected_image_size()
					self.assertEqual(
					    encoded_images.pixel_values.shape  ,    (
					        self.image_processor_tester.batch_size,
					        self.image_processor_tester.num_channels,
					        expected_height,
					        expected_width,
					    )  ,    )

					__a							,	__a       :     Optional[int]								=	self.image_processor_tester.get_expected_mask_size()
					self.assertEqual(
					    encoded_images.bool_masked_pos.shape  ,    (
					        self.image_processor_tester.batch_size,
					        expected_height,
					        expected_width,
					    )  ,    )
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					self._test_call_framework(np.ndarray  ,    prepare_kwargs={"""numpify""": True}			)
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					self._test_call_framework(torch.Tensor  ,    prepare_kwargs={"""torchify""": True}			)
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					random.seed(1234			)
					__a       :     List[str]								=	self.image_processing_class(**self.image_processor_dict			)
					__a       :     int								=	prepare_image_inputs(self.image_processor_tester  ,    equal_resolution=__UpperCamelCase  ,    torchify=__UpperCamelCase			)

					# Test not batched input
					__a       :     Tuple								=	image_processing(image_inputs[0]  ,    return_image_mask=__UpperCamelCase  ,    return_tensors="""pt"""			)
					self.assertEqual(encoded_images.bool_masked_pos.sum().item()  ,    75			)

	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					__a       :     Any								=	self.image_processing_class(**self.image_processor_dict			)
					# create random PIL images
					__a       :     Tuple								=	prepare_image_inputs(self.image_processor_tester  ,    equal_resolution=__UpperCamelCase			)
					for image in image_inputs:
									self.assertIsInstance(__UpperCamelCase  ,    PIL.Image.Image			)

					# Test not batched input
					__a       :     Union[str, Any]								=	image_processing(image_inputs[0]  ,    return_codebook_pixels=__UpperCamelCase  ,    return_tensors="""pt"""			)
					__a							,	__a       :     Union[str, Any]								=	self.image_processor_tester.get_expected_codebook_image_size()
					self.assertEqual(
					    encoded_images.codebook_pixel_values.shape  ,    (1, self.image_processor_tester.num_channels, expected_height, expected_width)  ,    )

					# Test batched
					__a       :     Any								=	image_processing(__UpperCamelCase  ,    return_codebook_pixels=__UpperCamelCase  ,    return_tensors="""pt"""			)
					__a							,	__a       :     List[Any]								=	self.image_processor_tester.get_expected_codebook_image_size()
					self.assertEqual(
					    encoded_images.codebook_pixel_values.shape  ,    (
					        self.image_processor_tester.batch_size,
					        self.image_processor_tester.num_channels,
					        expected_height,
					        expected_width,
					    )  ,    )

'''simple docstring'''







import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin


if is_torch_available():
					import torch

if is_vision_available():
					from PIL import Image

					from transformers import TvltImageProcessor

def 				_snake_case (		lowercase			,    lowercase=1_0			,    lowercase=1_0			,    lowercase=False			,    lowercase=False						)       ->       Any:
				__a       :     Union[str, Any]								=	[]
				for i in range(image_processor_tester.num_frames						):
								video.append(np.random.randint(2_5_5			,    size=(image_processor_tester.num_channels, width, height)			,    dtype=np.uinta						)						)

				if not numpify and not torchify:
								# PIL expects the channel dimension as last dimension
								__a       :     Optional[Any]								=	[Image.fromarray(np.moveaxis(lowercase			,    0			,    -1						)						) for frame in video]

				if torchify:
								__a       :     List[str]								=	[torch.from_numpy(lowercase						) for frame in video]

				return video

def 				_snake_case (		lowercase			,    lowercase=False			,    lowercase=False			,    lowercase=False						)       ->       Optional[Any]:
				assert not (numpify and torchify), "You cannot specify both numpy and PyTorch tensors at the same time"

				__a       :     str								=	[]
				for i in range(image_processor_tester.batch_size						):
								if equal_resolution:
												__a       :     int								=	image_processor_tester.max_resolution
								else:
												__a							,	__a       :     Any								=	np.random.choice(
												    np.arange(image_processor_tester.min_resolution			,    image_processor_tester.max_resolution						)			,    2						)
												__a       :     Any								=	prepare_video(
												    image_processor_tester=lowercase			,    width=lowercase			,    height=lowercase			,    numpify=lowercase			,    torchify=lowercase			,    )
								video_inputs.append(lowercase						)

				return video_inputs
class  SCREAMING_SNAKE_CASE__       (  unittest.TestCase   ):
	def __init__(				self  ,    __UpperCamelCase  ,    __UpperCamelCase=7  ,    __UpperCamelCase=3  ,    __UpperCamelCase=4  ,    __UpperCamelCase=18  ,    __UpperCamelCase=30  ,    __UpperCamelCase=400  ,    __UpperCamelCase=True  ,    __UpperCamelCase=None  ,    __UpperCamelCase=True  ,    __UpperCamelCase=[0.5, 0.5, 0.5]  ,    __UpperCamelCase=[0.5, 0.5, 0.5]  ,    __UpperCamelCase=True  ,    __UpperCamelCase=None  ,    ):



					'''simple docstring'''






					__a       :     int								=	size if size is not None else {"""shortest_edge""": 18}
					__a       :     Optional[int]								=	crop_size if crop_size is not None else {"""height""": 18, """width""": 18}

					__a       :     Optional[Any]								=	parent
					__a       :     Dict								=	batch_size
					__a       :     Optional[Any]								=	num_channels
					__a       :     Dict								=	num_frames
					__a       :     Dict								=	image_size
					__a       :     int								=	min_resolution
					__a       :     Tuple								=	max_resolution
					__a       :     Optional[Any]								=	do_resize
					__a       :     str								=	size
					__a       :     int								=	do_normalize
					__a       :     Any								=	image_mean
					__a       :     Optional[Any]								=	image_std
					__a       :     List[Any]								=	do_center_crop
					__a       :     List[Any]								=	crop_size

	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					return {
					    "image_mean": self.image_mean,
					    "image_std": self.image_std,
					    "do_normalize": self.do_normalize,
					    "do_resize": self.do_resize,
					    "size": self.size,
					    "do_center_crop": self.do_center_crop,
					    "crop_size": self.crop_size,
					}







@require_torch
@require_vision
class  SCREAMING_SNAKE_CASE__       (  __UpperCamelCase			,					unittest.TestCase   ):
	lowercase__	    =							TvltImageProcessor if is_vision_available() else None
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					__a       :     Optional[int]								=	TvltImageProcessorTester(self			)
	@property
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					return self.image_processor_tester.prepare_image_processor_dict()
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					__a       :     Optional[Any]								=	self.image_processing_class(**self.image_processor_dict			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """image_mean"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """image_std"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """do_normalize"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """do_resize"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """do_center_crop"""			)			)
					self.assertTrue(hasattr(__UpperCamelCase  ,    """size"""			)			)
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					__a       :     Union[str, Any]								=	self.image_processing_class(**self.image_processor_dict			)
					# create random PIL videos
					__a       :     List[str]								=	prepare_video_inputs(self.image_processor_tester  ,    equal_resolution=__UpperCamelCase			)
					for video in video_inputs:
									self.assertIsInstance(__UpperCamelCase  ,    __UpperCamelCase			)
									self.assertIsInstance(video[0]  ,    Image.Image			)

					# Test not batched input
					__a       :     int								=	image_processor(video_inputs[0]  ,    return_tensors="""pt"""			).pixel_values
					self.assertEqual(
					    encoded_videos.shape  ,    (
					        1,
					        self.image_processor_tester.num_frames,
					        self.image_processor_tester.num_channels,
					        self.image_processor_tester.crop_size["""height"""],
					        self.image_processor_tester.crop_size["""width"""],
					    )  ,    )

					# Test batched
					__a       :     int								=	image_processor(__UpperCamelCase  ,    return_tensors="""pt"""			).pixel_values
					self.assertEqual(
					    encoded_videos.shape  ,    (
					        self.image_processor_tester.batch_size,
					        self.image_processor_tester.num_frames,
					        self.image_processor_tester.num_channels,
					        self.image_processor_tester.crop_size["""height"""],
					        self.image_processor_tester.crop_size["""width"""],
					    )  ,    )
	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					__a       :     List[str]								=	self.image_processing_class(**self.image_processor_dict			)
					# create random numpy tensors
					__a       :     Union[str, Any]								=	prepare_video_inputs(self.image_processor_tester  ,    equal_resolution=__UpperCamelCase  ,    numpify=__UpperCamelCase			)
					for video in video_inputs:
									self.assertIsInstance(__UpperCamelCase  ,    __UpperCamelCase			)
									self.assertIsInstance(video[0]  ,    np.ndarray			)

					# Test not batched input
					__a       :     Optional[int]								=	image_processor(video_inputs[0]  ,    return_tensors="""pt"""			).pixel_values
					self.assertEqual(
					    encoded_videos.shape  ,    (
					        1,
					        self.image_processor_tester.num_frames,
					        self.image_processor_tester.num_channels,
					        self.image_processor_tester.crop_size["""height"""],
					        self.image_processor_tester.crop_size["""width"""],
					    )  ,    )

					# Test batched
					__a       :     Dict								=	image_processor(__UpperCamelCase  ,    return_tensors="""pt"""			).pixel_values
					self.assertEqual(
					    encoded_videos.shape  ,    (
					        self.image_processor_tester.batch_size,
					        self.image_processor_tester.num_frames,
					        self.image_processor_tester.num_channels,
					        self.image_processor_tester.crop_size["""height"""],
					        self.image_processor_tester.crop_size["""width"""],
					    )  ,    )

	def __lowerCamelCase    (				self			):



					'''simple docstring'''






					__a       :     Optional[Any]								=	self.image_processing_class(**self.image_processor_dict			)
					# create random PyTorch tensors
					__a       :     Optional[int]								=	prepare_video_inputs(self.image_processor_tester  ,    equal_resolution=__UpperCamelCase  ,    torchify=__UpperCamelCase			)
					for video in video_inputs:
									self.assertIsInstance(__UpperCamelCase  ,    __UpperCamelCase			)
									self.assertIsInstance(video[0]  ,    torch.Tensor			)

					# Test not batched input
					__a       :     Optional[int]								=	image_processor(video_inputs[0]  ,    return_tensors="""pt"""			).pixel_values
					self.assertEqual(
					    encoded_videos.shape  ,    (
					        1,
					        self.image_processor_tester.num_frames,
					        self.image_processor_tester.num_channels,
					        self.image_processor_tester.crop_size["""height"""],
					        self.image_processor_tester.crop_size["""width"""],
					    )  ,    )

					# Test batched
					__a       :     int								=	image_processor(__UpperCamelCase  ,    return_tensors="""pt"""			).pixel_values
					self.assertEqual(
					    encoded_videos.shape  ,    (
					        self.image_processor_tester.batch_size,
					        self.image_processor_tester.num_frames,
					        self.image_processor_tester.num_channels,
					        self.image_processor_tester.crop_size["""height"""],
					        self.image_processor_tester.crop_size["""width"""],
					    )  ,    )