nickmuchi commited on
Commit
ff93443
1 Parent(s): f0ed081

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -61,7 +61,9 @@ def set_example_url(example: list) -> dict:
61
 
62
  title = """<h1 id="title">Plant Health Classification with ViT</h1>"""
63
 
64
- gr.Image('images/Healthy.png',label = 'Healthy Plant'), gr.Image('images/sickie.png',label = 'Infected Plant')
 
 
65
 
66
  description = """
67
  This Plant Health classifier app was built to detect the health of plants using images of leaves by fine-tuning a Vision Transformer (ViT) [google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224) on the [Beans](https://huggingface.co/datasets/beans) dataset.
@@ -70,9 +72,9 @@ The finetuned model has an accuracy of 98.4% on the test (unseen) dataset and 10
70
  How to use the app:
71
  - Upload an image via 3 options, uploading the image from local device, using a URL (image from the web) or a webcam
72
  - The app will take a few seconds to generate a prediction with the following labels:
73
- - *'angular_leaf_spot'*
74
- - *'bean_rust'*
75
- - *'healthy'*
76
  - Feel free to click the image examples as well.
77
  """
78
  urls = ["https://www.healthbenefitstimes.com/green-beans/","https://huggingface.co/nateraw/vit-base-beans/resolve/main/angular_leaf_spot.jpeg", "https://huggingface.co/nateraw/vit-base-beans/resolve/main/bean_rust.jpeg"]
@@ -98,7 +100,7 @@ with demo:
98
  with gr.TabItem('Image Upload'):
99
  with gr.Row():
100
  with gr.Column():
101
- img_input = gr.Image(type='pil',shape=(750,750))
102
  label_from_upload= gr.Label(num_top_classes=3)
103
 
104
  with gr.Row():
@@ -111,7 +113,7 @@ with demo:
111
  with gr.Row():
112
  with gr.Column():
113
  url_input = gr.Textbox(lines=2,label='Enter valid image URL here..')
114
- original_image = gr.Image(shape=(750,750))
115
  url_input.change(get_original_image, url_input, original_image)
116
  with gr.Column():
117
  label_from_url = gr.Label(num_top_classes=3)
 
61
 
62
  title = """<h1 id="title">Plant Health Classification with ViT</h1>"""
63
 
64
+ gr.Image('images/Healthy.png',label = 'Healthy Plant')
65
+
66
+ gr.Image('images/sickie.png',label = 'Infected Plant')
67
 
68
  description = """
69
  This Plant Health classifier app was built to detect the health of plants using images of leaves by fine-tuning a Vision Transformer (ViT) [google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224) on the [Beans](https://huggingface.co/datasets/beans) dataset.
 
72
  How to use the app:
73
  - Upload an image via 3 options, uploading the image from local device, using a URL (image from the web) or a webcam
74
  - The app will take a few seconds to generate a prediction with the following labels:
75
+ - *angular_leaf_spot*
76
+ - *bean_rust*
77
+ - *healthy*
78
  - Feel free to click the image examples as well.
79
  """
80
  urls = ["https://www.healthbenefitstimes.com/green-beans/","https://huggingface.co/nateraw/vit-base-beans/resolve/main/angular_leaf_spot.jpeg", "https://huggingface.co/nateraw/vit-base-beans/resolve/main/bean_rust.jpeg"]
 
100
  with gr.TabItem('Image Upload'):
101
  with gr.Row():
102
  with gr.Column():
103
+ img_input = gr.Image(type='pil',shape=(450,450))
104
  label_from_upload= gr.Label(num_top_classes=3)
105
 
106
  with gr.Row():
 
113
  with gr.Row():
114
  with gr.Column():
115
  url_input = gr.Textbox(lines=2,label='Enter valid image URL here..')
116
+ original_image = gr.Image(shape=(450,450))
117
  url_input.change(get_original_image, url_input, original_image)
118
  with gr.Column():
119
  label_from_url = gr.Label(num_top_classes=3)