Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,21 @@ from transformers import pipeline
|
|
3 |
|
4 |
pipeline = pipeline(task="image-classification", model="rwcuffney/autotrain-pick_a_card-3726099224")
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
def predict(image):
|
7 |
predictions = pipeline(image)
|
8 |
return {p["label"]: p["score"] for p in predictions}
|
|
|
3 |
|
4 |
pipeline = pipeline(task="image-classification", model="rwcuffney/autotrain-pick_a_card-3726099224")
|
5 |
|
6 |
+
def predict(image):
|
7 |
+
predictions = pipeline(image)
|
8 |
+
return {p["label"]: p["score"] for p in predictions}
|
9 |
+
|
10 |
+
gr.Interface(
|
11 |
+
predict,
|
12 |
+
inputs=gr.inputs.Image(label="Upload image of a weather to analyze", type="filepath"),
|
13 |
+
outputs=gr.outputs.Label(num_top_classes=5),
|
14 |
+
title="Playing Card Identification",
|
15 |
+
share=True,
|
16 |
+
).launch()
|
17 |
+
|
18 |
+
|
19 |
+
pipeline = pipeline(task="image-classification", model="rwcuffney/autotrain-pick_a_card-3726099223")
|
20 |
+
|
21 |
def predict(image):
|
22 |
predictions = pipeline(image)
|
23 |
return {p["label"]: p["score"] for p in predictions}
|