gradio/demo/flip_image.py
2020-06-11 08:02:37 -07:00

14 lines
295 B
Python

import gradio as gr
import numpy as np
from time import time
def flip(image):
start = time()
return np.flipud(image), time() - start
def flip2(image):
start = time()
return np.fliplr(image), time() - start
gr.Interface([flip, flip2], "imagein", ["image", "textbox"]).launch()