CesarLeblanc commited on
Commit
142304a
1 Parent(s): 544f914
Files changed (2) hide show
  1. app.py +9 -9
  2. requirements.txt +2 -1
app.py CHANGED
@@ -121,27 +121,27 @@ with gr.Blocks() as demo:
121
  gr.Markdown("""<h3 style="text-align: center;">Classification of vegetation plots!</h3>""")
122
  with gr.Row():
123
  with gr.Column():
124
- species = gr.Textbox(lines=2, label="Species", placeholder="Enter a list of comma-separated binomial names here.")
125
- top_k = gr.Slider(1, 5, value=1, label="Top-k", info="Choose the number of top habitats to display.")
126
  with gr.Column():
127
  text_output_1 = gr.Textbox()
128
  text_output_2 = gr.Image()
129
- text_button = gr.Button("Classify")
130
  gr.Markdown("""<h5 style="text-align: center;">An example of input</h5>""")
131
- gr.Examples([["sparganium erectum, calystegia sepium, persicaria amphibia", 1]], [species, top_k], [text_output_1, text_output_2], classification, True)
132
 
133
  with gr.Tab("Missing species finding"):
134
  gr.Markdown("""<h3 style="text-align: center;">Finding the missing species!</h3>""")
135
  with gr.Row():
136
- species_2 = gr.Textbox(lines=2, label="Species", placeholder="Enter a list of comma-separated binomial names here.")
137
  with gr.Column():
138
  image_output_1 = gr.Textbox()
139
  image_output_2 = gr.Image()
140
- image_button = gr.Button("Find")
141
  gr.Markdown("""<h5 style="text-align: center;">An example of input</h5>""")
142
- gr.Examples([["vaccinium myrtillus, dryopteris dilatata, molinia caerulea"]], [species_2], [image_output_1, image_output_2], masking, True)
143
 
144
- text_button.click(classification, inputs=[species, top_k], outputs=[text_output_1, text_output_2])
145
- image_button.click(masking, inputs=[species_2], outputs=[image_output_1, image_output_2])
146
 
147
  demo.launch()
 
121
  gr.Markdown("""<h3 style="text-align: center;">Classification of vegetation plots!</h3>""")
122
  with gr.Row():
123
  with gr.Column():
124
+ species_classification = gr.Textbox(lines=2, label="Species", placeholder="Enter a list of comma-separated binomial names here.")
125
+ k_classification = gr.Slider(1, 5, value=1, label="Top-k", info="Choose the number of top habitats to display.")
126
  with gr.Column():
127
  text_output_1 = gr.Textbox()
128
  text_output_2 = gr.Image()
129
+ button_classification = gr.Button("Classify")
130
  gr.Markdown("""<h5 style="text-align: center;">An example of input</h5>""")
131
+ gr.Examples([["sparganium erectum, calystegia sepium, persicaria amphibia", 1]], [species_classification, k_classification], [text_output_1, text_output_2], classification, True)
132
 
133
  with gr.Tab("Missing species finding"):
134
  gr.Markdown("""<h3 style="text-align: center;">Finding the missing species!</h3>""")
135
  with gr.Row():
136
+ species_masking = gr.Textbox(lines=2, label="Species", placeholder="Enter a list of comma-separated binomial names here.")
137
  with gr.Column():
138
  image_output_1 = gr.Textbox()
139
  image_output_2 = gr.Image()
140
+ button_masking = gr.Button("Find")
141
  gr.Markdown("""<h5 style="text-align: center;">An example of input</h5>""")
142
+ gr.Examples([["vaccinium myrtillus, dryopteris dilatata, molinia caerulea"]], [species_masking], [image_output_1, image_output_2], masking, True)
143
 
144
+ button_classification.click(classification, inputs=[species_classification, k_classification], outputs=[text_output_1, text_output_2])
145
+ button_masking.click(masking, inputs=[species_masking], outputs=[image_output_1, image_output_2])
146
 
147
  demo.launch()
requirements.txt CHANGED
@@ -2,4 +2,5 @@ transformers==4.40.2
2
  gradio==4.36.0
3
  torch==2.3.0
4
  datasets==2.19.0
5
- beautifulsoup4==4.12.2
 
 
2
  gradio==4.36.0
3
  torch==2.3.0
4
  datasets==2.19.0
5
+ beautifulsoup4==4.12.2
6
+ openpyxl==3.1.2