Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,13 +9,15 @@ sample_img_paths = [str(p) for p in Path('./samples').glob('*.png')]
|
|
9 |
def predict(input_img):
|
10 |
predictions = pipeline(input_img)
|
11 |
return input_img, {p["label"]: p["score"] for p in predictions}
|
|
|
12 |
gradio_app = gr.Interface(
|
13 |
predict,
|
14 |
-
inputs=gr.
|
15 |
outputs=gr.Label(label="Result", num_top_classes=2),
|
16 |
examples=sample_img_paths,
|
17 |
title="TCG Magic Classifier",
|
18 |
description='This classifier returns the id of cards from scryfall!, try one of the samples below'
|
19 |
)
|
20 |
|
21 |
-
if __name__ == "__main__":
|
|
|
|
9 |
def predict(input_img):
|
10 |
predictions = pipeline(input_img)
|
11 |
return input_img, {p["label"]: p["score"] for p in predictions}
|
12 |
+
|
13 |
gradio_app = gr.Interface(
|
14 |
predict,
|
15 |
+
inputs=gr.Image(label="Select Magic Card", type="pil"),
|
16 |
outputs=gr.Label(label="Result", num_top_classes=2),
|
17 |
examples=sample_img_paths,
|
18 |
title="TCG Magic Classifier",
|
19 |
description='This classifier returns the id of cards from scryfall!, try one of the samples below'
|
20 |
)
|
21 |
|
22 |
+
if __name__ == "__main__":
|
23 |
+
gradio_app.launch()
|