Thouph commited on
Commit
13908e1
·
verified ·
1 Parent(s): bde8b77

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -13,7 +13,7 @@ model.eval()
13
  def get_tags(image, threshold, top_k):
14
  current_datetime = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
15
  print(f"{current_datetime}: started.")
16
- results = tagger.predict(src, topk=topk, threshold=threshold)
17
  temp = []
18
  return_dict = dict()
19
  for rank, (tag, score) in enumerate(results, 1):
@@ -27,7 +27,7 @@ def get_tags(image, threshold, top_k):
27
  demo = gr.Interface(
28
  get_tags,
29
  inputs=[
30
- gr.Image(label="Source", sources=['upload',], type='pil'),
31
  gr.Slider(minimum=0.00, maximum=1.00, step=0.01, value=0.30, label="Threshold"),
32
  gr.Slider(minimum=0, maximum=500, step=1, value=30, label="Top K")
33
  ],
 
13
  def get_tags(image, threshold, top_k):
14
  current_datetime = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
15
  print(f"{current_datetime}: started.")
16
+ results = tagger.predict(image, topk=top_k, threshold=threshold)
17
  temp = []
18
  return_dict = dict()
19
  for rank, (tag, score) in enumerate(results, 1):
 
27
  demo = gr.Interface(
28
  get_tags,
29
  inputs=[
30
+ gr.Image(label="Source", sources=['upload',], type='filepath'),
31
  gr.Slider(minimum=0.00, maximum=1.00, step=0.01, value=0.30, label="Threshold"),
32
  gr.Slider(minimum=0, maximum=500, step=1, value=30, label="Top K")
33
  ],