将警报通知url放到配置中。其他biz还没有接入警报,似乎不是服务器上最新的代码?待验证
This commit is contained in:
@@ -9,6 +9,7 @@ import requests
|
|||||||
|
|
||||||
# -------------------------- Kadian 检测相关导入 --------------------------
|
# -------------------------- Kadian 检测相关导入 --------------------------
|
||||||
from algorithm.common.npu_yolo_onnx_person_car_phone import YOLOv8_ONNX # 主检测模型(人/车/后备箱/手机)
|
from algorithm.common.npu_yolo_onnx_person_car_phone import YOLOv8_ONNX # 主检测模型(人/车/后备箱/手机)
|
||||||
|
from common.contants import ALERT_PUSH_URL
|
||||||
|
|
||||||
from yolox.tracker.byte_tracker import BYTETracker
|
from yolox.tracker.byte_tracker import BYTETracker
|
||||||
|
|
||||||
@@ -17,8 +18,6 @@ from yolox.tracker.byte_tracker import BYTETracker
|
|||||||
# Kadian 模型路径与ROI(可根据实际情况修改)
|
# Kadian 模型路径与ROI(可根据实际情况修改)
|
||||||
detector_model_path = 'YOLO_Weight/prisoner_model.onnx'
|
detector_model_path = 'YOLO_Weight/prisoner_model.onnx'
|
||||||
|
|
||||||
ALERT_PUSH_URL = "http://123.57.151.210:10000/picenter/websocket/test/process"
|
|
||||||
|
|
||||||
# 输入尺寸
|
# 输入尺寸
|
||||||
input_size = 1280
|
input_size = 1280
|
||||||
|
|
||||||
@@ -430,7 +429,7 @@ class FrameProcessorWorker(threading.Thread):
|
|||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
self.ws_queue.put(msg, timeout=1.0)
|
self.ws_queue.put(msg, timeout=1.0)
|
||||||
#if action_names and len(action_names) > 0:
|
# # if action_names and len(action_names) > 0:
|
||||||
# if push_actions and len(push_actions) > 0:
|
# if push_actions and len(push_actions) > 0:
|
||||||
# # 发送POST请求
|
# # 发送POST请求
|
||||||
# post_msg = msg.copy()
|
# post_msg = msg.copy()
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ database:
|
|||||||
# 服务组配置:每个组有独立的 WebSocket 和算法类型
|
# 服务组配置:每个组有独立的 WebSocket 和算法类型
|
||||||
# debug_mode: True=前台运行(适合PyCharm调试),False=后台运行(适合生产部署)
|
# debug_mode: True=前台运行(适合PyCharm调试),False=后台运行(适合生产部署)
|
||||||
debug_mode: true
|
debug_mode: true
|
||||||
|
alert_push_url: "http://123.57.151.210:10000/picenter/websocket/test/process"
|
||||||
|
|
||||||
service_groups:
|
service_groups:
|
||||||
- name: "kadian_group" # 服务组名称
|
- name: "kadian_group" # 服务组名称
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ from dataclasses import dataclass
|
|||||||
from biz.checkpoint.checkpoint_biz import FrameProcessorWorker
|
from biz.checkpoint.checkpoint_biz import FrameProcessorWorker
|
||||||
# from biz.prison.prison_biz import FrameProcessorWorker
|
# from biz.prison.prison_biz import FrameProcessorWorker
|
||||||
from common.camera_config import CameraConfig, parse_cameras_from_json, parse_cameras_from_yaml
|
from common.camera_config import CameraConfig, parse_cameras_from_json, parse_cameras_from_yaml
|
||||||
|
from common.contants import init_config
|
||||||
from utils.web_socket_sender import WebSocketSender
|
from utils.web_socket_sender import WebSocketSender
|
||||||
from utils.logger import get_logger
|
from utils.logger import get_logger
|
||||||
|
|
||||||
@@ -333,6 +334,9 @@ if __name__ == "__main__":
|
|||||||
parser.add_argument("--algorithm", type=str, default="", help="Algorithm type")
|
parser.add_argument("--algorithm", type=str, default="", help="Algorithm type")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# 初始化全局配置
|
||||||
|
init_config(args.config)
|
||||||
|
|
||||||
# 优先使用命令行传入的 cameras JSON,否则读取配置文件
|
# 优先使用命令行传入的 cameras JSON,否则读取配置文件
|
||||||
if args.cameras:
|
if args.cameras:
|
||||||
cameras = parse_cameras_from_json(args.cameras)
|
cameras = parse_cameras_from_json(args.cameras)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import queue
|
|||||||
|
|
||||||
from biz.checkpoint.checkpoint_biz import FrameProcessorWorker
|
from biz.checkpoint.checkpoint_biz import FrameProcessorWorker
|
||||||
from common.camera_config import CameraConfig, parse_cameras_from_json, parse_cameras_from_yaml
|
from common.camera_config import CameraConfig, parse_cameras_from_json, parse_cameras_from_yaml
|
||||||
|
from common.contants import init_config
|
||||||
from test_cam import get_camera_preview_url
|
from test_cam import get_camera_preview_url
|
||||||
from utils.web_socket_sender import WebSocketSender
|
from utils.web_socket_sender import WebSocketSender
|
||||||
|
|
||||||
@@ -209,6 +210,9 @@ if __name__ == "__main__":
|
|||||||
parser.add_argument("--algorithm", type=str, default="", help="Algorithm type")
|
parser.add_argument("--algorithm", type=str, default="", help="Algorithm type")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# 初始化全局配置
|
||||||
|
init_config(args.config)
|
||||||
|
|
||||||
# 优先使用命令行传入的 cameras JSON,否则读取配置文件
|
# 优先使用命令行传入的 cameras JSON,否则读取配置文件
|
||||||
if args.cameras:
|
if args.cameras:
|
||||||
cameras = parse_cameras_from_json(args.cameras)
|
cameras = parse_cameras_from_json(args.cameras)
|
||||||
|
|||||||
Reference in New Issue
Block a user