Spaces:
No application file
No application file
Download Project SEAS from ProjectSEAS/projectseas6: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/spaces/ProjectSEAS/projectseas6/resolve/main/Project%20SEAS
- Command line
-
hf download 'hf://spaces/ProjectSEAS/projectseas6/Project SEAS'
-
curl -L -o 'Project SEAS' https://huggingface.co/spaces/ProjectSEAS/projectseas6/resolve/main/Project%20SEAS
1.23 kB
| import gradio as gr | |
| import numpy as np | |
| def predict(temp, humidity, wind, soundAbove, soundBelow, ph, turbidity, waterTemp): | |
| """ | |
| Basic water quality risk prediction model. | |
| - High Risk: pH < 6 OR Turbidity > 50 NTU | |
| - Medium Risk: Water Temp > 30°C OR Sound Above > 70dB | |
| - Low Risk: Otherwise | |
| """ | |
| if ph < 6 or turbidity > 50: | |
| risk = "⚠️ High Risk (Poor Water Quality)" | |
| elif waterTemp > 30 or soundAbove > 70: | |
| risk = "⚠️ Medium Risk (Possible Issues)" | |
| else: | |
| risk = "✅ Low Risk (Good Water Quality)" | |
| return risk | |
| # Create a Gradio interface | |
| interface = gr.Interface( | |
| fn=predict, | |
| inputs=[ | |
| gr.Number(label="Ambient Temperature (°C)"), | |
| gr.Number(label="Humidity (%)"), | |
| gr.Number(label="Wind Speed (m/s)"), | |
| gr.Number(label="Sound Above Water (dB)"), | |
| gr.Number(label="Sound Below Water (dB)"), | |
| gr.Number(label="pH Level"), | |
| gr.Number(label="Turbidity (NTU)"), | |
| gr.Number(label="Water Temperature (°C)") | |
| ], | |
| outputs="text", | |
| title="Project SEAS Water Quality ML Model", | |
| description="Predicts water quality risks based on sensor data." | |
| ) | |
| # Launch the model | |
| interface.launch() | |