Spaces:
Sleeping
Sleeping
# This demo needs to be run from the repo folder. | |
# python demo/fake_gan/run.py | |
import gradio as gr | |
def url_query_params(request: gr.Request) -> dict: | |
"""Extract image urls from the query parameters.""" | |
image_urls = [] | |
for param in request.query_params: | |
if param.startswith("img"): | |
image_urls.append(request.query_params[param]) | |
return image_urls | |
with gr.Blocks() as demo: | |
gallery = gr.Gallery( | |
label="Images", | |
show_label=False, | |
elem_id="gallery", | |
columns=[3], | |
rows=[1], | |
object_fit="contain", | |
height="auto", | |
) | |
demo.load(url_query_params, None, gallery) | |
if __name__ == "__main__": | |
demo.launch() | |