Kaushik Bar commited on
Commit
8076002
1 Parent(s): 47011be
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -14,7 +14,8 @@ def shot(image, labels_text):
14
  labels = labels_text.split(";;")
15
  res = pipe(images=PIL_image,
16
  candidate_labels=labels,
17
- hypothesis_template="This is a photo of {}")
 
18
  return {dic["label"]: dic["score"] for dic in res}
19
 
20
  iface = gr.Interface(shot,
@@ -22,7 +23,7 @@ iface = gr.Interface(shot,
22
  "label",
23
  examples=[
24
  ["examples/test1/1.jpg", "ralph lauren;;apparel store;;ralph lauren store;;shirts;;wardrobe;;white flower"],
25
- ["examples/test1/2.JPG", "adidas;;apparel store;;adidas store;;shirts;;wardrobe;;women training shoes;;shoes"],
26
 
27
  #["examples/test2/1.jpg", test2_labels],
28
  #["examples/test2/2.jpg", test2_labels],
 
14
  labels = labels_text.split(";;")
15
  res = pipe(images=PIL_image,
16
  candidate_labels=labels,
17
+ hypothesis_template="This is a photo of {}",
18
+ multi_label=True)
19
  return {dic["label"]: dic["score"] for dic in res}
20
 
21
  iface = gr.Interface(shot,
 
23
  "label",
24
  examples=[
25
  ["examples/test1/1.jpg", "ralph lauren;;apparel store;;ralph lauren store;;shirts;;wardrobe;;white flower"],
26
+ ["examples/test1/2.JPG", "adidas;;apparel store;;adidas store;;shirts;;wardrobe;;women training;;shoes"],
27
 
28
  #["examples/test2/1.jpg", test2_labels],
29
  #["examples/test2/2.jpg", test2_labels],