|
|
@@ -135,7 +135,7 @@ def create_app(test_mode: bool = False) -> FastAPI:
|
|
|
)
|
|
|
|
|
|
if SYSTEM_CONFIG.get("enable_detection", True) and detector_service is not None:
|
|
|
- def panorama_detect_loop(g=gid, uploader=uploader, detector=detector_service):
|
|
|
+ def panorama_detect_loop(g=gid, uploader=uploader, detector=detector_service, install_address=group.get("panorama", {}).get("install_address", "")):
|
|
|
interval = 0.5
|
|
|
frame_count = 0
|
|
|
while not stop_event.is_set():
|
|
|
@@ -156,7 +156,7 @@ def create_app(test_mode: bool = False) -> FastAPI:
|
|
|
} for d in dets]
|
|
|
for dd in det_dicts:
|
|
|
print(f"[detect] {g} bbox={dd['bbox']} conf={dd['confidence']:.3f}")
|
|
|
- uploader.handle_detection("panorama", frame, det_dicts)
|
|
|
+ uploader.handle_detection("panorama", frame, det_dicts, install_address)
|
|
|
for d in det_dicts:
|
|
|
x1, y1, x2, y2 = d["bbox"]
|
|
|
cv2.rectangle(marked, (x1, y1), (x2, y2), (0, 255, 0), 2)
|
|
|
@@ -174,7 +174,7 @@ def create_app(test_mode: bool = False) -> FastAPI:
|
|
|
threads.append(t_panorama)
|
|
|
|
|
|
if ptz_url:
|
|
|
- def ptz_detect_loop(g=gid, uploader=uploader, detector=detector_service):
|
|
|
+ def ptz_detect_loop(g=gid, uploader=uploader, detector=detector_service, install_address=group.get("ptz", {}).get("install_address", "")):
|
|
|
interval = 0.5
|
|
|
while not stop_event.is_set():
|
|
|
try:
|
|
|
@@ -189,7 +189,7 @@ def create_app(test_mode: bool = False) -> FastAPI:
|
|
|
} for d in dets]
|
|
|
for dd in det_dicts:
|
|
|
print(f"[detect] {g} PTZ bbox={dd['bbox']} conf={dd['confidence']:.3f}")
|
|
|
- uploader.handle_detection("ptz", frame, det_dicts)
|
|
|
+ uploader.handle_detection("ptz", frame, det_dicts, install_address)
|
|
|
except Exception as exc:
|
|
|
print(f"[ptz_detect_loop {g}] error: {exc}")
|
|
|
time.sleep(interval)
|