Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -309,42 +309,54 @@ with gr.Blocks() as demo:
|
|
| 309 |
out_gallery = [gr.Plot() for _ in range(8)]
|
| 310 |
plot_button.click(fn=plot_all, inputs=[], outputs=out_gallery)
|
| 311 |
|
| 312 |
-
with gr.Tab("
|
| 313 |
-
gr.
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
|
|
|
|
|
|
| 324 |
with gr.Tab("Takeaways"):
|
| 325 |
-
gr.Markdown("##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 326 |
gr.Markdown("""
|
| 327 |
-
|
| 328 |
-
-
|
| 329 |
-
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
###
|
| 333 |
-
|
| 334 |
-
-
|
| 335 |
-
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
>
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
|
|
|
| 349 |
|
| 350 |
|
|
|
|
| 309 |
out_gallery = [gr.Plot() for _ in range(8)]
|
| 310 |
plot_button.click(fn=plot_all, inputs=[], outputs=out_gallery)
|
| 311 |
|
| 312 |
+
with gr.Tab("Models"):
|
| 313 |
+
with gr.Tabs():
|
| 314 |
+
with gr.Tab("Random Forest"):
|
| 315 |
+
gr.Image(value="rf.png", label="Random Forest Output")
|
| 316 |
+
|
| 317 |
+
with gr.Tab("Decision Tree"):
|
| 318 |
+
gr.Markdown("**Confusion Matrix**")
|
| 319 |
+
gr.Image(value="tree_cm.png", label="Confusion Matrix")
|
| 320 |
+
gr.Markdown("**Decision Tree Visualization**")
|
| 321 |
+
gr.Image(value="tree.png", label="Tree Structure")
|
| 322 |
+
|
| 323 |
+
with gr.Tab("1D CNN (Raw Data)"):
|
| 324 |
+
gr.Image(value="1d.png", label="1D CNN Output")
|
| 325 |
+
|
| 326 |
with gr.Tab("Takeaways"):
|
| 327 |
+
gr.Markdown("## 🌿 Why Spectroscopy Matters in the Dairy Ecosystem")
|
| 328 |
+
|
| 329 |
+
gr.Markdown("### 👨🌾 Farmers")
|
| 330 |
+
gr.Markdown("""
|
| 331 |
+
- ✅ Enables **quick, non-destructive testing** of milk quality at the source.
|
| 332 |
+
- ⚠️ Allows **early detection** of spoilage, contamination, or adulteration.
|
| 333 |
+
- 💰 Supports **transparent and fair pricing** in cooperative and local markets.
|
| 334 |
+
""")
|
| 335 |
+
|
| 336 |
+
gr.Markdown("### 🏛️ Government & Regulators")
|
| 337 |
gr.Markdown("""
|
| 338 |
+
- 🛡️ Reinforces **food safety and public health** monitoring systems.
|
| 339 |
+
- 📊 Ensures **consistency and traceability** across the dairy supply chain.
|
| 340 |
+
- 🚀 Encourages **innovation in agricultural technologies** and rural development.
|
| 341 |
+
""")
|
| 342 |
+
|
| 343 |
+
gr.Markdown("### 🏭 Businesses & Cooperatives")
|
| 344 |
+
gr.Markdown("""
|
| 345 |
+
- ⏱️ Facilitates **real-time quality control** during production and logistics.
|
| 346 |
+
- 💡 Reduces dependency on slow, expensive lab tests.
|
| 347 |
+
- 🤝 Builds **consumer trust** through transparency and quality assurance.
|
| 348 |
+
""")
|
| 349 |
+
|
| 350 |
+
gr.Markdown("---")
|
| 351 |
+
gr.Markdown("## 🧬 Parting Thought: Healthy Living Starts with Smart Choices")
|
| 352 |
+
gr.Markdown("""
|
| 353 |
+
> “Milk is nature’s first food – and spectroscopy helps us keep it honest, pure, and nutritious.”
|
| 354 |
+
>
|
| 355 |
+
> Embrace technology. Protect health.
|
| 356 |
+
> Let's make every drop of milk safe and reliable – for everyone.
|
| 357 |
+
""")
|
| 358 |
+
|
| 359 |
+
demo.launch(server_name="0.0.0.0", server_port=7860, ssr_mode=False)
|
| 360 |
+
|
| 361 |
|
| 362 |
|