pamunarr commited on
Commit
89bd32e
·
verified ·
1 Parent(s): 01fc1c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -72,13 +72,13 @@ class ZeroShotCLF():
72
 
73
  clf = ZeroShotCLF()
74
 
75
- def clasifica(imagen, clases_, tipos_):
76
- clases = clases_.split(", ")
77
- tipos = tipos_.split(", ")
78
  if len(tipos) == 1:
79
  tipos = tipos[0]
80
  textos = clf.set_classes(clases, tipos)
81
  probs = clf.predict(PIL.Image.fromarray(imagen))[-1]
82
  return {textos[i]: probs[i] for i in range(len(textos))}
83
 
84
- gr.Interface(fn=clasifica, inputs=["image", "text", "text"], outputs="text").launch(share=False)
 
72
 
73
  clf = ZeroShotCLF()
74
 
75
+ def clasifica(Image, Types, Classes):
76
+ clases = Classes.split(", ")
77
+ tipos = Types.split(", ")
78
  if len(tipos) == 1:
79
  tipos = tipos[0]
80
  textos = clf.set_classes(clases, tipos)
81
  probs = clf.predict(PIL.Image.fromarray(imagen))[-1]
82
  return {textos[i]: probs[i] for i in range(len(textos))}
83
 
84
+ gr.Interface(fn=clasifica, inputs=["image", "text", "text"], outputs=gr.components.Label()).launch(share=False)