gradio/demo/flip_image.py
2020-06-25 12:31:48 -07:00

20 lines
341 B
Python

import gradio as gr
import numpy as np
from time import time
def flip(image):
start = time()
return image, {
"1": 0.2,
"2": 0.8
}
def flip2(image):
start = time()
return np.fliplr(image), time() - start
gr.Interface(flip,
"image",
["image", "label"
]).launch()