


import collections
import inspect
import unittest

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

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


if is_torch_available():
							import torch
							from torch import nn

							from transformers import SwinBackbone, SwinForImageClassification, SwinForMaskedImageModeling, SwinModel
							from transformers.models.swin.modeling_swin import SWIN_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
							from PIL import Image

							from transformers import AutoImageProcessor







class     __lowerCamelCase     :


							"""simple docstring"""

							def __init__(  self						,       UpperCAmelCase						,       UpperCAmelCase=13						,       UpperCAmelCase=32						,       UpperCAmelCase=2						,       UpperCAmelCase=3						,       UpperCAmelCase=16						,       UpperCAmelCase=[1, 2, 1]						,       UpperCAmelCase=[2, 2, 4]						,       UpperCAmelCase=2						,       UpperCAmelCase=2.0						,       UpperCAmelCase=True						,       UpperCAmelCase=0.0						,       UpperCAmelCase=0.0						,       UpperCAmelCase=0.1						,       UpperCAmelCase="gelu"						,       UpperCAmelCase=False						,       UpperCAmelCase=True						,       UpperCAmelCase=0.02						,       UpperCAmelCase=1e-5						,       UpperCAmelCase=True						,       UpperCAmelCase=None						,       UpperCAmelCase=True						,       UpperCAmelCase=10						,       UpperCAmelCase=8						,       UpperCAmelCase=["stage1", "stage2"]						,       UpperCAmelCase=[1, 2]						,       )     ->       Dict:






								'''simple docstring'''






								lowercase_			 = parent
								lowercase_			 = batch_size
								lowercase_			 = image_size
								lowercase_			 = patch_size
								lowercase_			 = num_channels
								lowercase_			 = embed_dim
								lowercase_			 = depths
								lowercase_			 = num_heads
								lowercase_			 = window_size
								lowercase_			 = mlp_ratio
								lowercase_			 = qkv_bias
								lowercase_			 = hidden_dropout_prob
								lowercase_			 = attention_probs_dropout_prob
								lowercase_			 = drop_path_rate
								lowercase_			 = hidden_act
								lowercase_			 = use_absolute_embeddings
								lowercase_			 = patch_norm
								lowercase_			 = layer_norm_eps
								lowercase_			 = initializer_range
								lowercase_			 = is_training
								lowercase_			 = scope
								lowercase_			 = use_labels
								lowercase_			 = type_sequence_label_size
								lowercase_			 = encoder_stride
								lowercase_			 = out_features
								lowercase_			 = out_indices




							def 				A__      (  self  )     ->       List[Any]:






								'''simple docstring'''






								lowercase_			 = floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]  )

								lowercase_			 = None
								if self.use_labels:
									lowercase_			 = ids_tensor([self.batch_size]						,       self.type_sequence_label_size  )

								lowercase_			 = self.get_config()

								return config, pixel_values, labels




							def 				A__      (  self  )     ->       List[Any]:






								'''simple docstring'''






								return SwinConfig(
								    image_size=self.image_size						,       patch_size=self.patch_size						,       num_channels=self.num_channels						,       embed_dim=self.embed_dim						,       depths=self.depths						,       num_heads=self.num_heads						,       window_size=self.window_size						,       mlp_ratio=self.mlp_ratio						,       qkv_bias=self.qkv_bias						,       hidden_dropout_prob=self.hidden_dropout_prob						,       attention_probs_dropout_prob=self.attention_probs_dropout_prob						,       drop_path_rate=self.drop_path_rate						,       hidden_act=self.hidden_act						,       use_absolute_embeddings=self.use_absolute_embeddings						,       path_norm=self.patch_norm						,       layer_norm_eps=self.layer_norm_eps						,       initializer_range=self.initializer_range						,       encoder_stride=self.encoder_stride						,       out_features=self.out_features						,       out_indices=self.out_indices						,       )




							def 				A__      (  self						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase  )     ->       Union[str, Any]:






								'''simple docstring'''






								lowercase_			 = SwinModel(config=UpperCAmelCase  )
								model.to(UpperCAmelCase  )
								model.eval()
								lowercase_			 = model(UpperCAmelCase  )

								lowercase_			 = ((config.image_size // config.patch_size) ** 2) // (4 ** (len(config.depths  ) - 1))
								lowercase_			 = int(config.embed_dim * 2 ** (len(config.depths  ) - 1)  )

								self.parent.assertEqual(result.last_hidden_state.shape						,       (self.batch_size, expected_seq_len, expected_dim)  )




							def 				A__      (  self						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase  )     ->       str:






								'''simple docstring'''






								lowercase_			 = SwinBackbone(config=UpperCAmelCase  )
								model.to(UpperCAmelCase  )
								model.eval()
								lowercase_			 = model(UpperCAmelCase  )

								# verify hidden states
								self.parent.assertEqual(len(result.feature_maps  )						,       len(config.out_features  )  )
								self.parent.assertListEqual(list(result.feature_maps[0].shape  )						,       [self.batch_size, model.channels[0], 16, 16]  )

								# verify channels
								self.parent.assertEqual(len(model.channels  )						,       len(config.out_features  )  )

								# verify backbone works with out_features=None
								lowercase_			 = None
								lowercase_			 = SwinBackbone(config=UpperCAmelCase  )
								model.to(UpperCAmelCase  )
								model.eval()
								lowercase_			 = model(UpperCAmelCase  )

								# verify feature maps
								self.parent.assertEqual(len(result.feature_maps  )						,       1  )
								self.parent.assertListEqual(list(result.feature_maps[0].shape  )						,       [self.batch_size, model.channels[-1], 4, 4]  )

								# verify channels
								self.parent.assertEqual(len(model.channels  )						,       1  )




							def 				A__      (  self						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase  )     ->       str:






								'''simple docstring'''






								lowercase_			 = SwinForMaskedImageModeling(config=UpperCAmelCase  )
								model.to(UpperCAmelCase  )
								model.eval()
								lowercase_			 = model(UpperCAmelCase  )
								self.parent.assertEqual(
								    result.logits.shape						,       (self.batch_size, self.num_channels, self.image_size, self.image_size)  )

								# test greyscale images
								lowercase_			 = 1
								lowercase_			 = SwinForMaskedImageModeling(UpperCAmelCase  )
								model.to(UpperCAmelCase  )
								model.eval()

								lowercase_			 = floats_tensor([self.batch_size, 1, self.image_size, self.image_size]  )
								lowercase_			 = model(UpperCAmelCase  )
								self.parent.assertEqual(result.logits.shape						,       (self.batch_size, 1, self.image_size, self.image_size)  )




							def 				A__      (  self						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase  )     ->       Union[str, Any]:






								'''simple docstring'''






								lowercase_			 = self.type_sequence_label_size
								lowercase_			 = SwinForImageClassification(UpperCAmelCase  )
								model.to(UpperCAmelCase  )
								model.eval()
								lowercase_			 = model(UpperCAmelCase						,       labels=UpperCAmelCase  )
								self.parent.assertEqual(result.logits.shape						,       (self.batch_size, self.type_sequence_label_size)  )

								# test greyscale images
								lowercase_			 = 1
								lowercase_			 = SwinForImageClassification(UpperCAmelCase  )
								model.to(UpperCAmelCase  )
								model.eval()

								lowercase_			 = floats_tensor([self.batch_size, 1, self.image_size, self.image_size]  )
								lowercase_			 = model(UpperCAmelCase  )
								self.parent.assertEqual(result.logits.shape						,       (self.batch_size, self.type_sequence_label_size)  )




							def 				A__      (  self  )     ->       str:






								'''simple docstring'''






								lowercase_			 = self.prepare_config_and_inputs()
								(
								    (
								    lowercase_
								) ,	(
								    lowercase_
								) ,	(
								    lowercase_
								) ,	
								)			 = config_and_inputs
								lowercase_			 = {"pixel_values": pixel_values}
								return config, inputs_dict







@require_torch
class     __lowerCamelCase     (  snake_case_							,   snake_case_							,   unittest.TestCase     ):


							"""simple docstring"""

							lowerCAmelCase__          =				(
							    (
							        SwinModel,
							        SwinBackbone,
							        SwinForImageClassification,
							        SwinForMaskedImageModeling,
							    )
							    if is_torch_available()
							    else ()
							)
							lowerCAmelCase__          =				(
							    {"feature-extraction": SwinModel, "image-classification": SwinForImageClassification}
							    if is_torch_available()
							    else {}
							)
							lowerCAmelCase__          =				True

							lowerCAmelCase__          =				False
							lowerCAmelCase__          =				False
							lowerCAmelCase__          =				False




							def 				A__      (  self  )     ->       str:






								'''simple docstring'''






								lowercase_			 = SwinModelTester(self  )
								lowercase_			 = ConfigTester(self						,       config_class=UpperCAmelCase						,       embed_dim=37  )




							def 				A__      (  self  )     ->       str:






								'''simple docstring'''






								self.create_and_test_config_common_properties()
								self.config_tester.create_and_test_config_to_json_string()
								self.config_tester.create_and_test_config_to_json_file()
								self.config_tester.create_and_test_config_from_and_save_pretrained()
								self.config_tester.create_and_test_config_with_num_labels()
								self.config_tester.check_config_can_be_init_without_params()
								self.config_tester.check_config_arguments_init()




							def 				A__      (  self  )     ->       Optional[int]:






								'''simple docstring'''






								return




							def 				A__      (  self  )     ->       Union[str, Any]:






								'''simple docstring'''






								lowercase_			 = self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_model(*UpperCAmelCase  )




							@unittest.skip(reason="Got `CUDA error: misaligned address` with PyTorch 2.0.0."  )
							def 				A__      (  self  )     ->       Optional[int]:






								'''simple docstring'''






								pass




							def 				A__      (  self  )     ->       int:






								'''simple docstring'''






								super().test_training_gradient_checkpointing()




							def 				A__      (  self  )     ->       List[str]:






								'''simple docstring'''






								lowercase_			 = self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_backbone(*UpperCAmelCase  )




							def 				A__      (  self  )     ->       Any:






								'''simple docstring'''






								lowercase_			 = self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_masked_image_modeling(*UpperCAmelCase  )




							def 				A__      (  self  )     ->       str:






								'''simple docstring'''






								lowercase_			 = self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_image_classification(*UpperCAmelCase  )




							@unittest.skip(reason="Swin does not use inputs_embeds"  )
							def 				A__      (  self  )     ->       Tuple:






								'''simple docstring'''






								pass




							@unittest.skip(reason="Swin Transformer does not use feedforward chunking"  )
							def 				A__      (  self  )     ->       Optional[int]:






								'''simple docstring'''






								pass




							def 				A__      (  self  )     ->       Dict:






								'''simple docstring'''






								lowercase_ ,	lowercase_			 = self.model_tester.prepare_config_and_inputs_for_common()

								for model_class in self.all_model_classes:
									lowercase_			 = model_class(UpperCAmelCase  )
									self.assertIsInstance(model.get_input_embeddings()						,       (nn.Module)  )
									lowercase_			 = model.get_output_embeddings()
									self.assertTrue(x is None or isinstance(UpperCAmelCase						,       nn.Linear  )  )




							def 				A__      (  self  )     ->       Union[str, Any]:






								'''simple docstring'''






								lowercase_ ,	lowercase_			 = self.model_tester.prepare_config_and_inputs_for_common()

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

									lowercase_			 = ["pixel_values"]
									self.assertListEqual(arg_names[:1]						,       UpperCAmelCase  )




							def 				A__      (  self  )     ->       Optional[int]:






								'''simple docstring'''






								lowercase_ ,	lowercase_			 = self.model_tester.prepare_config_and_inputs_for_common()
								lowercase_			 = True

								for model_class in self.all_model_classes:
									lowercase_			 = True
									lowercase_			 = False
									lowercase_			 = True
									lowercase_			 = model_class(UpperCAmelCase  )
									model.to(UpperCAmelCase  )
									model.eval()
									with torch.no_grad():
										lowercase_			 = model(**self._prepare_for_class(UpperCAmelCase						,       UpperCAmelCase  )  )
									lowercase_			 = outputs.attentions
									lowercase_			 = len(self.model_tester.depths  )
									self.assertEqual(len(UpperCAmelCase  )						,       UpperCAmelCase  )

									# check that output_attentions also work using config
									del inputs_dict["output_attentions"]
									lowercase_			 = True
									lowercase_			 = config.window_size**2
									lowercase_			 = model_class(UpperCAmelCase  )
									model.to(UpperCAmelCase  )
									model.eval()
									with torch.no_grad():
										lowercase_			 = model(**self._prepare_for_class(UpperCAmelCase						,       UpperCAmelCase  )  )
									lowercase_			 = outputs.attentions
									self.assertEqual(len(UpperCAmelCase  )						,       UpperCAmelCase  )

									self.assertListEqual(
									    list(attentions[0].shape[-3:]  )						,       [self.model_tester.num_heads[0], window_size_squared, window_size_squared]						,       )
									lowercase_			 = len(UpperCAmelCase  )

									# Check attention is always last and order is fine
									lowercase_			 = True
									lowercase_			 = True
									lowercase_			 = model_class(UpperCAmelCase  )
									model.to(UpperCAmelCase  )
									model.eval()
									with torch.no_grad():
										lowercase_			 = model(**self._prepare_for_class(UpperCAmelCase						,       UpperCAmelCase  )  )

									# also another +1 for reshaped_hidden_states
									lowercase_			 = 1 if model_class.__name__ == "SwinBackbone" else 2
									self.assertEqual(out_len + added_hidden_states						,       len(UpperCAmelCase  )  )

									lowercase_			 = outputs.attentions

									self.assertEqual(len(UpperCAmelCase  )						,       UpperCAmelCase  )

									self.assertListEqual(
									    list(self_attentions[0].shape[-3:]  )						,       [self.model_tester.num_heads[0], window_size_squared, window_size_squared]						,       )




							def 				A__      (  self						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase  )     ->       List[Any]:






								'''simple docstring'''






								lowercase_			 = model_class(UpperCAmelCase  )
								model.to(UpperCAmelCase  )
								model.eval()

								with torch.no_grad():
									lowercase_			 = model(**self._prepare_for_class(UpperCAmelCase						,       UpperCAmelCase  )  )

								lowercase_			 = outputs.hidden_states

								lowercase_			 = getattr(
								    self.model_tester						,       "expected_num_hidden_layers"						,       len(self.model_tester.depths  ) + 1  )
								self.assertEqual(len(UpperCAmelCase  )						,       UpperCAmelCase  )

								# Swin has a different seq_length
								lowercase_			 = (
								    config.patch_size
								    if isinstance(config.patch_size						,       collections.abc.Iterable  )
								    else (config.patch_size, config.patch_size)
								)

								lowercase_			 = (image_size[1] // patch_size[1]) * (image_size[0] // patch_size[0])

								self.assertListEqual(
								    list(hidden_states[0].shape[-2:]  )						,       [num_patches, self.model_tester.embed_dim]						,       )

								if not model_class.__name__ == "SwinBackbone":
									lowercase_			 = outputs.reshaped_hidden_states
									self.assertEqual(len(UpperCAmelCase  )						,       UpperCAmelCase  )

									lowercase_ ,	lowercase_ ,	lowercase_ ,	lowercase_			 = reshaped_hidden_states[0].shape
									lowercase_			 = (
									    reshaped_hidden_states[0].view(UpperCAmelCase						,       UpperCAmelCase						,       height * width  ).permute(0						,       2						,       1  )
									)
									self.assertListEqual(
									    list(reshaped_hidden_states.shape[-2:]  )						,       [num_patches, self.model_tester.embed_dim]						,       )




							def 				A__      (  self  )     ->       Optional[Any]:






								'''simple docstring'''






								lowercase_ ,	lowercase_			 = self.model_tester.prepare_config_and_inputs_for_common()

								lowercase_			 = (
								    self.model_tester.image_size
								    if isinstance(self.model_tester.image_size						,       collections.abc.Iterable  )
								    else (self.model_tester.image_size, self.model_tester.image_size)
								)

								for model_class in self.all_model_classes:
									lowercase_			 = True
									self.check_hidden_states_output(UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase  )

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

									self.check_hidden_states_output(UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase  )




							def 				A__      (  self  )     ->       Optional[Any]:






								'''simple docstring'''






								lowercase_ ,	lowercase_			 = self.model_tester.prepare_config_and_inputs_for_common()
								lowercase_			 = 3

								lowercase_			 = (
								    self.model_tester.image_size
								    if isinstance(self.model_tester.image_size						,       collections.abc.Iterable  )
								    else (self.model_tester.image_size, self.model_tester.image_size)
								)
								lowercase_			 = (
								    config.patch_size
								    if isinstance(config.patch_size						,       collections.abc.Iterable  )
								    else (config.patch_size, config.patch_size)
								)

								lowercase_			 = image_size[0] + patch_size[0] - (image_size[0] % patch_size[0])
								lowercase_			 = image_size[1] + patch_size[1] - (image_size[1] % patch_size[1])

								for model_class in self.all_model_classes:
									lowercase_			 = True
									self.check_hidden_states_output(UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       (padded_height, padded_width)  )

									# check that output_hidden_states also work using config
									del inputs_dict["output_hidden_states"]
									lowercase_			 = True
									self.check_hidden_states_output(UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase						,       (padded_height, padded_width)  )




							@slow
							def 				A__      (  self  )     ->       str:






								'''simple docstring'''






								for model_name in SWIN_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
									lowercase_			 = SwinModel.from_pretrained(UpperCAmelCase  )
									self.assertIsNotNone(UpperCAmelCase  )




							def 				A__      (  self  )     ->       str:






								'''simple docstring'''






								lowercase_ ,	lowercase_			 = self.model_tester.prepare_config_and_inputs_for_common()

								lowercase_			 = _config_zero_init(UpperCAmelCase  )
								for model_class in self.all_model_classes:
									lowercase_			 = model_class(config=UpperCAmelCase  )
									for name, param in model.named_parameters():
										if "embeddings" not in name and param.requires_grad:
											self.assertIn(
											    ((param.data.mean() * 1e9).round() / 1e9).item()						,       [0.0, 1.0]						,       msg=F'Parameter {name} of model {model_class} seems not properly initialized'						,       )







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


							"""simple docstring"""

							@cached_property
							def 				A__      (  self  )     ->       List[Any]:






								'''simple docstring'''






								return (
								    AutoImageProcessor.from_pretrained("microsoft/swin-tiny-patch4-window7-224"  )
								    if is_vision_available()
								    else None
								)




							@slow
							def 				A__      (  self  )     ->       Optional[int]:






								'''simple docstring'''






								lowercase_			 = SwinForImageClassification.from_pretrained("microsoft/swin-tiny-patch4-window7-224"  ).to(UpperCAmelCase  )
								lowercase_			 = self.default_image_processor

								lowercase_			 = Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"  )
								lowercase_			 = image_processor(images=UpperCAmelCase						,       return_tensors="pt"  ).to(UpperCAmelCase  )

								# forward pass
								with torch.no_grad():
									lowercase_			 = model(**UpperCAmelCase  )

								# verify the logits
								lowercase_			 = torch.Size((1, 1000)  )
								self.assertEqual(outputs.logits.shape						,       UpperCAmelCase  )
								lowercase_			 = torch.tensor([-0.0948, -0.6454, -0.0921]  ).to(UpperCAmelCase  )
								self.assertTrue(torch.allclose(outputs.logits[0, :3]						,       UpperCAmelCase						,       atol=1e-4  )  )







@require_torch
class     __lowerCamelCase     (  unittest.TestCase							,   snake_case_     ):


							"""simple docstring"""

							lowerCAmelCase__          =				(SwinBackbone,) if is_torch_available() else ()
							lowerCAmelCase__          =				SwinConfig




							def 				A__      (  self  )     ->       str:






								'''simple docstring'''






								lowercase_			 = SwinModelTester(self  )





import numpy as np
from cva import destroyAllWindows, imread, imshow, waitKey







class     __lowerCamelCase     :


							"""simple docstring"""

							def __init__(  self						,       UpperCAmelCase						,       UpperCAmelCase  )     ->       Tuple:






								'''simple docstring'''






								lowercase_			 = 0
								# max greyscale value for #FFFFFF
								lowercase_			 = int(self.get_greyscale(255						,       255						,       255  )  )

								if not self.min_threshold < threshold < self.max_threshold:
									lowercase_			 = F'Factor value should be from 0 to {self.max_threshold}'
									raise ValueError(UpperCAmelCase  )

								lowercase_			 = input_img
								lowercase_			 = threshold
								lowercase_ ,	lowercase_			 = self.input_img.shape[1], self.input_img.shape[0]

								# error table size (+4 columns and +1 row) greater than input image because of
								# lack of if statements
								lowercase_			 = [
								    [0 for _ in range(self.height + 4  )] for __ in range(self.width + 1  )
								]
								lowercase_			 = np.ones((self.width, self.height, 3)						,       np.uinta  ) * 255




							@classmethod
							def 				A__      (  cls						,       UpperCAmelCase						,       UpperCAmelCase						,       UpperCAmelCase  )     ->       float:






								'''simple docstring'''






								return 0.114 * blue + 0.587 * green + 0.2126 * red




							def 				A__      (  self  )     ->       None:






								'''simple docstring'''






								for y in range(self.height  ):
									for x in range(self.width  ):
										lowercase_			 = int(self.get_greyscale(*self.input_img[y][x]  )  )
										if self.threshold > greyscale + self.error_table[y][x]:
											lowercase_			 = (0, 0, 0)
											lowercase_			 = greyscale + self.error_table[x][y]
										else:
											lowercase_			 = (255, 255, 255)
											lowercase_			 = greyscale + self.error_table[x][y] - 255
										self.error_table[y][x + 1] += int(8 / 32 * current_error  )
										self.error_table[y][x + 2] += int(4 / 32 * current_error  )
										self.error_table[y + 1][x] += int(8 / 32 * current_error  )
										self.error_table[y + 1][x + 1] += int(4 / 32 * current_error  )
										self.error_table[y + 1][x + 2] += int(2 / 32 * current_error  )
										self.error_table[y + 1][x - 1] += int(4 / 32 * current_error  )
										self.error_table[y + 1][x - 2] += int(2 / 32 * current_error  )


if __name__ == "__main__":
							# create Burke's instances with original images in greyscale
							SCREAMING_SNAKE_CASE__       			=				[
							    Burkes(imread("""image_data/lena.jpg""", 1), threshold)
							    for threshold in (1, 1_2_6, 1_3_0, 1_4_0)
							]

							for burkes in burkes_instances:
														burkes.process()

							for burkes in burkes_instances:
														imshow(
														    f"""Original image with dithering threshold: {burkes.threshold}""",
														    burkes.output_img,
														)

							waitKey(0)
							destroyAllWindows()

