NoCrypt commited on
Commit
64a2ee3
1 Parent(s): 34c5f15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -95,6 +95,7 @@ def predict(image: PIL.Image.Image, score_threshold: float,
95
  res[label] = prob
96
  b = dict(sorted(res.items(),key=lambda item:item[1], reverse=True))
97
  a = ', '.join(list(b.keys())).replace('_',' ').replace('(','\(').replace(')','\)')
 
98
 
99
  items = rawimage.info
100
  geninfo = ''
@@ -131,7 +132,7 @@ def predict(image: PIL.Image.Image, score_threshold: float,
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():
@@ -153,9 +154,10 @@ def main():
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],
@@ -166,6 +168,7 @@ def main():
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,
 
95
  res[label] = prob
96
  b = dict(sorted(res.items(),key=lambda item:item[1], reverse=True))
97
  a = ', '.join(list(b.keys())).replace('_',' ').replace('(','\(').replace(')','\)')
98
+ c = ', '.join(list(b.keys()))
99
 
100
  items = rawimage.info
101
  geninfo = ''
 
132
  message = "Nothing found in the image."
133
  info = f"<div><p>{message}<p></div>"
134
 
135
+ return (a,c,res,info)
136
 
137
 
138
  def main():
 
154
  label='Score Threshold'),
155
  ],
156
  [
157
+ gr.outputs.Textbox(label='Output (string)'),
158
+ gr.outputs.Textbox(label='Output (raw string)'),
159
+ gr.outputs.Label(label='Output (label)'),
160
+ gr.outputs.HTML()
161
  ],
162
  examples=[
163
  ['miku.jpg',0.5],
 
168
  Demo for [KichangKim/DeepDanbooru](https://github.com/KichangKim/DeepDanbooru) with "ready to copy" prompt and a prompt analyzer.
169
 
170
  Modified from [hysts/DeepDanbooru](https://huggingface.co/spaces/hysts/DeepDanbooru)
171
+
172
  PNG Info code forked from [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
173
  ''',
174
  theme=args.theme,