Spaces:
Runtime error
Runtime error
Update
Browse files
app.py
CHANGED
|
@@ -15,8 +15,12 @@ import torch
|
|
| 15 |
import torch.nn as nn
|
| 16 |
import torch.nn.functional as F
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
| 19 |
|
|
|
|
| 20 |
MODEL_REPO = 'hysts/yu4u-age-estimation-pytorch'
|
| 21 |
MODEL_FILENAME = 'pretrained.pth'
|
| 22 |
|
|
@@ -140,20 +144,15 @@ def main():
|
|
| 140 |
image_dir = pathlib.Path('sample_images')
|
| 141 |
examples = [path.as_posix() for path in sorted(image_dir.glob('*.jpg'))]
|
| 142 |
|
| 143 |
-
repo_url = 'https://github.com/yu4u/age-estimation-pytorch'
|
| 144 |
-
title = 'yu4u/age-estimation-pytorch'
|
| 145 |
-
description = f'A demo for {repo_url}'
|
| 146 |
-
article = None
|
| 147 |
-
|
| 148 |
gr.Interface(
|
| 149 |
func,
|
| 150 |
gr.inputs.Image(type='file', label='Input'),
|
| 151 |
gr.outputs.Image(label='Output'),
|
| 152 |
-
theme=args.theme,
|
| 153 |
-
title=title,
|
| 154 |
-
description=description,
|
| 155 |
-
article=article,
|
| 156 |
examples=examples,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
allow_screenshot=args.allow_screenshot,
|
| 158 |
allow_flagging=args.allow_flagging,
|
| 159 |
live=args.live,
|
|
|
|
| 15 |
import torch.nn as nn
|
| 16 |
import torch.nn.functional as F
|
| 17 |
|
| 18 |
+
ORIGINAL_REPO_URL = 'https://github.com/yu4u/age-estimation-pytorch'
|
| 19 |
+
TITLE = 'yu4u/age-estimation-pytorch'
|
| 20 |
+
DESCRIPTION = f'A demo for {ORIGINAL_REPO_URL}'
|
| 21 |
+
ARTICLE = None
|
| 22 |
|
| 23 |
+
TOKEN = os.environ['TOKEN']
|
| 24 |
MODEL_REPO = 'hysts/yu4u-age-estimation-pytorch'
|
| 25 |
MODEL_FILENAME = 'pretrained.pth'
|
| 26 |
|
|
|
|
| 144 |
image_dir = pathlib.Path('sample_images')
|
| 145 |
examples = [path.as_posix() for path in sorted(image_dir.glob('*.jpg'))]
|
| 146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
gr.Interface(
|
| 148 |
func,
|
| 149 |
gr.inputs.Image(type='file', label='Input'),
|
| 150 |
gr.outputs.Image(label='Output'),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
examples=examples,
|
| 152 |
+
title=TITLE,
|
| 153 |
+
description=DESCRIPTION,
|
| 154 |
+
article=ARTICLE,
|
| 155 |
+
theme=args.theme,
|
| 156 |
allow_screenshot=args.allow_screenshot,
|
| 157 |
allow_flagging=args.allow_flagging,
|
| 158 |
live=args.live,
|