Update
Browse files
app.py
CHANGED
|
@@ -21,6 +21,11 @@ import torch
|
|
| 21 |
import torch.nn as nn
|
| 22 |
from models.generator import Generator
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
TOKEN = os.environ['TOKEN']
|
| 25 |
|
| 26 |
MODEL_REPO = 'hysts/StyleSwin'
|
|
@@ -105,11 +110,6 @@ def main():
|
|
| 105 |
device=device)
|
| 106 |
func = functools.update_wrapper(func, generate_image)
|
| 107 |
|
| 108 |
-
repo_url = 'https://github.com/microsoft/StyleSwin'
|
| 109 |
-
title = 'microsoft/StyleSwin'
|
| 110 |
-
description = f'A demo for {repo_url}'
|
| 111 |
-
article = None
|
| 112 |
-
|
| 113 |
gr.Interface(
|
| 114 |
func,
|
| 115 |
[
|
|
@@ -121,10 +121,10 @@ def main():
|
|
| 121 |
gr.inputs.Slider(0, 2147483647, step=1, default=0, label='Seed'),
|
| 122 |
],
|
| 123 |
gr.outputs.Image(type='pil', label='Output'),
|
|
|
|
|
|
|
|
|
|
| 124 |
theme=args.theme,
|
| 125 |
-
title=title,
|
| 126 |
-
description=description,
|
| 127 |
-
article=article,
|
| 128 |
allow_screenshot=args.allow_screenshot,
|
| 129 |
allow_flagging=args.allow_flagging,
|
| 130 |
live=args.live,
|
|
|
|
| 21 |
import torch.nn as nn
|
| 22 |
from models.generator import Generator
|
| 23 |
|
| 24 |
+
REPO_URL = 'https://github.com/microsoft/StyleSwin'
|
| 25 |
+
TITLE = 'microsoft/StyleSwin'
|
| 26 |
+
DESCRIPTION = f'A demo for {REPO_URL}'
|
| 27 |
+
ARTICLE = None
|
| 28 |
+
|
| 29 |
TOKEN = os.environ['TOKEN']
|
| 30 |
|
| 31 |
MODEL_REPO = 'hysts/StyleSwin'
|
|
|
|
| 110 |
device=device)
|
| 111 |
func = functools.update_wrapper(func, generate_image)
|
| 112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
gr.Interface(
|
| 114 |
func,
|
| 115 |
[
|
|
|
|
| 121 |
gr.inputs.Slider(0, 2147483647, step=1, default=0, label='Seed'),
|
| 122 |
],
|
| 123 |
gr.outputs.Image(type='pil', label='Output'),
|
| 124 |
+
title=TITLE,
|
| 125 |
+
description=DESCRIPTION,
|
| 126 |
+
article=ARTICLE,
|
| 127 |
theme=args.theme,
|
|
|
|
|
|
|
|
|
|
| 128 |
allow_screenshot=args.allow_screenshot,
|
| 129 |
allow_flagging=args.allow_flagging,
|
| 130 |
live=args.live,
|