import gradio as gr import kornia as K from kornia.core import Tensor def enhance(file): # load the image using the rust backend img: Tensor = K.io.load_image(file.name, K.io.ImageLoadType.RGB32) img = img[None] # 1xCxHxW / fp32 / [0, 1] return K.utils.tensor_to_image(img) examples = [ ['examples/foto1B.jpg'], ['examples/foto1A.jpg'], ] iface = gr.Interface( enhance, [ gr.inputs.Image(type="file"), ], "image", examples=examples, # title=title, # description=description, # article=article, live=True ) iface.launch()