File size: 1,380 Bytes
33719d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1e02bb6
29cf710
33719d5
 
27b67b8
33719d5
 
 
 
 
f5463c8
33719d5
bab6755
33719d5
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import gradio as gr
from huggingface_hub import PyTorchModelHubMixin
import torch
import matplotlib.pyplot as plt
import torchvision
from networks_fastgan import MyGenerator
import click
import PIL
from image_generator import generate_images

def image_generation(model, number_of_images=1):
    img = generate_images(model)
    #return f"generating {number_of_images} images from {model}"
    return img
if __name__ == "__main__":
    description = "This is a web demo of a projected GAN trained on photos of thirty paintings from the series of paintings Welcome home. \n The abstract expressionism and color field models were initially trained on images from their perspective art directions and then transfer learned to Hana's houses."
    inputs = gr.inputs.Radio(["Hana Hanak houses", "Hana Hanak houses - abstract expressionism", "Hana Hanak houses - color field"])
    outputs = gr.outputs.Image(label="Generated Image", type="pil")
    #outputs = "text"
    title = "Anti house generator"
    article = "<p style='text-align: center'><a href='https://github.com/autonomousvision/projected_gan'>Official projected GAN github repo + paper</a></p>"



    gr.Interface(image_generation, inputs, outputs, title=title, article = article, description = description, 
    analytics_enabled=False).launch(debug=True)

    app, local_url, share_url = iface.launch(share=True)