radames's picture
fix
279529f
raw
history blame
No virus
450 Bytes
import gradio as gr
import requests
from PIL import Image
URL = "https://source.unsplash.com/random/500x500/?nature,fruit"
def refresh():
image = Image.open(requests.get(URL, stream=True).raw)
return image
with gr.Blocks(show_footer=False) as blocks:
image = gr.Image(show_label=False)
blocks.load(fn=refresh, inputs=None, outputs=image,
show_progress=False, every=1)
blocks.queue(api_open=False)
blocks.launch()