File size: 450 Bytes
cb069f2
 
 
279529f
 
cb069f2
 
 
 
 
279529f
cb069f2
 
279529f
 
cb069f2
 
279529f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()