NoCrypt commited on
Commit
34c5f15
1 Parent(s): 3ef5768

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -116,7 +116,9 @@ def predict(image: PIL.Image.Image, score_threshold: float,
116
 
117
  geninfo = items.get('parameters', geninfo)
118
 
119
- info = ''
 
 
120
  for key, text in items.items():
121
  info += f"""
122
  <div>
@@ -126,16 +128,14 @@ def predict(image: PIL.Image.Image, score_threshold: float,
126
  """.strip()+"\n"
127
 
128
  if len(info) == 0:
129
- message = ""
130
  info = f"<div><p>{message}<p></div>"
131
 
132
- return (a,info,res)
133
 
134
 
135
  def main():
136
  args = parse_args()
137
-
138
-
139
  model = load_model()
140
  labels = load_labels()
141
 
@@ -153,9 +153,9 @@ def main():
153
  label='Score Threshold'),
154
  ],
155
  [
156
- gr.outputs.Textbox(label='Output String'),
157
  gr.outputs.HTML(),
158
- gr.outputs.Label(label='Output Labels')
 
159
  ],
160
  examples=[
161
  ['miku.jpg',0.5],
@@ -163,8 +163,9 @@ def main():
163
  ],
164
  title=TITLE,
165
  description='''
166
- Modified from [hysts/DeepDanbooru](https://huggingface.co/spaces/hysts/DeepDanbooru)
167
 
 
168
  PNG Info code forked from [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
169
  ''',
170
  theme=args.theme,
 
116
 
117
  geninfo = items.get('parameters', geninfo)
118
 
119
+ info = f"""
120
+ <p><h4>PNG Info</h4></p>
121
+ """
122
  for key, text in items.items():
123
  info += f"""
124
  <div>
 
128
  """.strip()+"\n"
129
 
130
  if len(info) == 0:
131
+ message = "Nothing found in the image."
132
  info = f"<div><p>{message}<p></div>"
133
 
134
+ return (info,a,res)
135
 
136
 
137
  def main():
138
  args = parse_args()
 
 
139
  model = load_model()
140
  labels = load_labels()
141
 
 
153
  label='Score Threshold'),
154
  ],
155
  [
 
156
  gr.outputs.HTML(),
157
+ gr.outputs.Textbox(label='DeepDanbooru Output (string)'),
158
+ gr.outputs.Label(label='DeepDanbooru Output (label)')
159
  ],
160
  examples=[
161
  ['miku.jpg',0.5],
 
163
  ],
164
  title=TITLE,
165
  description='''
166
+ Demo for [KichangKim/DeepDanbooru](https://github.com/KichangKim/DeepDanbooru) with "ready to copy" prompt and a prompt analyzer.
167
 
168
+ Modified from [hysts/DeepDanbooru](https://huggingface.co/spaces/hysts/DeepDanbooru)
169
  PNG Info code forked from [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
170
  ''',
171
  theme=args.theme,