Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -184,25 +184,20 @@ with gr.Blocks(
|
|
184 |
) as demo:
|
185 |
gr.Markdown(DESCRIPTION)
|
186 |
|
187 |
-
#
|
188 |
with gr.Row():
|
189 |
image_input = gr.Image(elem_id="image_input", type="pil")
|
190 |
output_components = [
|
191 |
gr.Textbox(label="Mineral Name", elem_id="predicted_class_name"),
|
192 |
gr.Textbox(label="Prediction Scores of Model", elem_id="predicted_scores", lines=5),
|
193 |
-
gr.Textbox(label="Key Facts About Mineral", elem_id="mineral_key_facts", lines=8)
|
194 |
]
|
195 |
image_button = gr.Button("Classify Mineral")
|
196 |
image_button.click(classify_image, inputs=image_input, outputs=output_components)
|
197 |
|
198 |
-
with gr.Row():
|
199 |
-
gr.Textbox(label="Mineral Detection", elem_id="mineral_detection_output", lines=3)
|
200 |
-
gr.Textbox(label="Mineral Classification", elem_id="mineral_classification_output", lines=3)
|
201 |
-
gr.Textbox(label="Mineral Key Facts", elem_id="mineral_key_facts_output", lines=8)
|
202 |
gr.Examples(
|
203 |
-
examples=[
|
204 |
inputs=image_input,
|
205 |
-
|
206 |
-
|
207 |
)
|
208 |
-
|
|
|
|
184 |
) as demo:
|
185 |
gr.Markdown(DESCRIPTION)
|
186 |
|
187 |
+
# Create interface components
|
188 |
with gr.Row():
|
189 |
image_input = gr.Image(elem_id="image_input", type="pil")
|
190 |
output_components = [
|
191 |
gr.Textbox(label="Mineral Name", elem_id="predicted_class_name"),
|
192 |
gr.Textbox(label="Prediction Scores of Model", elem_id="predicted_scores", lines=5),
|
193 |
+
gr.Textbox(label="Key Facts About Mineral", elem_id="mineral_key_facts", lines=8),
|
194 |
]
|
195 |
image_button = gr.Button("Classify Mineral")
|
196 |
image_button.click(classify_image, inputs=image_input, outputs=output_components)
|
197 |
|
|
|
|
|
|
|
|
|
198 |
gr.Examples(
|
199 |
+
examples=["Gradio examples/Biotite1.jpg", "Gradio examples/Biotite2.jpg", "Gradio examples/Olivine1.jpg", "Gradio examples/Plagioclase1.jpg"],
|
200 |
inputs=image_input,
|
|
|
|
|
201 |
)
|
202 |
+
|
203 |
+
demo.launch(auth_message="Welcome to the Mineral Identification App.")
|