rwcuffney commited on
Commit
93c8a17
1 Parent(s): b02d83a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
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}