Docty commited on
Commit
28aea10
·
verified ·
1 Parent(s): 6c1bdf3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -3,6 +3,7 @@ from PIL import Image
3
  from transformers import pipeline
4
 
5
 
 
6
  classifier = pipeline("image-classification", model="Docty/mango-samu")
7
 
8
  def classify_image(img):
@@ -28,7 +29,18 @@ with gr.Blocks(theme=theme) as demo:
28
  label_output = gr.Label(num_top_classes=3, label="Predictions")
29
 
30
  classify_btn = gr.Button("Classify Image", variant="primary")
31
-
 
 
 
 
 
 
 
 
 
 
 
32
  classify_btn.click(fn=classify_image, inputs=image_input, outputs=label_output)
33
 
34
  demo.launch(share=True)
 
3
  from transformers import pipeline
4
 
5
 
6
+ #classifier = pipeline("image-classification", model="/content/mango-samu")
7
  classifier = pipeline("image-classification", model="Docty/mango-samu")
8
 
9
  def classify_image(img):
 
29
  label_output = gr.Label(num_top_classes=3, label="Predictions")
30
 
31
  classify_btn = gr.Button("Classify Image", variant="primary")
32
+ gr.Examples(
33
+ examples=[
34
+ "0.jpg",
35
+ "1.jpg",
36
+ "2.jpg",
37
+ "3.jpg"
38
+ ],
39
+ inputs=image_input,
40
+ outputs=label_output,
41
+ fn=classify_image,
42
+ cache_examples=False # set True if you want cached predictions
43
+ )
44
  classify_btn.click(fn=classify_image, inputs=image_input, outputs=label_output)
45
 
46
  demo.launch(share=True)