SuriRaja commited on
Commit
d715067
Β·
1 Parent(s): 0882703

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -10
app.py CHANGED
@@ -1,13 +1,11 @@
1
- # app.py
2
-
3
  import gradio as gr
4
  import cv2
5
- import os
6
  from services.video_service import get_video_frame
7
  from services.detection_service import detect_objects
8
- from services.thermal_service import detect_thermal_anomalies, overlay_thermal_boxes
9
  from services.shadow_detection import detect_shadow_coverage
10
  from services.salesforce_dispatcher import send_to_salesforce
 
11
 
12
  frame_gen = get_video_frame("data/drone_day.mp4")
13
 
@@ -26,16 +24,21 @@ def monitor_feed():
26
  "thermal": bool(thermal_boxes),
27
  "shadow_issue": shadow_flag,
28
  }
29
- send_to_salesforce(alert_payload)
30
 
31
- # Overlay thermal boxes
32
- if thermal_boxes:
33
- frame = overlay_thermal_boxes(temp_path, thermal_boxes)
34
 
 
35
  return frame
36
-
37
  except StopIteration:
38
  return None
39
 
40
- iface = gr.Interface(fn=monitor_feed, inputs=[], outputs="image", live=True, title="Solar Surveillance Feed Simulation")
 
 
 
 
 
 
41
  iface.launch()
 
 
 
1
  import gradio as gr
2
  import cv2
 
3
  from services.video_service import get_video_frame
4
  from services.detection_service import detect_objects
5
+ from services.thermal_service import detect_thermal_anomalies
6
  from services.shadow_detection import detect_shadow_coverage
7
  from services.salesforce_dispatcher import send_to_salesforce
8
+ from services.thermal_service import overlay_thermal_boxes
9
 
10
  frame_gen = get_video_frame("data/drone_day.mp4")
11
 
 
24
  "thermal": bool(thermal_boxes),
25
  "shadow_issue": shadow_flag,
26
  }
 
27
 
28
+ # 🚨🚨🚨 ATTENTION! 🚨🚨🚨
29
+ # πŸ”₯ THE BELOW LINE SHOULD BE RE-ENABLED AFTER CONFIGURING SALESFORCE URL PROPERLY πŸ”₯
30
+ # send_to_salesforce(alert_payload)
31
 
32
+ frame = overlay_thermal_boxes(temp_path, thermal_boxes)
33
  return frame
 
34
  except StopIteration:
35
  return None
36
 
37
+ iface = gr.Interface(
38
+ fn=monitor_feed,
39
+ inputs=[],
40
+ outputs="image",
41
+ live=True,
42
+ title="Solar Surveillance Feed Simulation"
43
+ )
44
  iface.launch()