Spaces:
Runtime error
Runtime error
ganesh1410
commited on
Commit
•
57ecb4e
1
Parent(s):
60b57d9
fix: label issue
Browse files
app.py
CHANGED
@@ -38,8 +38,8 @@ if __name__ == '__main__':
|
|
38 |
def predict(image):
|
39 |
img = PILImage.create(image)
|
40 |
_,_,probs = model.predict(img)
|
41 |
-
return {'Not Cat':float("{:.2f}".format(probs[0].item())), 'Cat':float("{:.2f}".format(probs[1].item()))}
|
42 |
|
43 |
# outputs label is not working, need to investigate further
|
44 |
-
demo = gr.Interface(fn=
|
45 |
demo.launch(show_error=True)
|
|
|
38 |
def predict(image):
|
39 |
img = PILImage.create(image)
|
40 |
_,_,probs = model.predict(img)
|
41 |
+
return {'Not a Cat':float("{:.2f}".format(probs[0].item())), 'Cat':float("{:.2f}".format(probs[1].item()))}
|
42 |
|
43 |
# outputs label is not working, need to investigate further
|
44 |
+
demo = gr.Interface(fn=predict, inputs=gr.Image(), outputs='label',examples=['examples/cat-1.jpg','examples/dog-1.jpg'],allow_flagging='never')
|
45 |
demo.launch(show_error=True)
|