2020-06-11 02:34:53 +08:00
|
|
|
import gradio as gr
|
|
|
|
import numpy as np
|
2020-06-11 23:02:37 +08:00
|
|
|
from time import time
|
2020-06-11 02:34:53 +08:00
|
|
|
|
2020-07-09 06:09:52 +08:00
|
|
|
|
2020-06-11 02:34:53 +08:00
|
|
|
def flip(image):
|
2020-06-11 23:02:37 +08:00
|
|
|
start = time()
|
2020-07-17 03:56:36 +08:00
|
|
|
return image
|
2020-06-11 02:34:53 +08:00
|
|
|
|
2020-07-09 06:09:52 +08:00
|
|
|
|
2020-06-11 23:02:37 +08:00
|
|
|
def flip2(image):
|
|
|
|
start = time()
|
2020-07-17 03:56:36 +08:00
|
|
|
return np.fliplr(image)
|
2020-06-11 23:02:37 +08:00
|
|
|
|
|
|
|
|
2020-07-21 00:51:45 +08:00
|
|
|
gr.Interface(flip,
|
|
|
|
gr.inputs.Image(),
|
2020-07-17 03:56:36 +08:00
|
|
|
["image"],
|
2020-07-01 07:31:26 +08:00
|
|
|
examples=[
|
|
|
|
["images/cheetah1.jpg"],
|
|
|
|
["images/cheetah2.jpg"],
|
|
|
|
["images/lion.jpg"],
|
|
|
|
]
|
|
|
|
).launch()
|