Harsh-7300 commited on
Commit
608a39b
·
verified ·
1 Parent(s): a34ee4e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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
- energy_generation = usable_area * panel_efficiency * irradiance * sunlight_hours # in Wh (Watt-hours)
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:.2f} Wh**")
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.")