hysts HF staff commited on
Commit
d84b2d3
1 Parent(s): 7df68a5
Files changed (2) hide show
  1. app.py +10 -8
  2. style.css +7 -0
app.py CHANGED
@@ -9,6 +9,13 @@ from huggingface_hub import hf_hub_download
9
 
10
  from model import Model
11
 
 
 
 
 
 
 
 
12
  def parse_args() -> argparse.Namespace:
13
  parser = argparse.ArgumentParser()
14
  parser.add_argument('--device', type=str, default='cpu')
@@ -25,11 +32,8 @@ def main():
25
  args = parse_args()
26
  app = Model(device=args.device)
27
 
28
- with gr.Blocks(theme=args.theme) as demo:
29
- gr.Markdown('''<center><h1>StyleGAN-Human</h1></center>
30
-
31
- This is a Blocks version of [this app](https://huggingface.co/spaces/hysts/StyleGAN-Human) and [this app](https://huggingface.co/spaces/hysts/StyleGAN-Human-Interpolation).
32
- ''')
33
 
34
  with gr.Row():
35
  with gr.Column():
@@ -74,9 +78,7 @@ This is a Blocks version of [this app](https://huggingface.co/spaces/hysts/Style
74
  with gr.Row():
75
  interpolated_images = gr.Gallery(label='Output Images')
76
 
77
- gr.Markdown(
78
- '<center><img src="https://visitor-badge.glitch.me/badge?page_id=gradio-blocks.stylegan-human" alt="visitor badge"/></center>'
79
- )
80
 
81
  generate_button1.click(app.generate_single_image,
82
  inputs=[seed1, psi1],
 
9
 
10
  from model import Model
11
 
12
+ DESCRIPTION = '''# StyleGAN-Human
13
+
14
+ This is an unofficial demo for [https://github.com/stylegan-human/StyleGAN-Human](https://github.com/stylegan-human/StyleGAN-Human).
15
+ '''
16
+ FOOTER = '<img id="visitor-badge" alt="visitor badge" src="https://visitor-badge.glitch.me/badge?page_id=gradio-blocks.stylegan-human" />'
17
+
18
+
19
  def parse_args() -> argparse.Namespace:
20
  parser = argparse.ArgumentParser()
21
  parser.add_argument('--device', type=str, default='cpu')
 
32
  args = parse_args()
33
  app = Model(device=args.device)
34
 
35
+ with gr.Blocks(theme=args.theme, css='style.css') as demo:
36
+ gr.Markdown(DESCRIPTION)
 
 
 
37
 
38
  with gr.Row():
39
  with gr.Column():
 
78
  with gr.Row():
79
  interpolated_images = gr.Gallery(label='Output Images')
80
 
81
+ gr.Markdown(FOOTER)
 
 
82
 
83
  generate_button1.click(app.generate_single_image,
84
  inputs=[seed1, psi1],
style.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ h1 {
2
+ text-align: center;
3
+ }
4
+ img#visitor-badge {
5
+ display: block;
6
+ margin: auto;
7
+ }