Spaces:
Runtime error
Runtime error
File size: 1,438 Bytes
33719d5 cf2aa9b 29cf710 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 ~30 pictures that contain houses that were painted by my dear friend Hana Hanak, check out the results for yourself. the abstract expressionism and color field models were initially trained on pictures 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 = "Projected GAN for painting generation v0.2"
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()
|