File size: 1,059 Bytes
d33f344
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5f3a3a7
d33f344
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import random_face
import gradio as gr 

def mobileface(truncate, alpha):
  engine = random_face.get_engine()
  face = engine.get_random_face(truncate=truncate, alpha=alpha)
  return face[:,:,::-1]

inputs = [
          gr.inputs.Checkbox(label="Truncate"),
          gr.inputs.Slider(minimum=0, maximum=1, step=None, default=0.5, label="Alpha")
          
]

outputs = gr.outputs.Image(type='numpy', label="Output Image")

title = "MobileStyleGAN"
description = "Gradio demo for MobileStyleGAN: A Lightweight Convolutional Neural Network for High-Fidelity Image Synthesis. To use it, simply click submit and optionally adjust alpha and truncation values. Read more at the links below."
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2104.04767'>MobileStyleGAN: A Lightweight Convolutional Neural Network for High-Fidelity Image Synthesis</a> | <a href='https://github.com/bes-dev/MobileStyleGAN.pytorch'>Github Repo</a></p>"



gr.Interface(mobileface, inputs, outputs, title=title, description=description, article=article).launch()