Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_preprocessing(self):
inp = inputs.ImageUpload()
inp.image_height = 48
inp.image_width = 48
array = inp.preprocess(BASE64_IMG)
self.assertEqual(array.shape, (1, 48, 48, 3))
def test_input_interface_is_instance(self):
inp = gradio.inputs.ImageUpload()
io = Interface(inputs=inp, outputs='textBOX', model=lambda x: x, model_type='function')
self.assertEqual(io.input_interface, inp)
def test_preprocessing(self):
inp = inputs.ImageUpload()
array = inp.preprocess(BASE64_IMG)
self.assertEqual(array.shape, (1, 224, 224, 3))
def test_path_exists(self):
inp = inputs.ImageUpload()
path = inputs.BASE_INPUT_INTERFACE_JS_PATH.format(inp.get_name())
self.assertTrue(os.path.exists(os.path.join(PACKAGE_NAME, path)))