2022-04-28 18:06:16 +08:00
|
|
|
import time
|
|
|
|
|
|
|
|
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
def fake_gan():
|
|
|
|
time.sleep(1)
|
2023-02-02 23:58:29 +08:00
|
|
|
images = [
|
2022-04-28 18:06:16 +08:00
|
|
|
"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=387&q=80",
|
|
|
|
"https://images.unsplash.com/photo-1554151228-14d9def656e4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=386&q=80",
|
|
|
|
"https://images.unsplash.com/photo-1542909168-82c3e7fdca5c?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8aHVtYW4lMjBmYWNlfGVufDB8fDB8fA%3D%3D&w=1000&q=80",
|
2023-02-02 23:58:29 +08:00
|
|
|
]
|
|
|
|
return images
|
2022-04-28 18:06:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
demo = gr.Interface(
|
|
|
|
fn=fake_gan,
|
|
|
|
inputs=None,
|
2023-08-26 02:31:18 +08:00
|
|
|
outputs=gr.Gallery(label="Generated Images", columns=[2]),
|
2022-04-28 18:06:16 +08:00
|
|
|
title="FD-GAN",
|
|
|
|
description="This is a fake demo of a GAN. In reality, the images are randomly chosen from Unsplash.",
|
|
|
|
)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
demo.launch()
|