Spaces:
Runtime error
Runtime error
CesarLeblanc
commited on
Commit
•
142304a
1
Parent(s):
544f914
- app.py +9 -9
- 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 |
-
|
125 |
-
|
126 |
with gr.Column():
|
127 |
text_output_1 = gr.Textbox()
|
128 |
text_output_2 = gr.Image()
|
129 |
-
|
130 |
gr.Markdown("""<h5 style="text-align: center;">An example of input</h5>""")
|
131 |
-
gr.Examples([["sparganium erectum, calystegia sepium, persicaria amphibia", 1]], [
|
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 |
-
|
137 |
with gr.Column():
|
138 |
image_output_1 = gr.Textbox()
|
139 |
image_output_2 = gr.Image()
|
140 |
-
|
141 |
gr.Markdown("""<h5 style="text-align: center;">An example of input</h5>""")
|
142 |
-
gr.Examples([["vaccinium myrtillus, dryopteris dilatata, molinia caerulea"]], [
|
143 |
|
144 |
-
|
145 |
-
|
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
|