akansha2k2 commited on
Commit
d8f620d
β€’
1 Parent(s): 47aaca2
Files changed (1) hide show
  1. README.md +16 -3
README.md CHANGED
@@ -1,12 +1,25 @@
1
  ---
2
  title: Sandwich Classifier
3
  emoji: πŸ“Š
4
- colorFrom: green
5
- colorTo: gray
6
  sdk: gradio
7
  sdk_version: 4.31.1
8
  app_file: app.py
9
  pinned: false
10
  ---
 
 
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  title: Sandwich Classifier
3
  emoji: πŸ“Š
4
+ colorFrom: indigo
5
+ colorTo: purple
6
  sdk: gradio
7
  sdk_version: 4.31.1
8
  app_file: app.py
9
  pinned: false
10
  ---
11
+ import gradio as gr
12
+ from transformers import pipeline
13
 
14
+ pipeline = pipeline(task="image-classification", model="akansha2k2/Burger_sandwich_pizza")
15
+
16
+ def predict(image):
17
+ predictions = pipeline(image)
18
+ return {p["label"]: p["score"] for p in predictions}
19
+
20
+ gr.Interface(
21
+ predict,
22
+ inputs=gr.Image(label="Upload junk food (sandwich,pizza,burgur) candidate", type="filepath"),
23
+ outputs=gr.Label(num_top_classes=2),
24
+ title="pizza or burgur or sandwich?",
25
+ ).launch()