-
Notifications
You must be signed in to change notification settings - Fork 1
/
starter.py
45 lines (28 loc) · 968 Bytes
/
starter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python3
# import daemon
from ds import *
from ha import *
from dahua import *
from ipc import *
from gk import *
from time import sleep
RTSP_STREAM = "rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0"
def main():
cameraControl = Dahua()
hac = HAConnect(cameraControl)
gk = GateKeeper(cameraControl, hac)
ds_fr = DeepStack("192.168.1.200:5000", Mode.FR, gk.process)
ds_od = DeepStack("192.168.1.201:5001", Mode.OD, gk.process)
front = IPC(RTSP_STREAM, cameraControl, ds_fr, ds_od, hac)
while True:
print(datetime.now().strftime("%H:%M:%S")+": Front: %.1f" % front.fps +" OD: %.1f" % ds_od.fps +" FR: %.1f" %ds_fr.fps,end="\r")
d = {}
d["ipc"] = front.fps
d["od"] = ds_od.fps
d["fr"] = ds_fr.fps
hac.send("ai/stats",json.dumps(d))
sleep(10)
if __name__ == "__main__":
main()
# with daemon.DaemonContext():
# main()