Spaces:
Runtime error
Runtime error
add model
Browse files- .streamlit/config.toml +2 -0
- README.md +21 -2
- _model.py +5 -0
- assets/background.webp +0 -0
- assets/banner.png +0 -0
- assets/logo.png +0 -0
- assets/omdena-logo.png +0 -0
- assets/styles.css +61 -0
- config.py +116 -0
- main.py +78 -0
- requirements.txt +2 -0
.streamlit/config.toml
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
[theme]
|
2 |
+
base="dark"
|
README.md
CHANGED
@@ -5,8 +5,27 @@ colorFrom: indigo
|
|
5 |
colorTo: indigo
|
6 |
sdk: streamlit
|
7 |
sdk_version: 1.30.0
|
8 |
-
app_file:
|
9 |
pinned: false
|
10 |
---
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
colorTo: indigo
|
6 |
sdk: streamlit
|
7 |
sdk_version: 1.30.0
|
8 |
+
app_file: main.py
|
9 |
pinned: false
|
10 |
---
|
11 |
|
12 |
+
# Omdena Algeria & Bhopal Streamlit App
|
13 |
+
|
14 |
+
## Requirements
|
15 |
+
|
16 |
+
To run this locally, you need to have the following dependencies installed:
|
17 |
+
|
18 |
+
- Python 3.8 or above
|
19 |
+
- Streamlit
|
20 |
+
|
21 |
+
```shell
|
22 |
+
pip install -r requirements.txt
|
23 |
+
```
|
24 |
+
|
25 |
+
## Run Web Application Locally
|
26 |
+
|
27 |
+
To start the system, run the following command in your terminal:
|
28 |
+
|
29 |
+
```shell
|
30 |
+
streamlit run main.py
|
31 |
+
```
|
_model.py
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
def model_page():
|
4 |
+
st.info("##### Model is yet to be fitted.")
|
5 |
+
return None
|
assets/background.webp
ADDED
assets/banner.png
ADDED
assets/logo.png
ADDED
assets/omdena-logo.png
ADDED
assets/styles.css
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
h3 {
|
2 |
+
color: #fff;
|
3 |
+
font-size:1.393rem;
|
4 |
+
}
|
5 |
+
|
6 |
+
p {
|
7 |
+
color: #ffffff99;
|
8 |
+
text-shadow: 0px 0px #ffffff99;
|
9 |
+
}
|
10 |
+
|
11 |
+
a:link {
|
12 |
+
text-decoration: none;
|
13 |
+
}
|
14 |
+
a:visited {
|
15 |
+
text-decoration: none;
|
16 |
+
}
|
17 |
+
a:hover {
|
18 |
+
text-decoration: none;
|
19 |
+
}
|
20 |
+
a:active {
|
21 |
+
text-decoration: none;
|
22 |
+
}
|
23 |
+
|
24 |
+
footer {
|
25 |
+
visibility: hidden;
|
26 |
+
}
|
27 |
+
|
28 |
+
body {
|
29 |
+
background-color: #f8f8f8;
|
30 |
+
font-family: Arial, Helvetica, sans-serif;
|
31 |
+
}
|
32 |
+
|
33 |
+
#MainMenu {
|
34 |
+
visibility: hidden;
|
35 |
+
}
|
36 |
+
|
37 |
+
.team-container {
|
38 |
+
display: flex;
|
39 |
+
justify-content: center;
|
40 |
+
flex-wrap: wrap;
|
41 |
+
gap: 20px;
|
42 |
+
margin: 30px auto;
|
43 |
+
}
|
44 |
+
|
45 |
+
.team-member {
|
46 |
+
background-color: #ffffff35;
|
47 |
+
border-radius: 10px;
|
48 |
+
padding: 20px;
|
49 |
+
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
|
50 |
+
text-align: center;
|
51 |
+
width: 200px;
|
52 |
+
height: 130px;
|
53 |
+
}
|
54 |
+
|
55 |
+
[data-testid="stSidebar"] {
|
56 |
+
background-color: #00000050;
|
57 |
+
}
|
58 |
+
|
59 |
+
h1 .sidebar_h1 {
|
60 |
+
color: #00ff00;
|
61 |
+
}
|
config.py
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
CSS = open("assets/styles.css", 'r').read()
|
2 |
+
|
3 |
+
IMG_BANNER = "assets/banner.png"
|
4 |
+
IMG_OMDENA = "assets/omdena-logo.png"
|
5 |
+
IMG_LOGO = "assets/logo.png"
|
6 |
+
|
7 |
+
SIDEBAR_TEXT_1 = """
|
8 |
+
<center><h1>Omdena<br> Algeria & Bhopal<br>Chapter</h1></center>
|
9 |
+
"""
|
10 |
+
SIDEBAR_TEXT_2 = """
|
11 |
+
<hr>
|
12 |
+
<h3 class='sidebar_h1'>Disclaimer</h3>
|
13 |
+
<h5 class='sidebar_h1'>The predictions provided by this system are for informational purposes only.</h5>
|
14 |
+
"""
|
15 |
+
|
16 |
+
|
17 |
+
PROJECT_BACKGROUND = """
|
18 |
+
## Project background
|
19 |
+
The arid climate of several Algerian regions and the water-stressed region of Bhopal, effective water management and forecasting are crucial. This project aims to harness the power of machine learning to address the unique water resource challenges faced by both regions. By creating an open-source solution, we aim to empower Algeria and Bhopal to make informed decisions, optimize resource allocation, and build resilient water infrastructure for a sustainable future. <br><br>
|
20 |
+
Local Chapter Website : [Visit Site](https://www.omdena.com/chapter-challenges/open-source-water-management-and-forecasting-project-in-algeria-and-bhopal) <br>
|
21 |
+
Dagshub Repository : [Visit Site](https://dagshub.com/Omdena/AlgeriaBhopal_WaterManagementandForecasting) <br>
|
22 |
+
"""
|
23 |
+
|
24 |
+
PROJECT_PROBLEM = f"""
|
25 |
+
## The Problem
|
26 |
+
The different water resource challenges faced by both Algeria and Bhopal region in India.
|
27 |
+
"""
|
28 |
+
|
29 |
+
PROJECT_GOALS = """
|
30 |
+
## Project Goals
|
31 |
+
##### **1. Develop a Comprehensive Open-Source Water Management and Forecasting System:**
|
32 |
+
Create a user-friendly platform tailored to the specific needs of Algeria and Bhopal, integrating machine learning algorithms for precise water forecasting and efficient water resource management.
|
33 |
+
##### **2. Enhance Water Resource Utilization:**
|
34 |
+
Improve the sustainable use of water resources in both regions by providing accurate forecasts and real-time monitoring.
|
35 |
+
##### **3. Capacity Building:**
|
36 |
+
Empower local stakeholders in Algeria and Bhopal with the knowledge and tools necessary to make well-informed decisions about water management.
|
37 |
+
##### **4. Community Engagement:**
|
38 |
+
Foster collaboration among local government agencies, NGOs, and the research community to collectively address water-related challenges in both regions.
|
39 |
+
"""
|
40 |
+
|
41 |
+
PROJECT_TIMELINE = """
|
42 |
+
## Project Timeline
|
43 |
+
##### 1. Project Initiation:
|
44 |
+
Define project goals and scope. Identify key stakeholders and project team members and teams. Secure resources.
|
45 |
+
##### 2. Research and Data Collection:
|
46 |
+
Gather historical weather and water data specific to Algeria and Bhopal. Collect satellite imagery and remote sensing data. Use open source data.
|
47 |
+
##### 3. Visualization and Exploration:
|
48 |
+
Visualize and explore the data and identify relevant machine learning algorithms accordingly.
|
49 |
+
##### 4. Development of Water Management Platform:
|
50 |
+
Design and develop the open-source platform for water management and forecasting. Implement machine learning models for water forecasting, water resources disponibility, quality and risks.
|
51 |
+
##### 5. Testing and Validation:
|
52 |
+
Conduct extensive testing of the platform using historical data. Validate the accuracy of machine learning models. Address any issues or bugs that arise during testing.
|
53 |
+
##### 6. Deployment and Maintenance:
|
54 |
+
Deploy the water management platform for operational use. Monitor and maintain the platform. Provide ongoing support and updates.
|
55 |
+
##### 7. Data Dissemination:
|
56 |
+
Refine the github repository of the project and prepare the final demo for presentation on the official platforms of Omdena and the parties involved. Write conference and/or journal papers to publish the presented solutions.
|
57 |
+
"""
|
58 |
+
|
59 |
+
|
60 |
+
ABOUT_US = """
|
61 |
+
<h4 style="text-align: center; color:#FFF6F4 !important;">{More info about the problem statement}</h4><hr>
|
62 |
+
"""
|
63 |
+
|
64 |
+
|
65 |
+
CONTRIBUTORS = """
|
66 |
+
<h1 style="text-align: center; color:#FFF6F4;">A heartfelt thankyou to all our contributors β€οΈ</h1><hr>
|
67 |
+
<div style="text-align:center;">
|
68 |
+
<table>
|
69 |
+
<tr>
|
70 |
+
<th width="20%" style="font-size: 140%;">Chapter Name</th>
|
71 |
+
<th width="20%" style="font-size: 140%;">Chapter Lead</th>
|
72 |
+
</tr>
|
73 |
+
<tr>
|
74 |
+
<td>Omdena Algeria Chapter</td>
|
75 |
+
<td>Chapter Lead</td>
|
76 |
+
</tr>
|
77 |
+
<tr>
|
78 |
+
<td>Omdena Bhopal Chapter</td>
|
79 |
+
<td>Chapter Lead</td>
|
80 |
+
</tr>
|
81 |
+
</table>
|
82 |
+
<br>
|
83 |
+
<table>
|
84 |
+
<tbody>
|
85 |
+
<tr>
|
86 |
+
<th width="20%" style="font-size: 140%;" colspan="3">Contributors</th>
|
87 |
+
</tr>
|
88 |
+
<tr>
|
89 |
+
<td>John Doe</td>
|
90 |
+
<td>John Doe</td>
|
91 |
+
<td>John Doe</td>
|
92 |
+
</tr>
|
93 |
+
<tr>
|
94 |
+
<td>John Doe</td>
|
95 |
+
<td>John Doe</td>
|
96 |
+
<td>John Doe</td>
|
97 |
+
</tr>
|
98 |
+
<tr>
|
99 |
+
<td>John Doe</td>
|
100 |
+
<td>John Doe</td>
|
101 |
+
<td>John Doe</td>
|
102 |
+
</tr>
|
103 |
+
<tr>
|
104 |
+
<td>John Doe</td>
|
105 |
+
<td>John Doe</td>
|
106 |
+
<td>John Doe</td>
|
107 |
+
</tr>
|
108 |
+
<tr>
|
109 |
+
<td>John Doe</td>
|
110 |
+
<td>John Doe</td>
|
111 |
+
<td>John Doe</td>
|
112 |
+
</tr>
|
113 |
+
</tbody>
|
114 |
+
</table>
|
115 |
+
</div>
|
116 |
+
"""
|
main.py
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import base64
|
2 |
+
import streamlit as st
|
3 |
+
|
4 |
+
from config import *
|
5 |
+
from _model import model_page
|
6 |
+
|
7 |
+
st.set_page_config(
|
8 |
+
page_title=f"Omdena Algeria & Bhopal Chapter",
|
9 |
+
page_icon="π¦",
|
10 |
+
initial_sidebar_state="expanded"
|
11 |
+
)
|
12 |
+
|
13 |
+
def set_page_background(png_file):
|
14 |
+
@st.cache_data()
|
15 |
+
def get_base64_of_bin_file(bin_file):
|
16 |
+
with open(bin_file, 'rb') as f:
|
17 |
+
data = f.read()
|
18 |
+
return base64.b64encode(data).decode()
|
19 |
+
|
20 |
+
bin_str = get_base64_of_bin_file(png_file)
|
21 |
+
custom_css = f'''
|
22 |
+
<style>
|
23 |
+
.stApp {{
|
24 |
+
background-image: url("data:image/png;base64,{bin_str}");
|
25 |
+
background-size: cover;
|
26 |
+
background-repeat: no-repeat;
|
27 |
+
background-attachment: scroll;
|
28 |
+
}}
|
29 |
+
|
30 |
+
#MainMenu {{visibility: hidden;}}
|
31 |
+
|
32 |
+
footer {{visibility: hidden;}}
|
33 |
+
icon {{color: white;}}
|
34 |
+
nav-link {{--hover-color: grey; }}
|
35 |
+
nav-link-selected {{background-color: #4ABF7E;}}
|
36 |
+
</style>
|
37 |
+
'''
|
38 |
+
st.markdown(custom_css, unsafe_allow_html=True)
|
39 |
+
|
40 |
+
set_page_background('assets/background.webp')
|
41 |
+
st.markdown(f"<style>{CSS}</style>", unsafe_allow_html=True)
|
42 |
+
|
43 |
+
def home_page():
|
44 |
+
left, mid, right = st.columns([2, 3, 1])
|
45 |
+
with left, right:
|
46 |
+
st.empty()
|
47 |
+
with mid:
|
48 |
+
st.image(IMG_OMDENA, width=180)
|
49 |
+
|
50 |
+
st.write("<center><h1 style='font-size: 2.7rem;'>Water Management and Forecasting Project in Algeria & Bhopal<br><br></h1></center>", unsafe_allow_html=True)
|
51 |
+
|
52 |
+
with st.expander("π **PROJECT PROBLEM**", expanded=True):
|
53 |
+
st.write(PROJECT_PROBLEM)
|
54 |
+
with st.expander("π― **PROJECT GOALS**"):
|
55 |
+
st.write(PROJECT_GOALS)
|
56 |
+
with st.expander("π **PROJECT BACKGROUND**"):
|
57 |
+
st.write(PROJECT_BACKGROUND, unsafe_allow_html=True)
|
58 |
+
with st.expander("π **PROJECT TIMELINE**"):
|
59 |
+
st.write(PROJECT_TIMELINE)
|
60 |
+
|
61 |
+
def main():
|
62 |
+
st.sidebar.image("assets/logo.png")
|
63 |
+
st.sidebar.write(SIDEBAR_TEXT_1, unsafe_allow_html=True)
|
64 |
+
selected_task = st.sidebar.selectbox("Please navigate through the different sections of our website from here", ["Home", "About", "Model", "Contributors"], label_visibility="hidden")
|
65 |
+
st.sidebar.write(SIDEBAR_TEXT_2, unsafe_allow_html=True)
|
66 |
+
|
67 |
+
if selected_task == "Home":
|
68 |
+
home_page()
|
69 |
+
elif selected_task == "About":
|
70 |
+
st.write(ABOUT_US, unsafe_allow_html=True)
|
71 |
+
elif selected_task == "Model":
|
72 |
+
model_page()
|
73 |
+
elif selected_task == "Contributors":
|
74 |
+
st.balloons()
|
75 |
+
st.write(CONTRIBUTORS, unsafe_allow_html=True)
|
76 |
+
|
77 |
+
if __name__ == "__main__":
|
78 |
+
main()
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
streamlit==1.26.0
|
2 |
+
streamlit_option_menu==0.3.6
|