


'''simple docstring'''



import inspect
import unittest

import numpy as np

from tests.test_modeling_common import floats_tensor
from transformers import DetrConfig, MaskFormerConfig, SwinConfig, is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_torch_multi_gpu, require_vision, slow, torch_device
from transformers.utils import cached_property

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
			import torch

			from transformers import MaskFormerForInstanceSegmentation, MaskFormerModel

			if is_vision_available():
						from transformers import MaskFormerImageProcessor

if is_vision_available():
			from PIL import Image






class 	UpperCamelCase__:




				def __init__(		self      :			Tuple				,   lowerCAmelCase      :			List[Any]				,   lowerCAmelCase      :			str=2				,   lowerCAmelCase      :			Optional[int]=True				,   lowerCAmelCase      :			Optional[Any]=False				,   lowerCAmelCase      :			Union[str, Any]=10				,   lowerCAmelCase      :			str=3				,   lowerCAmelCase      :			List[Any]=32 * 4				,   lowerCAmelCase      :			Dict=32 * 6				,   lowerCAmelCase      :			Union[str, Any]=4				,   lowerCAmelCase      :			str=32				,   )->					Tuple:

										"""simple docstring"""




										UpperCAmelCase					    =     parent
										UpperCAmelCase					    =     batch_size
										UpperCAmelCase					    =     is_training
										UpperCAmelCase					    =     use_auxiliary_loss
										UpperCAmelCase					    =     num_queries
										UpperCAmelCase					    =     num_channels
										UpperCAmelCase					    =     min_size
										UpperCAmelCase					    =     max_size
										UpperCAmelCase					    =     num_labels
										UpperCAmelCase					    =     mask_feature_size




				def 					a__(		self      :			Tuple				)->					str:

										"""simple docstring"""




										UpperCAmelCase					    =     floats_tensor([self.batch_size, self.num_channels, self.min_size, self.max_size]				).to(
										    a__				)

										UpperCAmelCase					    =     torch.ones([self.batch_size, self.min_size, self.max_size]				,   device=a__				)

										UpperCAmelCase					    =     (
										    torch.rand([self.batch_size, self.num_labels, self.min_size, self.max_size]				,   device=a__				) > 0.5
										).float()
										UpperCAmelCase					    =     (torch.rand((self.batch_size, self.num_labels)				,   device=a__				) > 0.5).long()

										UpperCAmelCase					    =     self.get_config()
										return config, pixel_values, pixel_mask, mask_labels, class_labels




				def 					a__(		self      :			List[Any]				)->					Tuple:

										"""simple docstring"""




										return MaskFormerConfig.from_backbone_and_decoder_configs(
										    backbone_config=SwinConfig(
										        depths=[1, 1, 1, 1]				,   )				,   decoder_config=DetrConfig(
										        decoder_ffn_dim=128				,   num_queries=self.num_queries				,   decoder_attention_heads=2				,   d_model=self.mask_feature_size				,   )				,   mask_feature_size=self.mask_feature_size				,   fpn_feature_size=self.mask_feature_size				,   num_channels=self.num_channels				,   num_labels=self.num_labels				,   )




				def 					a__(		self      :			Optional[int]				)->					Optional[Any]:

										"""simple docstring"""




										UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase					    =     self.prepare_config_and_inputs()
										UpperCAmelCase					    =     {'''pixel_values''': pixel_values, '''pixel_mask''': pixel_mask}
										return config, inputs_dict




				def 					a__(		self      :			Any				,   lowerCAmelCase      :			Dict				,   lowerCAmelCase      :			Optional[int]				)->					List[str]:

										"""simple docstring"""




										UpperCAmelCase					    =     output.encoder_hidden_states
										UpperCAmelCase					    =     output.pixel_decoder_hidden_states
										UpperCAmelCase					    =     output.transformer_decoder_hidden_states

										self.parent.assertTrue(len(a__				)				,   len(config.backbone_config.depths				)				)
										self.parent.assertTrue(len(a__				)				,   len(config.backbone_config.depths				)				)
										self.parent.assertTrue(len(a__				)				,   config.decoder_config.decoder_layers				)




				def 					a__(		self      :			List[Any]				,   lowerCAmelCase      :			List[str]				,   lowerCAmelCase      :			Any				,   lowerCAmelCase      :			Tuple				,   lowerCAmelCase      :			Tuple=False				)->					Optional[Any]:

										"""simple docstring"""




										with torch.no_grad():
																UpperCAmelCase					    =     MaskFormerModel(config=a__				)
																model.to(a__				)
																model.eval()

																UpperCAmelCase					    =     model(pixel_values=a__				,   pixel_mask=a__				)
																UpperCAmelCase					    =     model(a__				,   output_hidden_states=a__				)
										# the correct shape of output.transformer_decoder_hidden_states ensure the correcteness of the
										# encoder and pixel decoder
										self.parent.assertEqual(
										    output.transformer_decoder_last_hidden_state.shape				,   (self.batch_size, self.num_queries, self.mask_feature_size)				,   )
										# let's ensure the other two hidden state exists
										self.parent.assertTrue(output.pixel_decoder_last_hidden_state is not None				)
										self.parent.assertTrue(output.encoder_last_hidden_state is not None				)

										if output_hidden_states:
																self.check_output_hidden_state(a__				,   a__				)





				def 					a__(		self      :			Tuple				,   lowerCAmelCase      :			Union[str, Any]				,   lowerCAmelCase      :			List[str]				,   lowerCAmelCase      :			Tuple				,   lowerCAmelCase      :			Optional[Any]				,   lowerCAmelCase      :			Tuple				)->					Any:

										"""simple docstring"""




										UpperCAmelCase					    =     MaskFormerForInstanceSegmentation(config=a__				)
										model.to(a__				)
										model.eval()

										def comm_check_on_output(lowerCAmelCase      :			Union[str, Any]				):
																# let's still check that all the required stuff is there
																self.parent.assertTrue(result.transformer_decoder_last_hidden_state is not None				)
																self.parent.assertTrue(result.pixel_decoder_last_hidden_state is not None				)
																self.parent.assertTrue(result.encoder_last_hidden_state is not None				)
																# okay, now we need to check the logits shape
																# due to the encoder compression, masks have a //4 spatial size
																self.parent.assertEqual(
																    result.masks_queries_logits.shape				,   (self.batch_size, self.num_queries, self.min_size // 4, self.max_size // 4)				,   )
																# + 1 for null class
																self.parent.assertEqual(
																    result.class_queries_logits.shape				,   (self.batch_size, self.num_queries, self.num_labels + 1)				)

										with torch.no_grad():
																UpperCAmelCase					    =     model(pixel_values=a__				,   pixel_mask=a__				)
																UpperCAmelCase					    =     model(a__				)

																comm_check_on_output(a__				)

																UpperCAmelCase					    =     model(
																    pixel_values=a__				,   pixel_mask=a__				,   mask_labels=a__				,   class_labels=a__				)

										comm_check_on_output(a__				)

										self.parent.assertTrue(result.loss is not None				)
										self.parent.assertEqual(result.loss.shape				,   torch.Size([1]				)				)







@require_torch
class 	UpperCamelCase__(       lowerCAmelCase__						,    lowerCAmelCase__						,    unittest.TestCase	):
				__magic_name__    :				Optional[int]  		=	(MaskFormerModel, MaskFormerForInstanceSegmentation) if is_torch_available() else ()
				__magic_name__    :				Optional[Any]  		=	(
				    {"feature-extraction": MaskFormerModel, "image-segmentation": MaskFormerForInstanceSegmentation}
				    if is_torch_available()
				    else {}
				)

				__magic_name__    :				Union[str, Any]  		=	False
				__magic_name__    :				Tuple  		=	False
				__magic_name__    :				int  		=	False
				__magic_name__    :				List[str]  		=	False




				def 					a__(		self      :			List[str]				)->					Optional[int]:

										"""simple docstring"""




										UpperCAmelCase					    =     MaskFormerModelTester(self				)
										UpperCAmelCase					    =     ConfigTester(self				,   config_class=a__				,   has_text_modality=a__				)




				def 					a__(		self      :			Dict				)->					Optional[Any]:

										"""simple docstring"""




										self.config_tester.run_common_tests()




				def 					a__(		self      :			int				)->					List[Any]:

										"""simple docstring"""




										UpperCAmelCase    ,    UpperCAmelCase					    =     self.model_tester.prepare_config_and_inputs_for_common()
										self.model_tester.create_and_check_maskformer_model(a__				,   **a__				,   output_hidden_states=a__				)




				def 					a__(		self      :			Optional[int]				)->					str:

										"""simple docstring"""




										UpperCAmelCase					    =     self.model_tester.prepare_config_and_inputs()
										self.model_tester.create_and_check_maskformer_instance_segmentation_head_model(*a__				)




				@unittest.skip(reason='''MaskFormer does not use inputs_embeds'''				)
				def 					a__(		self      :			List[Any]				)->					int:

										"""simple docstring"""




										pass




				@unittest.skip(reason='''MaskFormer does not have a get_input_embeddings method'''				)
				def 					a__(		self      :			int				)->					List[Any]:

										"""simple docstring"""




										pass




				@unittest.skip(reason='''MaskFormer is not a generative model'''				)
				def 					a__(		self      :			Optional[int]				)->					List[str]:

										"""simple docstring"""




										pass




				@unittest.skip(reason='''MaskFormer does not use token embeddings'''				)
				def 					a__(		self      :			int				)->					Union[str, Any]:

										"""simple docstring"""




										pass




				@require_torch_multi_gpu
				@unittest.skip(
				    reason='''MaskFormer has some layers using `add_module` which doesn\'t work well with `nn.DataParallel`'''				)
				def 					a__(		self      :			int				)->					Tuple:

										"""simple docstring"""




										pass




				@unittest.skip('''Will be fixed soon by reducing the size of the model used for common tests.'''				)
				def 					a__(		self      :			List[str]				)->					List[Any]:

										"""simple docstring"""




										pass




				def 					a__(		self      :			Tuple				)->					Any:

										"""simple docstring"""




										UpperCAmelCase    ,    UpperCAmelCase					    =     self.model_tester.prepare_config_and_inputs_for_common()

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

																UpperCAmelCase					    =     ['''pixel_values''']
																self.assertListEqual(arg_names[:1]				,   a__				)




				@slow
				def 					a__(		self      :			Dict				)->					str:

										"""simple docstring"""




										for model_name in ["facebook/maskformer-swin-small-coco"]:
																UpperCAmelCase					    =     MaskFormerModel.from_pretrained(a__				)
																self.assertIsNotNone(a__				)




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

										"""simple docstring"""




										UpperCAmelCase					    =     (self.model_tester.min_size,) * 2
										UpperCAmelCase					    =     {
										    '''pixel_values''': torch.randn((2, 3, *size)				,   device=a__				),
										    '''mask_labels''': torch.randn((2, 10, *size)				,   device=a__				),
										    '''class_labels''': torch.zeros(2				,   10				,   device=a__				).long(),
										}

										UpperCAmelCase					    =     MaskFormerForInstanceSegmentation(MaskFormerConfig()				).to(a__				)
										UpperCAmelCase					    =     model(**a__				)
										self.assertTrue(outputs.loss is not None				)




				def 					a__(		self      :			Optional[int]				)->					str:

										"""simple docstring"""




										UpperCAmelCase    ,    UpperCAmelCase					    =     self.model_tester.prepare_config_and_inputs_for_common()
										self.model_tester.create_and_check_maskformer_model(a__				,   **a__				,   output_hidden_states=a__				)




				def 					a__(		self      :			Optional[Any]				)->					int:

										"""simple docstring"""




										UpperCAmelCase    ,    UpperCAmelCase					    =     self.model_tester.prepare_config_and_inputs_for_common()

										for model_class in self.all_model_classes:
																UpperCAmelCase					    =     model_class(a__				).to(a__				)
																UpperCAmelCase					    =     model(**a__				,   output_attentions=a__				)
																self.assertTrue(outputs.attentions is not None				)




				def 					a__(		self      :			Dict				)->					str:

										"""simple docstring"""




										if not self.model_tester.is_training:
																return
										# only MaskFormerForInstanceSegmentation has the loss
										UpperCAmelCase					    =     self.all_model_classes[1]
										UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase					    =     self.model_tester.prepare_config_and_inputs()

										UpperCAmelCase					    =     model_class(a__				)
										model.to(a__				)
										model.train()

										UpperCAmelCase					    =     model(a__				,   mask_labels=a__				,   class_labels=a__				).loss
										loss.backward()





				def 					a__(		self      :			List[Any]				)->					List[str]:

										"""simple docstring"""




										UpperCAmelCase					    =     self.all_model_classes[1]
										UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase					    =     self.model_tester.prepare_config_and_inputs()
										UpperCAmelCase					    =     True
										UpperCAmelCase					    =     True

										UpperCAmelCase					    =     model_class(a__				)
										model.to(a__				)
										model.train()

										UpperCAmelCase					    =     model(a__				,   mask_labels=a__				,   class_labels=a__				)

										UpperCAmelCase					    =     outputs.encoder_hidden_states[0]
										encoder_hidden_states.retain_grad()

										UpperCAmelCase					    =     outputs.pixel_decoder_hidden_states[0]
										pixel_decoder_hidden_states.retain_grad()
										# we requires_grad=True in inputs_embeds (line 2152), the original implementation don't
										UpperCAmelCase					    =     outputs.transformer_decoder_hidden_states[0]
										transformer_decoder_hidden_states.retain_grad()

										UpperCAmelCase					    =     outputs.attentions[0]
										attentions.retain_grad()

										outputs.loss.backward(retain_graph=a__				)

										self.assertIsNotNone(encoder_hidden_states.grad				)
										self.assertIsNotNone(pixel_decoder_hidden_states.grad				)
										self.assertIsNotNone(transformer_decoder_hidden_states.grad				)
										self.assertIsNotNone(attentions.grad				)







_lowercase      :      Optional[int]            =					1E-4


def 				lowerCamelCase__				(	):




						'''simple docstring'''






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






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




				@cached_property
				def 					a__(		self      :			str				)->					Union[str, Any]:

										"""simple docstring"""




										return (
										    MaskFormerImageProcessor.from_pretrained('''facebook/maskformer-swin-small-coco'''				)
										    if is_vision_available()
										    else None
										)




				def 					a__(		self      :			str				)->					Optional[int]:

										"""simple docstring"""




										UpperCAmelCase					    =     MaskFormerModel.from_pretrained('''facebook/maskformer-swin-small-coco'''				).to(a__				)
										UpperCAmelCase					    =     self.default_image_processor
										UpperCAmelCase					    =     prepare_img()
										UpperCAmelCase					    =     image_processor(a__				,   return_tensors='''pt'''				).to(a__				)
										UpperCAmelCase					    =     inputs['''pixel_values'''].shape
										# check size is divisible by 32
										self.assertTrue((inputs_shape[-1] % 32) == 0 and (inputs_shape[-2] % 32) == 0				)
										# check size
										self.assertEqual(a__				,   (1, 3, 800, 1088)				)

										with torch.no_grad():
																UpperCAmelCase					    =     model(**a__				)

										UpperCAmelCase					    =     torch.tensor(
										    [[-0.0482, 0.9228, 0.4951], [-0.2547, 0.8017, 0.8527], [-0.0069, 0.3385, -0.0089]]				).to(a__				)
										self.assertTrue(
										    torch.allclose(
										        outputs.encoder_last_hidden_state[0, 0, :3, :3]				,   a__				,   atol=a__				)				)

										UpperCAmelCase					    =     torch.tensor(
										    [[-0.8422, -0.8434, -0.9718], [-1.0144, -0.5565, -0.4195], [-1.0038, -0.4484, -0.1961]]				).to(a__				)
										self.assertTrue(
										    torch.allclose(
										        outputs.pixel_decoder_last_hidden_state[0, 0, :3, :3]				,   a__				,   atol=a__				)				)

										UpperCAmelCase					    =     torch.tensor(
										    [[0.2852, -0.0159, 0.9735], [0.6254, 0.1858, 0.8529], [-0.0680, -0.4116, 1.8413]]				).to(a__				)
										self.assertTrue(
										    torch.allclose(
										        outputs.transformer_decoder_last_hidden_state[0, :3, :3]				,   a__				,   atol=a__				)				)




				def 					a__(		self      :			Union[str, Any]				)->					Optional[int]:

										"""simple docstring"""




										UpperCAmelCase					    =     (
										    MaskFormerForInstanceSegmentation.from_pretrained('''facebook/maskformer-swin-small-coco'''				)
										    .to(a__				)
										    .eval()
										)
										UpperCAmelCase					    =     self.default_image_processor
										UpperCAmelCase					    =     prepare_img()
										UpperCAmelCase					    =     image_processor(a__				,   return_tensors='''pt'''				).to(a__				)
										UpperCAmelCase					    =     inputs['''pixel_values'''].shape
										# check size is divisible by 32
										self.assertTrue((inputs_shape[-1] % 32) == 0 and (inputs_shape[-2] % 32) == 0				)
										# check size
										self.assertEqual(a__				,   (1, 3, 800, 1088)				)

										with torch.no_grad():
																UpperCAmelCase					    =     model(**a__				)
										# masks_queries_logits
										UpperCAmelCase					    =     outputs.masks_queries_logits
										self.assertEqual(
										    masks_queries_logits.shape				,   (1, model.config.decoder_config.num_queries, inputs_shape[-2] // 4, inputs_shape[-1] // 4)				,   )
										UpperCAmelCase					    =     [
										    [-1.3737124, -1.7724937, -1.9364233],
										    [-1.5977281, -1.9867939, -2.1523695],
										    [-1.5795398, -1.9269832, -2.093942],
										]
										UpperCAmelCase					    =     torch.tensor(a__				).to(a__				)
										self.assertTrue(torch.allclose(masks_queries_logits[0, 0, :3, :3]				,   a__				,   atol=a__				)				)
										# class_queries_logits
										UpperCAmelCase					    =     outputs.class_queries_logits
										self.assertEqual(
										    class_queries_logits.shape				,   (1, model.config.decoder_config.num_queries, model.config.num_labels + 1)				)
										UpperCAmelCase					    =     torch.tensor(
										    [
										        [1.6512E00, -5.2572E00, -3.3519E00],
										        [3.6169E-02, -5.9025E00, -2.9313E00],
										        [1.0766E-04, -7.7630E00, -5.1263E00],
										    ]				).to(a__				)
										self.assertTrue(torch.allclose(outputs.class_queries_logits[0, :3, :3]				,   a__				,   atol=a__				)				)




				def 					a__(		self      :			int				)->					str:

										"""simple docstring"""




										UpperCAmelCase					    =     (
										    MaskFormerForInstanceSegmentation.from_pretrained('''facebook/maskformer-resnet101-coco-stuff'''				)
										    .to(a__				)
										    .eval()
										)
										UpperCAmelCase					    =     self.default_image_processor
										UpperCAmelCase					    =     prepare_img()
										UpperCAmelCase					    =     image_processor(a__				,   return_tensors='''pt'''				).to(a__				)
										UpperCAmelCase					    =     inputs['''pixel_values'''].shape
										# check size is divisible by 32
										self.assertTrue((inputs_shape[-1] % 32) == 0 and (inputs_shape[-2] % 32) == 0				)
										# check size
										self.assertEqual(a__				,   (1, 3, 800, 1088)				)

										with torch.no_grad():
																UpperCAmelCase					    =     model(**a__				)
										# masks_queries_logits
										UpperCAmelCase					    =     outputs.masks_queries_logits
										self.assertEqual(
										    masks_queries_logits.shape				,   (1, model.config.decoder_config.num_queries, inputs_shape[-2] // 4, inputs_shape[-1] // 4)				,   )
										UpperCAmelCase					    =     [[-0.9046, -2.6366, -4.6062], [-3.4179, -5.7890, -8.8057], [-4.9179, -7.6560, -10.7711]]
										UpperCAmelCase					    =     torch.tensor(a__				).to(a__				)
										self.assertTrue(torch.allclose(masks_queries_logits[0, 0, :3, :3]				,   a__				,   atol=a__				)				)
										# class_queries_logits
										UpperCAmelCase					    =     outputs.class_queries_logits
										self.assertEqual(
										    class_queries_logits.shape				,   (1, model.config.decoder_config.num_queries, model.config.num_labels + 1)				)
										UpperCAmelCase					    =     torch.tensor(
										    [[4.7188, -3.2585, -2.8857], [6.6871, -2.9181, -1.2487], [7.2449, -2.2764, -2.1874]]				).to(a__				)
										self.assertTrue(torch.allclose(outputs.class_queries_logits[0, :3, :3]				,   a__				,   atol=a__				)				)





				def 					a__(		self      :			Dict				)->					List[str]:

										"""simple docstring"""




										UpperCAmelCase					    =     (
										    MaskFormerForInstanceSegmentation.from_pretrained('''facebook/maskformer-swin-small-coco'''				)
										    .to(a__				)
										    .eval()
										)
										UpperCAmelCase					    =     self.default_image_processor

										UpperCAmelCase					    =     image_processor(
										    [np.zeros((3, 800, 1333)				), np.zeros((3, 800, 1333)				)]				,   segmentation_maps=[np.zeros((384, 384)				).astype(np.floataa				), np.zeros((384, 384)				).astype(np.floataa				)]				,   return_tensors='''pt'''				,   )

										UpperCAmelCase					    =     inputs['''pixel_values'''].to(a__				)
										UpperCAmelCase					    =     [el.to(a__				) for el in inputs['''mask_labels''']]
										UpperCAmelCase					    =     [el.to(a__				) for el in inputs['''class_labels''']]

										with torch.no_grad():
																UpperCAmelCase					    =     model(**a__				)

										self.assertTrue(outputs.loss is not None				)









'''simple docstring'''



import numpy as np
from cva import COLOR_BGR2GRAY, CV_8UC3, cvtColor, filteraD, imread, imshow, waitKey


def 				lowerCamelCase__				(	A       :      int				,       A       :      int				,       A       :      int				,       A       :      int				,       A       :      int				,       A       :      int					):




						'''simple docstring'''






						if (ksize % 2) == 0:
												UpperCAmelCase					    =     ksize + 1
						UpperCAmelCase					    =     np.zeros((ksize, ksize)				,       dtype=np.floataa					)

						# each value
						for y in range(A					):
												for x in range(A					):
																		# distance from center
																		UpperCAmelCase					    =     x - ksize // 2
																		UpperCAmelCase					    =     y - ksize // 2

																		# degree to radiant
																		UpperCAmelCase					    =     theta / 1_80 * np.pi
																		UpperCAmelCase					    =     np.cos(_theta					)
																		UpperCAmelCase					    =     np.sin(_theta					)

																		# get kernel x
																		UpperCAmelCase					    =     cos_theta * px + sin_theta * py

																		# get kernel y
																		UpperCAmelCase					    =     -sin_theta * px + cos_theta * py

																		# fill kernel
																		UpperCAmelCase					    =     np.exp(
																		    -(_x**2 + gamma**2 * _y**2) / (2 * sigma**2)					) * np.cos(2 * np.pi * _x / lambd + psi					)

						return gabor


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	# read original image
	_lowercase      :      Tuple            =					imread("""../image_data/lena.jpg""")
	# turn image in gray scale value
	_lowercase      :      int            =					cvtColor(img, COLOR_BGR2GRAY)

	# Apply multiple Kernel to detect edges
	_lowercase      :      List[str]            =					np.zeros(gray.shape[:2])
	for theta in [0, 30, 60, 90, 120, 150]:
		_lowercase      :      List[Any]            =					gabor_filter_kernel(10, 8, theta, 10, 0, 0)
		out += filteraD(gray, CV_8UC3, kernel_aa)
	_lowercase      :      Optional[int]            =					out / out.max() * 255
	_lowercase      :      Optional[int]            =					out.astype(np.uinta)

	imshow("""Original""", gray)
	imshow("""Gabor filter with 20x20 mask and 6 directions""", out)

	waitKey(0)





