Spaces:
Runtime error
Runtime error
autonomous019
commited on
Commit
•
a7f36d2
1
Parent(s):
808eb6f
bugs
Browse files
app.py
CHANGED
@@ -70,7 +70,7 @@ def self_caption(image):
|
|
70 |
preds = [pred.strip() for pred in preds]
|
71 |
print("Predictions")
|
72 |
print(preds)
|
73 |
-
|
74 |
|
75 |
return(preds[0].split('.')[0])
|
76 |
|
@@ -93,7 +93,7 @@ def classify_image(image):
|
|
93 |
image = gr.inputs.Image(type="pil")
|
94 |
image_piped = ""
|
95 |
label = gr.outputs.Label(num_top_classes=5)
|
96 |
-
examples = [["cats.jpg"]
|
97 |
title = "Generate a Story from an Image"
|
98 |
description = "Demo for classifying images with Perceiver IO. To use it, simply upload an image and click 'submit' to let the model predict the 5 most probable ImageNet classes. Results will show up in a few seconds." + image_piped
|
99 |
article = "<p style='text-align: center'></p>"
|
@@ -118,6 +118,6 @@ print("running parallel call")
|
|
118 |
Parallel(
|
119 |
img_info1,
|
120 |
img_info2,
|
121 |
-
inputs=image, outputs=label, title=title, description=description, examples=
|
122 |
|
123 |
|
|
|
70 |
preds = [pred.strip() for pred in preds]
|
71 |
print("Predictions")
|
72 |
print(preds)
|
73 |
+
print("The preds type is : ",type(preds))
|
74 |
|
75 |
return(preds[0].split('.')[0])
|
76 |
|
|
|
93 |
image = gr.inputs.Image(type="pil")
|
94 |
image_piped = ""
|
95 |
label = gr.outputs.Label(num_top_classes=5)
|
96 |
+
examples = [["cats.jpg"]]
|
97 |
title = "Generate a Story from an Image"
|
98 |
description = "Demo for classifying images with Perceiver IO. To use it, simply upload an image and click 'submit' to let the model predict the 5 most probable ImageNet classes. Results will show up in a few seconds." + image_piped
|
99 |
article = "<p style='text-align: center'></p>"
|
|
|
118 |
Parallel(
|
119 |
img_info1,
|
120 |
img_info2,
|
121 |
+
inputs=image, outputs=label, title=title, description=description, examples=examples, enable_queue=True).launch(debug=True)
|
122 |
|
123 |
|