Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -119,14 +119,14 @@ if st.button("Calculate Usable Area and Energy Potential"):
|
|
| 119 |
panel_count = usable_area // panel_area
|
| 120 |
total_cost = panel_count * panel_cost
|
| 121 |
|
| 122 |
-
# Calculate potential energy generation
|
| 123 |
-
|
| 124 |
|
| 125 |
# Display results
|
| 126 |
st.image(cv2.cvtColor(final_image, cv2.COLOR_BGR2RGB), caption="Processed Image with Boundaries")
|
| 127 |
st.write(f"Usable Rooftop Area for Solar Panels (excluding shadows): **{usable_area:.2f} square meters**")
|
| 128 |
st.write(f"Number of 5×5m panels that can be used: **{int(panel_count)}**")
|
| 129 |
st.write(f"Total installation cost (₹25,000 per panel): **₹{int(total_cost):,}**")
|
| 130 |
-
st.write(f"Total potential energy generation per day: **{
|
| 131 |
else:
|
| 132 |
st.error("Please upload an image to proceed.")
|
|
|
|
| 119 |
panel_count = usable_area // panel_area
|
| 120 |
total_cost = panel_count * panel_cost
|
| 121 |
|
| 122 |
+
# Calculate potential energy generation in kWh
|
| 123 |
+
energy_generation_kWh = (usable_area * panel_efficiency * irradiance * sunlight_hours) / 1000 # in kWh
|
| 124 |
|
| 125 |
# Display results
|
| 126 |
st.image(cv2.cvtColor(final_image, cv2.COLOR_BGR2RGB), caption="Processed Image with Boundaries")
|
| 127 |
st.write(f"Usable Rooftop Area for Solar Panels (excluding shadows): **{usable_area:.2f} square meters**")
|
| 128 |
st.write(f"Number of 5×5m panels that can be used: **{int(panel_count)}**")
|
| 129 |
st.write(f"Total installation cost (₹25,000 per panel): **₹{int(total_cost):,}**")
|
| 130 |
+
st.write(f"Total potential energy generation per day: **{energy_generation_kWh:.2f} kWh**")
|
| 131 |
else:
|
| 132 |
st.error("Please upload an image to proceed.")
|