"""simple docstring"""




import inspect
import unittest

from transformers import MobileViTVaConfig
from transformers.testing_utils import require_torch, require_torch_multi_gpu, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
				import torch

				from transformers import MobileViTVaForImageClassification, MobileViTVaForSemanticSegmentation, MobileViTVaModel
				from transformers.models.mobilevitva.modeling_mobilevitva import (
				    MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST,
				    make_divisible,
				)


if is_vision_available():
				from PIL import Image

				from transformers import MobileViTImageProcessor
class 			UpperCamelCase__(	__A       ):





						def  snake_case__		(				self   )    -> Dict:
													A__		   =							self.config_class(**self.inputs_dict   )
													self.parent.assertTrue(hasattr(__UpperCAmelCase						,'width_multiplier'   )   )






class 			UpperCamelCase__:





						def __init__(				self						,__UpperCAmelCase						,__UpperCAmelCase=13						,__UpperCAmelCase=64						,__UpperCAmelCase=2						,__UpperCAmelCase=3						,__UpperCAmelCase="swish"						,__UpperCAmelCase=3						,__UpperCAmelCase=32						,__UpperCAmelCase=0.1						,__UpperCAmelCase=0.0_2						,__UpperCAmelCase=True						,__UpperCAmelCase=True						,__UpperCAmelCase=10						,__UpperCAmelCase=None						,__UpperCAmelCase=0.2_5						,__UpperCAmelCase=0.0						,__UpperCAmelCase=0.0						,)    -> List[str]:
													A__		   =							parent
													A__		   =							batch_size
													A__		   =							image_size
													A__		   =							patch_size
													A__		   =							num_channels
													A__		   =							make_divisible(5_12 * width_multiplier						,divisor=8   )
													A__		   =							hidden_act
													A__		   =							conv_kernel_size
													A__		   =							output_stride
													A__		   =							classifier_dropout_prob
													A__		   =							use_labels
													A__		   =							is_training
													A__		   =							num_labels
													A__		   =							initializer_range
													A__		   =							scope
													A__		   =							width_multiplier
													A__		   =							ffn_dropout
													A__		   =							attn_dropout





						def  snake_case__		(				self   )    -> List[str]:
													A__		   =							floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]   )

													A__		   =							None
													A__		   =							None
													if self.use_labels:
																				A__		   =							ids_tensor([self.batch_size]						,self.num_labels   )
																				A__		   =							ids_tensor([self.batch_size, self.image_size, self.image_size]						,self.num_labels   )

													A__		   =							self.get_config()

													return config, pixel_values, labels, pixel_labels





						def  snake_case__		(				self   )    -> Optional[int]:
													return MobileViTVaConfig(
													    image_size=self.image_size						,patch_size=self.patch_size						,num_channels=self.num_channels						,hidden_act=self.hidden_act						,conv_kernel_size=self.conv_kernel_size						,output_stride=self.output_stride						,classifier_dropout_prob=self.classifier_dropout_prob						,initializer_range=self.initializer_range						,width_multiplier=self.width_multiplier						,ffn_dropout=self.ffn_dropout_prob						,attn_dropout=self.attn_dropout_prob						,)





						def  snake_case__		(				self						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase   )    -> Dict:
													A__		   =							MobileViTVaModel(config=__UpperCAmelCase   )
													model.to(__UpperCAmelCase   )
													model.eval()
													A__		   =							model(__UpperCAmelCase   )
													self.parent.assertEqual(
													    result.last_hidden_state.shape						,(
													        self.batch_size,
													        self.last_hidden_size,
													        self.image_size // self.output_stride,
													        self.image_size // self.output_stride,
													    )						,)





						def  snake_case__		(				self						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase   )    -> Any:
													A__		   =							self.num_labels
													A__		   =							MobileViTVaForImageClassification(__UpperCAmelCase   )
													model.to(__UpperCAmelCase   )
													model.eval()
													A__		   =							model(__UpperCAmelCase						,labels=__UpperCAmelCase   )
													self.parent.assertEqual(result.logits.shape						,(self.batch_size, self.num_labels)   )





						def  snake_case__		(				self						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase   )    -> Any:
													A__		   =							self.num_labels
													A__		   =							MobileViTVaForSemanticSegmentation(__UpperCAmelCase   )
													model.to(__UpperCAmelCase   )
													model.eval()
													A__		   =							model(__UpperCAmelCase   )
													self.parent.assertEqual(
													    result.logits.shape						,(
													        self.batch_size,
													        self.num_labels,
													        self.image_size // self.output_stride,
													        self.image_size // self.output_stride,
													    )						,)
													A__		   =							model(__UpperCAmelCase						,labels=__UpperCAmelCase   )
													self.parent.assertEqual(
													    result.logits.shape						,(
													        self.batch_size,
													        self.num_labels,
													        self.image_size // self.output_stride,
													        self.image_size // self.output_stride,
													    )						,)





						def  snake_case__		(				self   )    -> int:
													A__		   =							self.prepare_config_and_inputs()
													A__   ,     A__   ,     A__   ,     A__		   =							config_and_inputs
													A__		   =							{'pixel_values': pixel_values}
													return config, inputs_dict






@require_torch
class 			UpperCamelCase__(	__A						,  __A						,  unittest.TestCase       ):
						lowerCAmelCase__     :  List[str]  							=						(
						    (MobileViTVaModel, MobileViTVaForImageClassification, MobileViTVaForSemanticSegmentation)
						    if is_torch_available()
						    else ()
						)

						lowerCAmelCase__     :  str  							=						(
						    {
						        'feature-extraction': MobileViTVaModel,
						        'image-classification': MobileViTVaForImageClassification,
						        'image-segmentation': MobileViTVaForSemanticSegmentation,
						    }
						    if is_torch_available()
						    else {}
						)

						lowerCAmelCase__     :  List[str]  							=						False
						lowerCAmelCase__     :  str  							=						False
						lowerCAmelCase__     :  Any  							=						False
						lowerCAmelCase__     :  str  							=						False





						def  snake_case__		(				self   )    -> Union[str, Any]:
													A__		   =							MobileViTVaModelTester(self   )
													A__		   =							MobileViTVaConfigTester(self						,config_class=__UpperCAmelCase						,has_text_modality=__UpperCAmelCase   )





						def  snake_case__		(				self   )    -> Tuple:
													self.config_tester.run_common_tests()





						@unittest.skip(reason='MobileViTV2 does not use inputs_embeds'   )
						def  snake_case__		(				self   )    -> int:
													pass





						@unittest.skip(reason='MobileViTV2 does not support input and output embeddings'   )
						def  snake_case__		(				self   )    -> Dict:
													pass





						@unittest.skip(reason='MobileViTV2 does not output attentions'   )
						def  snake_case__		(				self   )    -> str:
													pass





						@require_torch_multi_gpu
						@unittest.skip(reason='Got `CUDA error: misaligned address` for tests after this one being run.'   )
						def  snake_case__		(				self   )    -> Union[str, Any]:
													pass





						@unittest.skip('Will be fixed soon by reducing the size of the model used for common tests.'   )
						def  snake_case__		(				self   )    -> Dict:
													pass





						def  snake_case__		(				self   )    -> Any:
													A__   ,     A__		   =							self.model_tester.prepare_config_and_inputs_for_common()

													for model_class in self.all_model_classes:
																				A__		   =							model_class(__UpperCAmelCase   )
																				A__		   =							inspect.signature(model.forward   )
																				# signature.parameters is an OrderedDict => so arg_names order is deterministic
																				A__		   =							[*signature.parameters.keys()]

																				A__		   =							['pixel_values']
																				self.assertListEqual(arg_names[:1]						,__UpperCAmelCase   )





						def  snake_case__		(				self   )    -> List[Any]:
													A__		   =							self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_model(*__UpperCAmelCase   )





						def  snake_case__		(				self   )    -> Optional[int]:
													def check_hidden_states_output(__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase   ):
																				A__		   =							model_class(__UpperCAmelCase   )
																				model.to(__UpperCAmelCase   )
																				model.eval()

																				with torch.no_grad():
																											A__		   =							model(**self._prepare_for_class(__UpperCAmelCase						,__UpperCAmelCase   )   )

																				A__		   =							outputs.hidden_states

																				A__		   =							5
																				self.assertEqual(len(__UpperCAmelCase   )						,__UpperCAmelCase   )

																				# MobileViTV2's feature maps are of shape (batch_size, num_channels, height, width)
																				# with the width and height being successively divided by 2.
																				A__		   =							2
																				for i in range(len(__UpperCAmelCase   )   ):
																											self.assertListEqual(
																											    list(hidden_states[i].shape[-2:]   )						,[self.model_tester.image_size // divisor, self.model_tester.image_size // divisor]						,)
																											divisor *= 2

																				self.assertEqual(self.model_tester.output_stride						,divisor // 2   )

													A__   ,     A__		   =							self.model_tester.prepare_config_and_inputs_for_common()

													for model_class in self.all_model_classes:
																				A__		   =							True
																				check_hidden_states_output(__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase   )

																				# check that output_hidden_states also work using config
																				del inputs_dict["output_hidden_states"]
																				A__		   =							True

																				check_hidden_states_output(__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase   )





						def  snake_case__		(				self   )    -> List[Any]:
													A__		   =							self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_for_image_classification(*__UpperCAmelCase   )





						def  snake_case__		(				self   )    -> Tuple:
													A__		   =							self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_for_semantic_segmentation(*__UpperCAmelCase   )





						@slow
						def  snake_case__		(				self   )    -> Optional[int]:
													for model_name in MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																				A__		   =							MobileViTVaModel.from_pretrained(__UpperCAmelCase   )
																				self.assertIsNotNone(__UpperCAmelCase   )






def      UpperCAmelCase    (		):






							"""simple docstring"""





							A__		   =							Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png' )
							return image


@require_torch
@require_vision
class 			UpperCamelCase__(	unittest.TestCase       ):





						@cached_property
						def  snake_case__		(				self   )    -> int:
													return (
													    MobileViTImageProcessor.from_pretrained('apple/mobilevitv2-1.0-imagenet1k-256'   )
													    if is_vision_available()
													    else None
													)





						@slow
						def  snake_case__		(				self   )    -> str:
													A__		   =							MobileViTVaForImageClassification.from_pretrained('apple/mobilevitv2-1.0-imagenet1k-256'   ).to(
													    __UpperCAmelCase   )

													A__		   =							self.default_image_processor
													A__		   =							prepare_img()
													A__		   =							image_processor(images=__UpperCAmelCase						,return_tensors='pt'   ).to(__UpperCAmelCase   )

													# forward pass
													with torch.no_grad():
																				A__		   =							model(**__UpperCAmelCase   )

													# verify the logits
													A__		   =							torch.Size((1, 10_00)   )
													self.assertEqual(outputs.logits.shape						,__UpperCAmelCase   )

													A__		   =							torch.tensor([-1.6_336e00, -7.3_204e-02, -5.1_883e-01]   ).to(__UpperCAmelCase   )

													self.assertTrue(torch.allclose(outputs.logits[0, :3]						,__UpperCAmelCase						,atol=1e-4   )   )





						@slow
						def  snake_case__		(				self   )    -> Dict:
													A__		   =							MobileViTVaForSemanticSegmentation.from_pretrained('shehan97/mobilevitv2-1.0-voc-deeplabv3'   )
													A__		   =							model.to(__UpperCAmelCase   )

													A__		   =							MobileViTImageProcessor.from_pretrained('shehan97/mobilevitv2-1.0-voc-deeplabv3'   )

													A__		   =							prepare_img()
													A__		   =							image_processor(images=__UpperCAmelCase						,return_tensors='pt'   ).to(__UpperCAmelCase   )

													# forward pass
													with torch.no_grad():
																				A__		   =							model(**__UpperCAmelCase   )
													A__		   =							outputs.logits

													# verify the logits
													A__		   =							torch.Size((1, 21, 32, 32)   )
													self.assertEqual(logits.shape						,__UpperCAmelCase   )

													A__		   =							torch.tensor(
													    [
													        [[7.0_8_6_3, 7.1_5_2_5, 6.8_2_0_1], [6.6_9_3_1, 6.8_7_7_0, 6.8_9_3_3], [6.2_9_7_8, 7.0_3_6_6, 6.9_6_3_6]],
													        [[-3.7_1_3_4, -3.6_7_1_2, -3.6_6_7_5], [-3.5_8_2_5, -3.3_5_4_9, -3.4_7_7_7], [-3.3_4_3_5, -3.3_9_7_9, -3.2_8_5_7]],
													        [[-2.9_3_2_9, -2.8_0_0_3, -2.7_3_6_9], [-3.0_5_6_4, -2.4_7_8_0, -2.0_2_0_7], [-2.6_8_8_9, -1.9_2_9_8, -1.7_6_4_0]],
													    ]						,device=__UpperCAmelCase						,)

													self.assertTrue(torch.allclose(logits[0, :3, :3, :3]						,__UpperCAmelCase						,atol=1e-4   )   )





						@slow
						def  snake_case__		(				self   )    -> Tuple:
													A__		   =							MobileViTVaForSemanticSegmentation.from_pretrained('shehan97/mobilevitv2-1.0-voc-deeplabv3'   )
													A__		   =							model.to(__UpperCAmelCase   )

													A__		   =							MobileViTImageProcessor.from_pretrained('shehan97/mobilevitv2-1.0-voc-deeplabv3'   )

													A__		   =							prepare_img()
													A__		   =							image_processor(images=__UpperCAmelCase						,return_tensors='pt'   ).to(__UpperCAmelCase   )

													# forward pass
													with torch.no_grad():
																				A__		   =							model(**__UpperCAmelCase   )

													A__		   =							outputs.logits.detach().cpu()

													A__		   =							image_processor.post_process_semantic_segmentation(outputs=__UpperCAmelCase						,target_sizes=[(50, 60)]   )
													A__		   =							torch.Size((50, 60)   )
													self.assertEqual(segmentation[0].shape						,__UpperCAmelCase   )

													A__		   =							image_processor.post_process_semantic_segmentation(outputs=__UpperCAmelCase   )
													A__		   =							torch.Size((32, 32)   )
													self.assertEqual(segmentation[0].shape						,__UpperCAmelCase   )






"""simple docstring"""




from typing import Dict, List, Optional, Union

import numpy as np

from transformers.utils import is_vision_available
from transformers.utils.generic import TensorType

from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
from ...image_transforms import (
    center_crop,
    get_resize_output_image_size,
    normalize,
    rescale,
    resize,
    to_channel_dimension_format,
)
from ...image_utils import (
    IMAGENET_STANDARD_MEAN,
    IMAGENET_STANDARD_STD,
    ChannelDimension,
    ImageInput,
    PILImageResampling,
    is_valid_image,
    to_numpy_array,
    valid_images,
)
from ...utils import logging


if is_vision_available():
				import PIL

__lowerCamelCase							 =     logging.get_logger(__name__)






def      UpperCAmelCase    (		UpperCamelCase__ ):






							"""simple docstring"""





							if isinstance(UpperCamelCase__				,			(list, tuple) ) and isinstance(videos[0]				,			(list, tuple) ) and is_valid_image(videos[0][0] ):
														return videos

							elif isinstance(UpperCamelCase__				,			(list, tuple) ) and is_valid_image(videos[0] ):
														return [videos]

							elif is_valid_image(UpperCamelCase__ ):
														return [[videos]]

							raise ValueError(F'''Could not make batched video from {videos}''' )


class 			UpperCamelCase__(	__A       ):
						lowerCAmelCase__     :  List[Any]  							=						['pixel_values']





						def __init__(				self						,__UpperCAmelCase = True						,__UpperCAmelCase = None						,__UpperCAmelCase = PILImageResampling.BILINEAR						,__UpperCAmelCase = True						,__UpperCAmelCase = None						,__UpperCAmelCase = True						,__UpperCAmelCase = 1 / 2_55						,__UpperCAmelCase = True						,__UpperCAmelCase = True						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,**__UpperCAmelCase						,)    -> None:
													super().__init__(**__UpperCAmelCase   )
													A__		   =							size if size is not None else {'shortest_edge': 2_56}
													A__		   =							get_size_dict(__UpperCAmelCase						,default_to_square=__UpperCAmelCase   )
													A__		   =							crop_size if crop_size is not None else {'height': 2_24, 'width': 2_24}
													A__		   =							get_size_dict(__UpperCAmelCase						,param_name='crop_size'   )

													A__		   =							do_resize
													A__		   =							size
													A__		   =							do_center_crop
													A__		   =							crop_size
													A__		   =							resample
													A__		   =							do_rescale
													A__		   =							rescale_factor
													A__		   =							offset
													A__		   =							do_normalize
													A__		   =							image_mean if image_mean is not None else IMAGENET_STANDARD_MEAN
													A__		   =							image_std if image_std is not None else IMAGENET_STANDARD_STD





						def  snake_case__		(				self						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase = PILImageResampling.BILINEAR						,__UpperCAmelCase = None						,**__UpperCAmelCase						,)    -> np.ndarray:
													A__		   =							get_size_dict(__UpperCAmelCase						,default_to_square=__UpperCAmelCase   )
													if "shortest_edge" in size:
																				A__		   =							get_resize_output_image_size(__UpperCAmelCase						,size['shortest_edge']						,default_to_square=__UpperCAmelCase   )
													elif "height" in size and "width" in size:
																				A__		   =							(size['height'], size['width'])
													else:
																				raise ValueError(f'''Size must have \'height\' and \'width\' or \'shortest_edge\' as keys. Got {size.keys()}'''   )
													return resize(__UpperCAmelCase						,size=__UpperCAmelCase						,resample=__UpperCAmelCase						,data_format=__UpperCAmelCase						,**__UpperCAmelCase   )





						def  snake_case__		(				self						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase = None						,**__UpperCAmelCase						,)    -> np.ndarray:
													A__		   =							get_size_dict(__UpperCAmelCase   )
													if "height" not in size or "width" not in size:
																				raise ValueError(f'''Size must have \'height\' and \'width\' as keys. Got {size.keys()}'''   )
													return center_crop(__UpperCAmelCase						,size=(size['height'], size['width'])						,data_format=__UpperCAmelCase						,**__UpperCAmelCase   )





						def  snake_case__		(				self						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase = True						,__UpperCAmelCase = None						,**__UpperCAmelCase						,)    -> Optional[Any]:
													A__		   =							image.astype(np.floataa   )
													if offset:
																				A__		   =							image - (scale / 2)
													return rescale(__UpperCAmelCase						,scale=__UpperCAmelCase						,data_format=__UpperCAmelCase						,**__UpperCAmelCase   )





						def  snake_case__		(				self						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase						,__UpperCAmelCase = None						,**__UpperCAmelCase						,)    -> np.ndarray:
													return normalize(__UpperCAmelCase						,mean=__UpperCAmelCase						,std=__UpperCAmelCase						,data_format=__UpperCAmelCase						,**__UpperCAmelCase   )





						def  snake_case__		(				self						,__UpperCAmelCase						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = ChannelDimension.FIRST						,)    -> np.ndarray:
													if do_resize and size is None or resample is None:
																				raise ValueError('Size and resample must be specified if do_resize is True.'   )

													if do_center_crop and crop_size is None:
																				raise ValueError('Crop size must be specified if do_center_crop is True.'   )

													if do_rescale and rescale_factor is None:
																				raise ValueError('Rescale factor must be specified if do_rescale is True.'   )

													if do_normalize and (image_mean is None or image_std is None):
																				raise ValueError('Image mean and std must be specified if do_normalize is True.'   )

													if offset and not do_rescale:
																				raise ValueError('For offset, do_rescale must also be set to True.'   )

													# All transformations expect numpy arrays.
													A__		   =							to_numpy_array(__UpperCAmelCase   )

													if do_resize:
																				A__		   =							self.resize(image=__UpperCAmelCase						,size=__UpperCAmelCase						,resample=__UpperCAmelCase   )

													if do_center_crop:
																				A__		   =							self.center_crop(__UpperCAmelCase						,size=__UpperCAmelCase   )

													if do_rescale:
																				A__		   =							self.rescale(image=__UpperCAmelCase						,scale=__UpperCAmelCase						,offset=__UpperCAmelCase   )

													if do_normalize:
																				A__		   =							self.normalize(image=__UpperCAmelCase						,mean=__UpperCAmelCase						,std=__UpperCAmelCase   )

													A__		   =							to_channel_dimension_format(__UpperCAmelCase						,__UpperCAmelCase   )
													return image





						def  snake_case__		(				self						,__UpperCAmelCase						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = None						,__UpperCAmelCase = ChannelDimension.FIRST						,**__UpperCAmelCase						,)    -> PIL.Image.Image:
													A__		   =							do_resize if do_resize is not None else self.do_resize
													A__		   =							resample if resample is not None else self.resample
													A__		   =							do_center_crop if do_center_crop is not None else self.do_center_crop
													A__		   =							do_rescale if do_rescale is not None else self.do_rescale
													A__		   =							rescale_factor if rescale_factor is not None else self.rescale_factor
													A__		   =							offset if offset is not None else self.offset
													A__		   =							do_normalize if do_normalize is not None else self.do_normalize
													A__		   =							image_mean if image_mean is not None else self.image_mean
													A__		   =							image_std if image_std is not None else self.image_std

													A__		   =							size if size is not None else self.size
													A__		   =							get_size_dict(__UpperCAmelCase						,default_to_square=__UpperCAmelCase   )
													A__		   =							crop_size if crop_size is not None else self.crop_size
													A__		   =							get_size_dict(__UpperCAmelCase						,param_name='crop_size'   )

													if not valid_images(__UpperCAmelCase   ):
																				raise ValueError(
																				    'Invalid image type. Must be of type PIL.Image.Image, numpy.ndarray, '
																				    'torch.Tensor, tf.Tensor or jax.ndarray.'   )

													A__		   =							make_batched(__UpperCAmelCase   )

													A__		   =							[
													    [
													        self._preprocess_image(
													            image=__UpperCAmelCase						,do_resize=__UpperCAmelCase						,size=__UpperCAmelCase						,resample=__UpperCAmelCase						,do_center_crop=__UpperCAmelCase						,crop_size=__UpperCAmelCase						,do_rescale=__UpperCAmelCase						,rescale_factor=__UpperCAmelCase						,offset=__UpperCAmelCase						,do_normalize=__UpperCAmelCase						,image_mean=__UpperCAmelCase						,image_std=__UpperCAmelCase						,data_format=__UpperCAmelCase						,)
													        for img in video
													    ]
													    for video in videos
													]

													A__		   =							{'pixel_values': videos}
													return BatchFeature(data=__UpperCAmelCase						,tensor_type=__UpperCAmelCase   )





