How to use the gradio.inputs.ImageUpload function in gradio

To help you get started, we’ve selected a few gradio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gradio-app / gradio-UI / test / test_inputs.py View on Github external
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))
github gradio-app / gradio-UI / test / test_interface.py View on Github external
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)
github gradio-app / gradio-UI / test / test_inputs.py View on Github external
def test_preprocessing(self):
        inp = inputs.ImageUpload()
        array = inp.preprocess(BASE64_IMG)
        self.assertEqual(array.shape, (1, 224, 224, 3))
github gradio-app / gradio-UI / test / test_inputs.py View on Github external
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)))