lucasdmpp commited on
Commit
082c81f
1 Parent(s): 8097c33
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -8,6 +8,7 @@ extractor = AutoFeatureExtractor.from_pretrained("saved_model_files")
8
  model = AutoModelForImageClassification.from_pretrained("saved_model_files")
9
 
10
  labels = dataset['train'].features['labels'].names
 
11
 
12
  def classify(im):
13
  features = feature_extractor(im, return_tensors='pt')
@@ -19,6 +20,10 @@ def classify(im):
19
 
20
  import gradio as gr
21
 
22
- interface = gr.Interface(classify, inputs='image', outputs='label', title='Bean Classification', description='Check the health of your bean leaves')
 
 
 
 
23
 
24
  interface.launch(debug=True)
 
8
  model = AutoModelForImageClassification.from_pretrained("saved_model_files")
9
 
10
  labels = dataset['train'].features['labels'].names
11
+ example_imgs = ["example_0.jpg", "example_1.jpg","example_2.jpg"]
12
 
13
  def classify(im):
14
  features = feature_extractor(im, return_tensors='pt')
 
20
 
21
  import gradio as gr
22
 
23
+ interface = gr.Interface(classify, inputs='image',
24
+ outputs='label',
25
+ title='Bean Classification',
26
+ description='Check the health of your bean leaves',
27
+ examples = example_imgs)
28
 
29
  interface.launch(debug=True)