hysts HF staff commited on
Commit
f5184a5
1 Parent(s): 18988d2
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -15,8 +15,12 @@ import numpy as np
15
  import PIL.Image
16
  import tensorflow as tf
17
 
18
- TOKEN = os.environ['TOKEN']
 
 
 
19
 
 
20
  MODEL_REPO = 'hysts/DeepDanbooru'
21
  MODEL_FILENAME = 'model-resnet_custom_v3.h5'
22
  LABEL_FILENAME = 'tags.txt'
@@ -104,11 +108,6 @@ def main():
104
  func = functools.partial(predict, model=model, labels=labels)
105
  func = functools.update_wrapper(func, predict)
106
 
107
- repo_url = 'https://github.com/KichangKim/DeepDanbooru'
108
- title = 'KichangKim/DeepDanbooru'
109
- description = f'A demo for {repo_url}'
110
- article = None
111
-
112
  gr.Interface(
113
  func,
114
  [
@@ -120,11 +119,11 @@ def main():
120
  label='Score Threshold'),
121
  ],
122
  gr.outputs.Label(label='Output'),
123
- theme=args.theme,
124
- title=title,
125
- description=description,
126
- article=article,
127
  examples=examples,
 
 
 
 
128
  allow_screenshot=args.allow_screenshot,
129
  allow_flagging=args.allow_flagging,
130
  live=args.live,
 
15
  import PIL.Image
16
  import tensorflow as tf
17
 
18
+ ORIGINAL_REPO_URL = 'https://github.com/KichangKim/DeepDanbooru'
19
+ TITLE = 'KichangKim/DeepDanbooru'
20
+ DESCRIPTION = f'A demo for {ORIGINAL_REPO_URL}'
21
+ ARTICLE = None
22
 
23
+ TOKEN = os.environ['TOKEN']
24
  MODEL_REPO = 'hysts/DeepDanbooru'
25
  MODEL_FILENAME = 'model-resnet_custom_v3.h5'
26
  LABEL_FILENAME = 'tags.txt'
 
108
  func = functools.partial(predict, model=model, labels=labels)
109
  func = functools.update_wrapper(func, predict)
110
 
 
 
 
 
 
111
  gr.Interface(
112
  func,
113
  [
 
119
  label='Score Threshold'),
120
  ],
121
  gr.outputs.Label(label='Output'),
 
 
 
 
122
  examples=examples,
123
+ title=TITLE,
124
+ description=DESCRIPTION,
125
+ article=ARTICLE,
126
+ theme=args.theme,
127
  allow_screenshot=args.allow_screenshot,
128
  allow_flagging=args.allow_flagging,
129
  live=args.live,