diff --git a/app.py b/app.py index 4bbf336..da4a073 100644 --- a/app.py +++ b/app.py @@ -125,7 +125,9 @@ async def detect(websocket: WebSocket): "cameraIdentifier": camera_id, "timestamp": time.time(), "data": { - "detections": boxes + "detections": boxes, + "modelId": stream['modelId'], + "modelName": stream['modelName'] } } logging.debug(f"Sending detection data for camera {camera_id}: {detection_data}") @@ -154,6 +156,8 @@ async def detect(websocket: WebSocket): camera_id = data.get("cameraIdentifier") rtsp_url = data.get("rtspUrl") model_url = data.get("modelUrl") + modelId = data.get("modelId") + modelName = data.get("modelName") if model_url: print(f"Downloading model from {model_url}") @@ -190,9 +194,11 @@ async def detect(websocket: WebSocket): 'buffer': buffer, 'thread': thread, 'rtsp_url': rtsp_url, - 'stop_event': stop_event + 'stop_event': stop_event, + 'modelId': modelId, + 'modelName': modelName } - logging.info(f"Subscribed to camera {camera_id} with URL {rtsp_url}") + logging.info(f"Subscribed to camera {camera_id} with modelId {modelId}, modelName {modelName} and URL {rtsp_url}") elif camera_id and camera_id in streams: stream = streams.pop(camera_id) stream['cap'].release()