



'''simple docstring'''






import argparse
import json

import torch

from diffusers import AutoencoderKL, DDPMPipeline, DDPMScheduler, UNetaDModel, VQModel





def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     List[str] ,       snake_case_    :     Optional[int]=1  )		->int:






							'''simple docstring'''
							if n_shave_prefix_segments >= 0:
														return ".".join(path.split('''.'''  )[n_shave_prefix_segments:]  )
							else:
														return ".".join(path.split('''.'''  )[:n_shave_prefix_segments]  )





def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     List[str] ,       snake_case_    :     List[str]=0  )		->Optional[Any]:






							'''simple docstring'''
							_lowercase							:		Union[str, Any]				=   []
							for old_item in old_list:
														_lowercase							:		Union[str, Any]				=   old_item
														_lowercase							:		Tuple				=   new_item.replace('''block.''' ,       '''resnets.'''  )
														_lowercase							:		Dict				=   new_item.replace('''conv_shorcut''' ,       '''conv1'''  )
														_lowercase							:		Optional[int]				=   new_item.replace('''in_shortcut''' ,       '''conv_shortcut'''  )
														_lowercase							:		Optional[Any]				=   new_item.replace('''temb_proj''' ,       '''time_emb_proj'''  )

														_lowercase							:		Any				=   shave_segments(snake_case_ ,       n_shave_prefix_segments=snake_case_  )

														mapping.append({'''old''': old_item, '''new''': new_item}  )

							return mapping





def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     List[str] ,       snake_case_    :     Tuple=0 ,       snake_case_    :     Optional[int]=False  )		->Tuple:






							'''simple docstring'''
							_lowercase							:		str				=   []
							for old_item in old_list:
														_lowercase							:		Dict				=   old_item

														# In `model.mid`, the layer is called `attn`.
														if not in_mid:
																					_lowercase							:		Union[str, Any]				=   new_item.replace('''attn''' ,       '''attentions'''  )
														_lowercase							:		Dict				=   new_item.replace('''.k.''' ,       '''.key.'''  )
														_lowercase							:		Dict				=   new_item.replace('''.v.''' ,       '''.value.'''  )
														_lowercase							:		List[Any]				=   new_item.replace('''.q.''' ,       '''.query.'''  )

														_lowercase							:		List[str]				=   new_item.replace('''proj_out''' ,       '''proj_attn'''  )
														_lowercase							:		List[Any]				=   new_item.replace('''norm''' ,       '''group_norm'''  )

														_lowercase							:		str				=   shave_segments(snake_case_ ,       n_shave_prefix_segments=snake_case_  )
														mapping.append({'''old''': old_item, '''new''': new_item}  )

							return mapping





def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     Any ,       snake_case_    :     Any ,       snake_case_    :     Optional[Any] ,       snake_case_    :     str=None ,       snake_case_    :     Tuple=None ,       snake_case_    :     Tuple=None  )		->Dict:






							'''simple docstring'''
							assert isinstance(snake_case_ ,       snake_case_  ), "Paths should be a list of dicts containing 'old' and 'new' keys."

							if attention_paths_to_split is not None:
														if config is None:
																					raise ValueError('''Please specify the config if setting \'attention_paths_to_split\' to \'True\'.'''  )

														for path, path_map in attention_paths_to_split.items():
																					_lowercase							:		List[Any]				=   old_checkpoint[path]
																					_lowercase							:		Any				=   old_tensor.shape[0] // 3

																					_lowercase							:		List[Any]				=   (-1, channels) if len(old_tensor.shape  ) == 3 else (-1)

																					_lowercase							:		List[str]				=   old_tensor.shape[0] // config.get('''num_head_channels''' ,       1  ) // 3

																					_lowercase							:		Union[str, Any]				=   old_tensor.reshape((num_heads, 3 * channels // num_heads) + old_tensor.shape[1:]  )
																					_lowercase							:		List[Any]				=   old_tensor.split(channels // num_heads ,       dim=1  )

																					_lowercase							:		Any				=   query.reshape(snake_case_  ).squeeze()
																					_lowercase							:		Tuple				=   key.reshape(snake_case_  ).squeeze()
																					_lowercase							:		Tuple				=   value.reshape(snake_case_  ).squeeze()

							for path in paths:
														_lowercase							:		Union[str, Any]				=   path['new']

														if attention_paths_to_split is not None and new_path in attention_paths_to_split:
																					continue

														_lowercase							:		List[Any]				=   new_path.replace('''down.''' ,       '''down_blocks.'''  )
														_lowercase							:		str				=   new_path.replace('''up.''' ,       '''up_blocks.'''  )

														if additional_replacements is not None:
																					for replacement in additional_replacements:
																												_lowercase							:		Optional[Any]				=   new_path.replace(replacement['''old'''] ,       replacement['''new''']  )

														if "attentions" in new_path:
																					_lowercase							:		str				=   old_checkpoint[path['old']].squeeze()
														else:
																					_lowercase							:		str				=   old_checkpoint[path['old']]





def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     List[str] ,       snake_case_    :     Any  )		->Dict:






							'''simple docstring'''
							_lowercase							:		List[str]				=   {}

							_lowercase							:		int				=   checkpoint['temb.dense.0.weight']
							_lowercase							:		Union[str, Any]				=   checkpoint['temb.dense.0.bias']
							_lowercase							:		str				=   checkpoint['temb.dense.1.weight']
							_lowercase							:		Tuple				=   checkpoint['temb.dense.1.bias']

							_lowercase							:		Tuple				=   checkpoint['norm_out.weight']
							_lowercase							:		Any				=   checkpoint['norm_out.bias']

							_lowercase							:		int				=   checkpoint['conv_in.weight']
							_lowercase							:		Dict				=   checkpoint['conv_in.bias']
							_lowercase							:		Any				=   checkpoint['conv_out.weight']
							_lowercase							:		Any				=   checkpoint['conv_out.bias']

							_lowercase							:		int				=   len({'''.'''.join(layer.split('''.'''  )[:2]  ) for layer in checkpoint if '''down''' in layer}  )
							_lowercase							:		Any				=   {
							    layer_id: [key for key in checkpoint if F"down.{layer_id}" in key] for layer_id in range(snake_case_  )
							}

							_lowercase							:		Dict				=   len({'''.'''.join(layer.split('''.'''  )[:2]  ) for layer in checkpoint if '''up''' in layer}  )
							_lowercase							:		Optional[Any]				=   {layer_id: [key for key in checkpoint if F"up.{layer_id}" in key] for layer_id in range(snake_case_  )}

							for i in range(snake_case_  ):
														_lowercase							:		Any				=   (i - 1) // (config['layers_per_block'] + 1)

														if any('''downsample''' in layer for layer in down_blocks[i]  ):
																					_lowercase							:		Dict				=   checkpoint[
																					    F"down.{i}.downsample.op.weight"
																					]
																					_lowercase							:		List[str]				=   checkpoint[F"down.{i}.downsample.op.bias"]
														#            new_checkpoint[f'down_blocks.{i}.downsamplers.0.op.weight'] = checkpoint[f'down.{i}.downsample.conv.weight']
														#            new_checkpoint[f'down_blocks.{i}.downsamplers.0.op.bias'] = checkpoint[f'down.{i}.downsample.conv.bias']

														if any('''block''' in layer for layer in down_blocks[i]  ):
																					_lowercase							:		int				=   len(
																					    {'''.'''.join(shave_segments(snake_case_ ,       2  ).split('''.'''  )[:2]  ) for layer in down_blocks[i] if '''block''' in layer}  )
																					_lowercase							:		int				=   {
																					    layer_id: [key for key in down_blocks[i] if F"block.{layer_id}" in key]
																					    for layer_id in range(snake_case_  )
																					}

																					if num_blocks > 0:
																												for j in range(config['''layers_per_block''']  ):
																																			_lowercase							:		List[str]				=   renew_resnet_paths(blocks[j]  )
																																			assign_to_checkpoint(snake_case_ ,       snake_case_ ,       snake_case_  )

														if any('''attn''' in layer for layer in down_blocks[i]  ):
																					_lowercase							:		Dict				=   len(
																					    {'''.'''.join(shave_segments(snake_case_ ,       2  ).split('''.'''  )[:2]  ) for layer in down_blocks[i] if '''attn''' in layer}  )
																					_lowercase							:		Optional[int]				=   {
																					    layer_id: [key for key in down_blocks[i] if F"attn.{layer_id}" in key]
																					    for layer_id in range(snake_case_  )
																					}

																					if num_attn > 0:
																												for j in range(config['''layers_per_block''']  ):
																																			_lowercase							:		Any				=   renew_attention_paths(attns[j]  )
																																			assign_to_checkpoint(snake_case_ ,       snake_case_ ,       snake_case_ ,       config=snake_case_  )

							_lowercase							:		Union[str, Any]				=   [key for key in checkpoint if 'mid.block_1' in key]
							_lowercase							:		List[Any]				=   [key for key in checkpoint if 'mid.block_2' in key]
							_lowercase							:		Union[str, Any]				=   [key for key in checkpoint if 'mid.attn_1' in key]

							# Mid new 2
							_lowercase							:		int				=   renew_resnet_paths(snake_case_  )
							assign_to_checkpoint(
							    snake_case_ ,       snake_case_ ,       snake_case_ ,       additional_replacements=[{'''old''': '''mid.''', '''new''': '''mid_new_2.'''}, {'''old''': '''block_1''', '''new''': '''resnets.0'''}] ,       )

							_lowercase							:		Any				=   renew_resnet_paths(snake_case_  )
							assign_to_checkpoint(
							    snake_case_ ,       snake_case_ ,       snake_case_ ,       additional_replacements=[{'''old''': '''mid.''', '''new''': '''mid_new_2.'''}, {'''old''': '''block_2''', '''new''': '''resnets.1'''}] ,       )

							_lowercase							:		Optional[int]				=   renew_attention_paths(snake_case_ ,       in_mid=snake_case_  )
							assign_to_checkpoint(
							    snake_case_ ,       snake_case_ ,       snake_case_ ,       additional_replacements=[{'''old''': '''mid.''', '''new''': '''mid_new_2.'''}, {'''old''': '''attn_1''', '''new''': '''attentions.0'''}] ,       )

							for i in range(snake_case_  ):
														_lowercase							:		List[Any]				=   num_up_blocks - 1 - i

														if any('''upsample''' in layer for layer in up_blocks[i]  ):
																					_lowercase							:		List[Any]				=   checkpoint[
																					    F"up.{i}.upsample.conv.weight"
																					]
																					_lowercase							:		Optional[int]				=   checkpoint[F"up.{i}.upsample.conv.bias"]

														if any('''block''' in layer for layer in up_blocks[i]  ):
																					_lowercase							:		int				=   len(
																					    {'''.'''.join(shave_segments(snake_case_ ,       2  ).split('''.'''  )[:2]  ) for layer in up_blocks[i] if '''block''' in layer}  )
																					_lowercase							:		List[str]				=   {
																					    layer_id: [key for key in up_blocks[i] if F"block.{layer_id}" in key] for layer_id in range(snake_case_  )
																					}

																					if num_blocks > 0:
																												for j in range(config['''layers_per_block'''] + 1  ):
																																			_lowercase							:		Tuple				=   {'old': F"up_blocks.{i}", 'new': F"up_blocks.{block_id}"}
																																			_lowercase							:		int				=   renew_resnet_paths(blocks[j]  )
																																			assign_to_checkpoint(snake_case_ ,       snake_case_ ,       snake_case_ ,       additional_replacements=[replace_indices]  )

														if any('''attn''' in layer for layer in up_blocks[i]  ):
																					_lowercase							:		List[str]				=   len(
																					    {'''.'''.join(shave_segments(snake_case_ ,       2  ).split('''.'''  )[:2]  ) for layer in up_blocks[i] if '''attn''' in layer}  )
																					_lowercase							:		Union[str, Any]				=   {
																					    layer_id: [key for key in up_blocks[i] if F"attn.{layer_id}" in key] for layer_id in range(snake_case_  )
																					}

																					if num_attn > 0:
																												for j in range(config['''layers_per_block'''] + 1  ):
																																			_lowercase							:		List[str]				=   {'old': F"up_blocks.{i}", 'new': F"up_blocks.{block_id}"}
																																			_lowercase							:		Union[str, Any]				=   renew_attention_paths(attns[j]  )
																																			assign_to_checkpoint(snake_case_ ,       snake_case_ ,       snake_case_ ,       additional_replacements=[replace_indices]  )

							_lowercase							:		Optional[Any]				=   {k.replace('''mid_new_2''' ,       '''mid_block'''  ): v for k, v in new_checkpoint.items()}
							return new_checkpoint





def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     List[str] ,       snake_case_    :     Union[str, Any]  )		->Optional[int]:






							'''simple docstring'''
							_lowercase							:		Union[str, Any]				=   {}

							_lowercase							:		Any				=   checkpoint['encoder.norm_out.weight']
							_lowercase							:		Tuple				=   checkpoint['encoder.norm_out.bias']

							_lowercase							:		Any				=   checkpoint['encoder.conv_in.weight']
							_lowercase							:		Any				=   checkpoint['encoder.conv_in.bias']
							_lowercase							:		Union[str, Any]				=   checkpoint['encoder.conv_out.weight']
							_lowercase							:		Dict				=   checkpoint['encoder.conv_out.bias']

							_lowercase							:		List[str]				=   checkpoint['decoder.norm_out.weight']
							_lowercase							:		List[Any]				=   checkpoint['decoder.norm_out.bias']

							_lowercase							:		Optional[Any]				=   checkpoint['decoder.conv_in.weight']
							_lowercase							:		Union[str, Any]				=   checkpoint['decoder.conv_in.bias']
							_lowercase							:		str				=   checkpoint['decoder.conv_out.weight']
							_lowercase							:		int				=   checkpoint['decoder.conv_out.bias']

							_lowercase							:		Tuple				=   len({'''.'''.join(layer.split('''.'''  )[:3]  ) for layer in checkpoint if '''down''' in layer}  )
							_lowercase							:		List[Any]				=   {
							    layer_id: [key for key in checkpoint if F"down.{layer_id}" in key] for layer_id in range(snake_case_  )
							}

							_lowercase							:		Optional[int]				=   len({'''.'''.join(layer.split('''.'''  )[:3]  ) for layer in checkpoint if '''up''' in layer}  )
							_lowercase							:		Optional[Any]				=   {layer_id: [key for key in checkpoint if F"up.{layer_id}" in key] for layer_id in range(snake_case_  )}

							for i in range(snake_case_  ):
														_lowercase							:		Any				=   (i - 1) // (config['layers_per_block'] + 1)

														if any('''downsample''' in layer for layer in down_blocks[i]  ):
																					_lowercase							:		Optional[int]				=   checkpoint[
																					    F"encoder.down.{i}.downsample.conv.weight"
																					]
																					_lowercase							:		Any				=   checkpoint[
																					    F"encoder.down.{i}.downsample.conv.bias"
																					]

														if any('''block''' in layer for layer in down_blocks[i]  ):
																					_lowercase							:		List[Any]				=   len(
																					    {'''.'''.join(shave_segments(snake_case_ ,       3  ).split('''.'''  )[:3]  ) for layer in down_blocks[i] if '''block''' in layer}  )
																					_lowercase							:		Union[str, Any]				=   {
																					    layer_id: [key for key in down_blocks[i] if F"block.{layer_id}" in key]
																					    for layer_id in range(snake_case_  )
																					}

																					if num_blocks > 0:
																												for j in range(config['''layers_per_block''']  ):
																																			_lowercase							:		Union[str, Any]				=   renew_resnet_paths(blocks[j]  )
																																			assign_to_checkpoint(snake_case_ ,       snake_case_ ,       snake_case_  )

														if any('''attn''' in layer for layer in down_blocks[i]  ):
																					_lowercase							:		Union[str, Any]				=   len(
																					    {'''.'''.join(shave_segments(snake_case_ ,       3  ).split('''.'''  )[:3]  ) for layer in down_blocks[i] if '''attn''' in layer}  )
																					_lowercase							:		Union[str, Any]				=   {
																					    layer_id: [key for key in down_blocks[i] if F"attn.{layer_id}" in key]
																					    for layer_id in range(snake_case_  )
																					}

																					if num_attn > 0:
																												for j in range(config['''layers_per_block''']  ):
																																			_lowercase							:		Dict				=   renew_attention_paths(attns[j]  )
																																			assign_to_checkpoint(snake_case_ ,       snake_case_ ,       snake_case_ ,       config=snake_case_  )

							_lowercase							:		Union[str, Any]				=   [key for key in checkpoint if 'mid.block_1' in key]
							_lowercase							:		Any				=   [key for key in checkpoint if 'mid.block_2' in key]
							_lowercase							:		Tuple				=   [key for key in checkpoint if 'mid.attn_1' in key]

							# Mid new 2
							_lowercase							:		Dict				=   renew_resnet_paths(snake_case_  )
							assign_to_checkpoint(
							    snake_case_ ,       snake_case_ ,       snake_case_ ,       additional_replacements=[{'''old''': '''mid.''', '''new''': '''mid_new_2.'''}, {'''old''': '''block_1''', '''new''': '''resnets.0'''}] ,       )

							_lowercase							:		str				=   renew_resnet_paths(snake_case_  )
							assign_to_checkpoint(
							    snake_case_ ,       snake_case_ ,       snake_case_ ,       additional_replacements=[{'''old''': '''mid.''', '''new''': '''mid_new_2.'''}, {'''old''': '''block_2''', '''new''': '''resnets.1'''}] ,       )

							_lowercase							:		List[Any]				=   renew_attention_paths(snake_case_ ,       in_mid=snake_case_  )
							assign_to_checkpoint(
							    snake_case_ ,       snake_case_ ,       snake_case_ ,       additional_replacements=[{'''old''': '''mid.''', '''new''': '''mid_new_2.'''}, {'''old''': '''attn_1''', '''new''': '''attentions.0'''}] ,       )

							for i in range(snake_case_  ):
														_lowercase							:		Any				=   num_up_blocks - 1 - i

														if any('''upsample''' in layer for layer in up_blocks[i]  ):
																					_lowercase							:		Optional[int]				=   checkpoint[
																					    F"decoder.up.{i}.upsample.conv.weight"
																					]
																					_lowercase							:		List[str]				=   checkpoint[
																					    F"decoder.up.{i}.upsample.conv.bias"
																					]

														if any('''block''' in layer for layer in up_blocks[i]  ):
																					_lowercase							:		Tuple				=   len(
																					    {'''.'''.join(shave_segments(snake_case_ ,       3  ).split('''.'''  )[:3]  ) for layer in up_blocks[i] if '''block''' in layer}  )
																					_lowercase							:		Any				=   {
																					    layer_id: [key for key in up_blocks[i] if F"block.{layer_id}" in key] for layer_id in range(snake_case_  )
																					}

																					if num_blocks > 0:
																												for j in range(config['''layers_per_block'''] + 1  ):
																																			_lowercase							:		Any				=   {'old': F"up_blocks.{i}", 'new': F"up_blocks.{block_id}"}
																																			_lowercase							:		Tuple				=   renew_resnet_paths(blocks[j]  )
																																			assign_to_checkpoint(snake_case_ ,       snake_case_ ,       snake_case_ ,       additional_replacements=[replace_indices]  )

														if any('''attn''' in layer for layer in up_blocks[i]  ):
																					_lowercase							:		Union[str, Any]				=   len(
																					    {'''.'''.join(shave_segments(snake_case_ ,       3  ).split('''.'''  )[:3]  ) for layer in up_blocks[i] if '''attn''' in layer}  )
																					_lowercase							:		List[str]				=   {
																					    layer_id: [key for key in up_blocks[i] if F"attn.{layer_id}" in key] for layer_id in range(snake_case_  )
																					}

																					if num_attn > 0:
																												for j in range(config['''layers_per_block'''] + 1  ):
																																			_lowercase							:		Dict				=   {'old': F"up_blocks.{i}", 'new': F"up_blocks.{block_id}"}
																																			_lowercase							:		Dict				=   renew_attention_paths(attns[j]  )
																																			assign_to_checkpoint(snake_case_ ,       snake_case_ ,       snake_case_ ,       additional_replacements=[replace_indices]  )

							_lowercase							:		Optional[Any]				=   {k.replace('''mid_new_2''' ,       '''mid_block'''  ): v for k, v in new_checkpoint.items()}
							_lowercase							:		str				=   checkpoint['quant_conv.weight']
							_lowercase							:		str				=   checkpoint['quant_conv.bias']
							if "quantize.embedding.weight" in checkpoint:
														_lowercase							:		int				=   checkpoint['quantize.embedding.weight']
							_lowercase							:		Dict				=   checkpoint['post_quant_conv.weight']
							_lowercase							:		Optional[Any]				=   checkpoint['post_quant_conv.bias']

							return new_checkpoint


if __name__ == "__main__":
						lowerCamelCase__	  =		argparse.ArgumentParser()

						parser.add_argument(
						    '--checkpoint_path', default=None, type=str, required=True, help='Path to the checkpoint to convert.'
						)

						parser.add_argument(
						    '--config_file',
						    default=None,
						    type=str,
						    required=True,
						    help='The config json file corresponding to the architecture.',
						)

						parser.add_argument('--dump_path', default=None, type=str, required=True, help='Path to the output model.')

						lowerCamelCase__	  =		parser.parse_args()
						lowerCamelCase__	  =		torch.load(args.checkpoint_path)

						with open(args.config_file) as f:
												lowerCamelCase__	  =		json.loads(f.read())

						# unet case
						lowerCamelCase__	  =		{key.split('.')[0] for key in checkpoint.keys()}
						if "encoder" in key_prefix_set and "decoder" in key_prefix_set:
												lowerCamelCase__	  =		convert_vq_autoenc_checkpoint(checkpoint, config)
						else:
												lowerCamelCase__	  =		convert_ddpm_checkpoint(checkpoint, config)

						if "ddpm" in config:
												del config["ddpm"]

						if config["_class_name"] == "VQModel":
												lowerCamelCase__	  =		VQModel(**config)
												model.load_state_dict(converted_checkpoint)
												model.save_pretrained(args.dump_path)
						elif config["_class_name"] == "AutoencoderKL":
												lowerCamelCase__	  =		AutoencoderKL(**config)
												model.load_state_dict(converted_checkpoint)
												model.save_pretrained(args.dump_path)
						else:
												lowerCamelCase__	  =		UNetaDModel(**config)
												model.load_state_dict(converted_checkpoint)

												lowerCamelCase__	  =		DDPMScheduler.from_config('/'.join(args.checkpoint_path.split('/')[:-1]))

												lowerCamelCase__	  =		DDPMPipeline(unet=model, scheduler=scheduler)
												pipe.save_pretrained(args.dump_path)






from ..utils import DummyObject, requires_backends


class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)



class      lowerCamelCase_ (			metaclass=_lowerCAmelCase):
 _lowerCAmelCase									=	['''vision''']




 def __init__(			self  ,  *_UpperCAmelCase  ,  **_UpperCAmelCase							):
   requires_backends(self  ,  ['vision']							)





