


from __future__ import annotations

import inspect
import unittest

from transformers import MobileViTConfig
from transformers.file_utils import is_tf_available, is_vision_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
 import numpy as np
 import tensorflow as tf

 from transformers import TFMobileViTForImageClassification, TFMobileViTForSemanticSegmentation, TFMobileViTModel
 from transformers.models.mobilevit.modeling_tf_mobilevit import TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
 from PIL import Image

 from transformers import MobileViTImageProcessor




class A  (       UpperCamelCase_					):






      def 	lowerCamelCase	( self						:					Any			) ->						int:
             """simple docstring"""




             _lowerCamelCase	:		Dict          =self.config_class(**self.inputs_dict			)
             self.parent.assertTrue(hasattr(lowercase_      ,       'hidden_sizes'			)			)
             self.parent.assertTrue(hasattr(lowercase_      ,       'neck_hidden_sizes'			)			)
             self.parent.assertTrue(hasattr(lowercase_      ,       'num_attention_heads'			)			)




class A  :






      def __init__( self						:					Optional[int]      ,       lowercase_						:					List[Any]      ,       lowercase_						:					Optional[int]=13      ,       lowercase_						:					Optional[int]=32      ,       lowercase_						:					Optional[Any]=2      ,       lowercase_						:					List[Any]=3      ,       lowercase_						:					List[Any]=640      ,       lowercase_						:					str=4      ,       lowercase_						:					List[str]="silu"      ,       lowercase_						:					int=3      ,       lowercase_						:					Optional[int]=32      ,       lowercase_						:					Optional[Any]=0.1      ,       lowercase_						:					Union[str, Any]=0.1      ,       lowercase_						:					Optional[int]=0.1      ,       lowercase_						:					List[str]=0.02      ,       lowercase_						:					Tuple=True      ,       lowercase_						:					Union[str, Any]=True      ,       lowercase_						:					Optional[Any]=10      ,       lowercase_						:					Any=None      ,       ) ->						int:
             """simple docstring"""




             _lowerCamelCase	:		int          =parent
             _lowerCamelCase	:		List[Any]          =batch_size
             _lowerCamelCase	:		Dict          =image_size
             _lowerCamelCase	:		List[str]          =patch_size
             _lowerCamelCase	:		Union[str, Any]          =num_channels
             _lowerCamelCase	:		str          =last_hidden_size
             _lowerCamelCase	:		Tuple          =num_attention_heads
             _lowerCamelCase	:		List[str]          =hidden_act
             _lowerCamelCase	:		str          =conv_kernel_size
             _lowerCamelCase	:		Tuple          =output_stride
             _lowerCamelCase	:		List[str]          =hidden_dropout_prob
             _lowerCamelCase	:		List[Any]          =attention_probs_dropout_prob
             _lowerCamelCase	:		Tuple          =classifier_dropout_prob
             _lowerCamelCase	:		Optional[Any]          =use_labels
             _lowerCamelCase	:		Optional[Any]          =is_training
             _lowerCamelCase	:		Optional[int]          =num_labels
             _lowerCamelCase	:		List[str]          =initializer_range
             _lowerCamelCase	:		int          =scope






      def 	lowerCamelCase	( self						:					str			) ->						Tuple:
             """simple docstring"""




             _lowerCamelCase	:		str          =floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]			)

             _lowerCamelCase	:		Union[str, Any]          =None
             _lowerCamelCase	:		Tuple          =None
             if self.use_labels:
                    _lowerCamelCase	:		Any          =ids_tensor([self.batch_size]      ,       self.num_labels			)
                    _lowerCamelCase	:		Union[str, Any]          =ids_tensor([self.batch_size, self.image_size, self.image_size]      ,       self.num_labels			)

             _lowerCamelCase	:		List[str]          =self.get_config()

             return config, pixel_values, labels, pixel_labels






      def 	lowerCamelCase	( self						:					Union[str, Any]			) ->						Optional[Any]:
             """simple docstring"""




             return MobileViTConfig(
                 image_size=self.image_size      ,       patch_size=self.patch_size      ,       num_channels=self.num_channels      ,       num_attention_heads=self.num_attention_heads      ,       hidden_act=self.hidden_act      ,       conv_kernel_size=self.conv_kernel_size      ,       output_stride=self.output_stride      ,       hidden_dropout_prob=self.hidden_dropout_prob      ,       attention_probs_dropout_prob=self.attention_probs_dropout_prob      ,       classifier_dropout_prob=self.classifier_dropout_prob      ,       initializer_range=self.initializer_range      ,       )






      def 	lowerCamelCase	( self						:					Tuple      ,       lowercase_						:					str      ,       lowercase_						:					int      ,       lowercase_						:					Dict      ,       lowercase_						:					Tuple			) ->						int:
             """simple docstring"""




             _lowerCamelCase	:		Dict          =TFMobileViTModel(config=lowercase_			)
             _lowerCamelCase	:		Union[str, Any]          =model(lowercase_      ,       training=lowercase_			)
             _lowerCamelCase	:		List[str]          =self.image_size // self.output_stride
             self.parent.assertEqual(
                 result.last_hidden_state.shape      ,       (self.batch_size, self.last_hidden_size, expected_height, expected_width)			)






      def 	lowerCamelCase	( self						:					List[Any]      ,       lowercase_						:					Dict      ,       lowercase_						:					Any      ,       lowercase_						:					List[Any]      ,       lowercase_						:					Tuple			) ->						Union[str, Any]:
             """simple docstring"""




             _lowerCamelCase	:		str          =self.num_labels
             _lowerCamelCase	:		Optional[Any]          =TFMobileViTForImageClassification(lowercase_			)
             _lowerCamelCase	:		Tuple          =model(lowercase_      ,       labels=lowercase_      ,       training=lowercase_			)
             self.parent.assertEqual(result.logits.shape      ,       (self.batch_size, self.num_labels)			)






      def 	lowerCamelCase	( self						:					Optional[int]      ,       lowercase_						:					List[str]      ,       lowercase_						:					int      ,       lowercase_						:					Tuple      ,       lowercase_						:					Optional[int]			) ->						List[Any]:
             """simple docstring"""




             _lowerCamelCase	:		Dict          =self.num_labels
             _lowerCamelCase	:		List[str]          =TFMobileViTForSemanticSegmentation(lowercase_			)
             _lowerCamelCase	:		Tuple          =self.image_size // self.output_stride

             _lowerCamelCase	:		Tuple          =model(lowercase_      ,       training=lowercase_			)
             self.parent.assertEqual(
                 result.logits.shape      ,       (self.batch_size, self.num_labels, expected_height, expected_width)			)

             _lowerCamelCase	:		str          =model(lowercase_      ,       labels=lowercase_      ,       training=lowercase_			)
             self.parent.assertEqual(
                 result.logits.shape      ,       (self.batch_size, self.num_labels, expected_height, expected_width)			)






      def 	lowerCamelCase	( self						:					int			) ->						Dict:
             """simple docstring"""




             _lowerCamelCase	:		Optional[Any]          =self.prepare_config_and_inputs()
             _lowerCamelCase     ,					_lowerCamelCase     ,					_lowerCamelCase     ,					_lowerCamelCase	:		List[str]          =config_and_inputs
             _lowerCamelCase	:		Any          ={'pixel_values': pixel_values}
             return config, inputs_dict




@require_tf
class A  (       UpperCamelCase_   ,							UpperCamelCase_   ,							unittest.TestCase					):
      UpperCamelCase__							:  Union[str, Any]				=(
          (TFMobileViTModel, TFMobileViTForImageClassification, TFMobileViTForSemanticSegmentation)
          if is_tf_available()
          else ()
      )
      UpperCamelCase__							:  List[str]				=(
          {'feature-extraction': TFMobileViTModel, 'image-classification': TFMobileViTForImageClassification}
          if is_tf_available()
          else {}
      )

      UpperCamelCase__							:  Any				=False
      UpperCamelCase__							:  Optional[Any]				=False
      UpperCamelCase__							:  Tuple				=False
      UpperCamelCase__							:  Optional[int]				=False
      UpperCamelCase__							:  Optional[int]				=False






      def 	lowerCamelCase	( self						:					Union[str, Any]			) ->						List[str]:
             """simple docstring"""




             _lowerCamelCase	:		Optional[Any]          =TFMobileViTModelTester(self			)
             _lowerCamelCase	:		Union[str, Any]          =TFMobileViTConfigTester(self      ,       config_class=lowercase_      ,       has_text_modality=lowercase_			)






      def 	lowerCamelCase	( self						:					Dict			) ->						Union[str, Any]:
             """simple docstring"""




             self.config_tester.run_common_tests()






      @unittest.skip(reason='MobileViT does not use inputs_embeds'			)
      def 	lowerCamelCase	( self						:					int			) ->						Optional[int]:
             """simple docstring"""




             pass






      @unittest.skip(reason='MobileViT does not support input and output embeddings'			)
      def 	lowerCamelCase	( self						:					Tuple			) ->						str:
             """simple docstring"""




             pass






      @unittest.skip(reason='MobileViT does not output attentions'			)
      def 	lowerCamelCase	( self						:					Union[str, Any]			) ->						Union[str, Any]:
             """simple docstring"""




             pass






      def 	lowerCamelCase	( self						:					Optional[int]			) ->						List[Any]:
             """simple docstring"""




             _lowerCamelCase     ,					_lowerCamelCase	:		List[Any]          =self.model_tester.prepare_config_and_inputs_for_common()

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

                    _lowerCamelCase	:		Tuple          =['pixel_values']
                    self.assertListEqual(arg_names[:1]      ,       lowercase_			)






      def 	lowerCamelCase	( self						:					Union[str, Any]			) ->						Optional[int]:
             """simple docstring"""




             _lowerCamelCase	:		Optional[int]          =self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_model(*lowercase_			)






      def 	lowerCamelCase	( self						:					Tuple			) ->						Optional[Any]:
             """simple docstring"""




             def check_hidden_states_output(lowercase_						:					Union[str, Any]      ,       lowercase_						:					str      ,       lowercase_						:					Optional[Any]			):
                    _lowerCamelCase	:		str          =model_class(lowercase_			)

                    _lowerCamelCase	:		Optional[int]          =model(**self._prepare_for_class(lowercase_      ,       lowercase_			)			)

                    _lowerCamelCase	:		Optional[int]          =outputs.hidden_states

                    _lowerCamelCase	:		Union[str, Any]          =5
                    self.assertEqual(len(lowercase_			)      ,       lowercase_			)

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

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

             _lowerCamelCase     ,					_lowerCamelCase	:		Tuple          =self.model_tester.prepare_config_and_inputs_for_common()

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

                    # check that output_hidden_states also work using config
                    del inputs_dict["output_hidden_states"]
                    _lowerCamelCase	:		str          =True

                    check_hidden_states_output(lowercase_      ,       lowercase_      ,       lowercase_			)






      def 	lowerCamelCase	( self						:					str			) ->						str:
             """simple docstring"""




             _lowerCamelCase	:		Tuple          =self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_for_image_classification(*lowercase_			)






      def 	lowerCamelCase	( self						:					Optional[Any]			) ->						Any:
             """simple docstring"""




             _lowerCamelCase	:		Optional[Any]          =self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_for_semantic_segmentation(*lowercase_			)






      @unittest.skipIf(
          not is_tf_available() or len(tf.config.list_physical_devices('GPU'			)			) == 0      ,       reason='TF does not support backprop for grouped convolutions on CPU.'      ,       )
      def 	lowerCamelCase	( self						:					str			) ->						Any:
             """simple docstring"""




             super().test_dataset_conversion()






      def 	lowerCamelCase	( self						:					Union[str, Any]      ,       lowercase_						:					Dict      ,       lowercase_						:					Optional[int]      ,       lowercase_						:					List[Any]=2E-1      ,       lowercase_						:					Dict=2E-1			) ->						List[Any]:
             """simple docstring"""




             self.assertTrue(np.allclose(lowercase_      ,       lowercase_      ,       atol=lowercase_      ,       rtol=lowercase_			)			)






      @unittest.skipIf(
          not is_tf_available() or len(tf.config.list_physical_devices('GPU'			)			) == 0      ,       reason='TF does not support backprop for grouped convolutions on CPU.'      ,       )
      @slow
      def 	lowerCamelCase	( self						:					Dict			) ->						Optional[Any]:
             """simple docstring"""




             _lowerCamelCase     ,					_lowerCamelCase	:		Union[str, Any]          =self.model_tester.prepare_config_and_inputs_for_common()

             for model_class in self.all_model_classes:
                    # Since `TFMobileViTModel` cannot operate with the default `fit()` method.
                    if model_class.__name__ != "TFMobileViTModel":
                           _lowerCamelCase	:		Optional[Any]          =model_class(lowercase_			)
                           if getattr(lowercase_      ,       'hf_compute_loss'      ,       lowercase_			):
                                  super().test_keras_fit()






      def 	lowerCamelCase	( self						:					Tuple			) ->						Tuple:
             """simple docstring"""




             _lowerCamelCase     ,					_lowerCamelCase	:		Optional[Any]          =self.model_tester.prepare_config_and_inputs_for_common()
             for model_class in self.all_model_classes:
                    # set an ignore index to correctly test the masked loss used in
                    # `TFMobileViTForSemanticSegmentation`.
                    if model_class.__name__ != "TFMobileViTForSemanticSegmentation":
                           _lowerCamelCase	:		Optional[int]          =5

                    _lowerCamelCase	:		Dict          =model_class(lowercase_			)
                    if getattr(lowercase_      ,       'hf_compute_loss'      ,       lowercase_			):
                           # The number of elements in the loss should be the same as the number of elements in the label
                           _lowerCamelCase	:		Any          =self._prepare_for_class(inputs_dict.copy()      ,       lowercase_      ,       return_labels=lowercase_			)
                           _lowerCamelCase	:		Dict          =prepared_for_class[
                               sorted(prepared_for_class.keys() - inputs_dict.keys()      ,       reverse=lowercase_			)[0]
                           ]
                           _lowerCamelCase	:		Union[str, Any]          =added_label.shape.as_list()[:1]

                           # Test that model correctly compute the loss with kwargs
                           _lowerCamelCase	:		List[Any]          =self._prepare_for_class(inputs_dict.copy()      ,       lowercase_      ,       return_labels=lowercase_			)
                           _lowerCamelCase	:		int          ={'input_ids', 'pixel_values', 'input_features'}
                           _lowerCamelCase	:		Optional[Any]          =possible_input_names.intersection(set(lowercase_			)			).pop()
                           _lowerCamelCase	:		List[str]          =prepared_for_class.pop(lowercase_			)

                           _lowerCamelCase	:		List[Any]          =model(lowercase_      ,       **lowercase_			)[0]
                           self.assertTrue(loss.shape.as_list() == expected_loss_size or loss.shape.as_list() == [1]			)

                           # Test that model correctly compute the loss when we mask some positions
                           _lowerCamelCase	:		Optional[Any]          =self._prepare_for_class(inputs_dict.copy()      ,       lowercase_      ,       return_labels=lowercase_			)
                           _lowerCamelCase	:		Optional[Any]          ={'input_ids', 'pixel_values', 'input_features'}
                           _lowerCamelCase	:		int          =possible_input_names.intersection(set(lowercase_			)			).pop()
                           _lowerCamelCase	:		List[Any]          =prepared_for_class.pop(lowercase_			)
                           if "labels" in prepared_for_class:
                                  _lowerCamelCase	:		Union[str, Any]          =prepared_for_class['labels'].numpy()
                                  if len(labels.shape			) > 1 and labels.shape[1] != 1:
                                         # labels[0] = -100
                                         _lowerCamelCase	:		Optional[int]          =tf.convert_to_tensor(lowercase_			)
                                         _lowerCamelCase	:		Tuple          =model(lowercase_      ,       **lowercase_			)[0]
                                         self.assertTrue(loss.shape.as_list() == expected_loss_size or loss.shape.as_list() == [1]			)
                                         self.assertTrue(not np.any(np.isnan(loss.numpy()			)			)			)

                # Test that model correctly compute the loss with a dict
                           _lowerCamelCase	:		Union[str, Any]          =self._prepare_for_class(inputs_dict.copy()      ,       lowercase_      ,       return_labels=lowercase_			)
                           _lowerCamelCase	:		Tuple          =model(lowercase_			)[0]
                           self.assertTrue(loss.shape.as_list() == expected_loss_size or loss.shape.as_list() == [1]			)

                           # Test that model correctly compute the loss with a tuple
                           _lowerCamelCase	:		Any          =self._prepare_for_class(inputs_dict.copy()      ,       lowercase_      ,       return_labels=lowercase_			)

                           # Get keys that were added with the _prepare_for_class function
                           _lowerCamelCase	:		List[str]          =prepared_for_class.keys() - inputs_dict.keys()
                           _lowerCamelCase	:		str          =inspect.signature(model.call			).parameters
                           _lowerCamelCase	:		int          =list(signature.keys()			)

                           # Create a dictionary holding the location of the tensors in the tuple
                           _lowerCamelCase	:		Dict          ={0: input_name}
                           for label_key in label_keys:
                                  _lowerCamelCase	:		Optional[int]          =signature_names.index(lowercase_			)
                                  _lowerCamelCase	:		Dict          =label_key
                           _lowerCamelCase	:		str          =sorted(tuple_index_mapping.items()			)
                           # Initialize a list with their default values, update the values and convert to a tuple
                           _lowerCamelCase	:		Any          =[]

                           for name in signature_names:
                                  if name != "kwargs":
                                         list_input.append(signature[name].default			)

                           for index, value in sorted_tuple_index_mapping:
                                  _lowerCamelCase	:		Optional[int]          =prepared_for_class[value]

                           _lowerCamelCase	:		Dict          =tuple(lowercase_			)

                           # Send to model
                           _lowerCamelCase	:		Dict          =model(tuple_input[:-1]			)[0]

                           self.assertTrue(loss.shape.as_list() == expected_loss_size or loss.shape.as_list() == [1]			)






      @slow
      def 	lowerCamelCase	( self						:					str			) ->						Tuple:
             """simple docstring"""




             for model_name in TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                    _lowerCamelCase	:		Optional[int]          =TFMobileViTModel.from_pretrained(lowercase_			)
                    self.assertIsNotNone(lowercase_			)




def      a_				(   ):
       '''simple docstring'''





       _lowerCamelCase	:		List[str]          =Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png'					)
       return image




@require_tf
class A  (       unittest.TestCase					):






      @slow
      def 	lowerCamelCase	( self						:					Optional[Any]			) ->						int:
             """simple docstring"""




             _lowerCamelCase	:		List[Any]          =TFMobileViTForImageClassification.from_pretrained('apple/mobilevit-xx-small'			)

             _lowerCamelCase	:		int          =MobileViTImageProcessor.from_pretrained('apple/mobilevit-xx-small'			)
             _lowerCamelCase	:		str          =prepare_img()
             _lowerCamelCase	:		List[str]          =image_processor(images=lowercase_      ,       return_tensors='tf'			)

             # forward pass
             _lowerCamelCase	:		Union[str, Any]          =model(**lowercase_      ,       training=lowercase_			)

             # verify the logits
             _lowerCamelCase	:		Dict          =tf.TensorShape((1, 1000)			)
             self.assertEqual(outputs.logits.shape      ,       lowercase_			)

             _lowerCamelCase	:		int          =tf.constant([-1.9364, -1.2327, -0.4653]			)

             tf.debugging.assert_near(outputs.logits[0, :3]      ,       lowercase_      ,       atol=1E-4      ,       rtol=1E-04			)






      @slow
      def 	lowerCamelCase	( self						:					List[Any]			) ->						List[Any]:
             """simple docstring"""




             _lowerCamelCase	:		Dict          =TFMobileViTForSemanticSegmentation.from_pretrained('apple/deeplabv3-mobilevit-xx-small'			)

             _lowerCamelCase	:		Optional[Any]          =MobileViTImageProcessor.from_pretrained('apple/deeplabv3-mobilevit-xx-small'			)

             _lowerCamelCase	:		Optional[Any]          =prepare_img()
             _lowerCamelCase	:		List[Any]          =image_processor(images=lowercase_      ,       return_tensors='tf'			)

             # forward pass
             _lowerCamelCase	:		Dict          =model(inputs.pixel_values      ,       training=lowercase_			)
             _lowerCamelCase	:		Optional[int]          =outputs.logits

             # verify the logits
             _lowerCamelCase	:		List[str]          =tf.TensorShape((1, 21, 32, 32)			)
             self.assertEqual(logits.shape      ,       lowercase_			)

             _lowerCamelCase	:		List[Any]          =tf.constant(
                 [
                     [[6.9713, 6.9786, 7.2422], [7.2893, 7.2825, 7.4446], [7.6580, 7.8797, 7.9420]],
                     [[-10.6869, -10.3250, -10.3471], [-10.4228, -9.9868, -9.7132], [-11.0405, -11.0221, -10.7318]],
                     [[-3.3089, -2.8539, -2.6740], [-3.2706, -2.5621, -2.5108], [-3.2534, -2.6615, -2.6651]],
                 ]			)

             tf.debugging.assert_near(logits[0, :3, :3, :3]      ,       lowercase_      ,       rtol=1E-4      ,       atol=1E-4			)






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

from digital_image_processing.filters.convolve import img_convolve




def      a_				(   SCREAMING_SNAKE_CASE__ :				Optional[Any]					):
       '''simple docstring'''





       _lowerCamelCase	:		List[str]          =np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]					)
       _lowerCamelCase	:		Dict          =np.array([[1, 2, 1], [0, 0, 0], [-1, -2, -1]]					)

       _lowerCamelCase	:		Optional[Any]          =np.abs(img_convolve(SCREAMING_SNAKE_CASE__		,      SCREAMING_SNAKE_CASE__					)					)
       _lowerCamelCase	:		Optional[int]          =np.abs(img_convolve(SCREAMING_SNAKE_CASE__		,      SCREAMING_SNAKE_CASE__					)					)
       # modify the pix within [0, 255]
       _lowerCamelCase	:		Optional[int]          =dst_x * 255 / np.max(SCREAMING_SNAKE_CASE__					)
       _lowerCamelCase	:		Any          =dst_y * 255 / np.max(SCREAMING_SNAKE_CASE__					)

       _lowerCamelCase	:		Tuple          =np.sqrt((np.square(SCREAMING_SNAKE_CASE__					)) + (np.square(SCREAMING_SNAKE_CASE__					))					)
       _lowerCamelCase	:		int          =dst_xy * 255 / np.max(SCREAMING_SNAKE_CASE__					)
       _lowerCamelCase	:		int          =dst_xy.astype(np.uinta					)

       _lowerCamelCase	:		Optional[int]          =np.arctana(SCREAMING_SNAKE_CASE__		,      SCREAMING_SNAKE_CASE__					)
       return dst, theta


if __name__ == "__main__":
 # read original image
 lowerCamelCase						 =	imread('../image_data/lena.jpg')
 # turn image in gray scale value
 lowerCamelCase						 =	cvtColor(img, COLOR_BGR2GRAY)

 lowerCamelCase ,    lowerCamelCase						 =	sobel_filter(gray)

 # show result images
 imshow('sobel filter', sobel_grad)
 imshow('sobel theta', sobel_theta)
 waitKey(0)


