Initial commit for tst
This commit is contained in:
44
AIMonitor/run.sh
Normal file
44
AIMonitor/run.sh
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
# AI监控系统启动脚本
|
||||
|
||||
echo "=== AI监控系统启动 ==="
|
||||
|
||||
# 检查Python环境
|
||||
if ! command -v python3 &> /dev/null; then
|
||||
echo "错误: 未找到python3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 安装依赖(如果需要)
|
||||
echo "检查依赖..."
|
||||
python3 -c "import cv2, yaml, websockets, flask" 2>/dev/null || {
|
||||
echo "正在安装依赖..."
|
||||
pip3 install -r requirements.txt
|
||||
}
|
||||
|
||||
# 创建必要的目录
|
||||
mkdir -p videos
|
||||
mkdir -p YOLO_Pipe_results
|
||||
|
||||
echo "启动RTSP视频流处理服务..."
|
||||
# 后台启动RTSP服务
|
||||
python3 rtsp_service_ws.py &
|
||||
RTSP_PID=$!
|
||||
|
||||
echo "启动静态文件服务..."
|
||||
# 后台启动HTTP服务
|
||||
python3 static_server.py &
|
||||
HTTP_PID=$!
|
||||
|
||||
echo "=== 系统启动完成 ==="
|
||||
echo "RTSP WebSocket服务: ws://localhost:8765 (PID: $RTSP_PID)"
|
||||
echo "静态文件服务: http://localhost:5000 (PID: $HTTP_PID)"
|
||||
echo ""
|
||||
echo "按任意键停止所有服务..."
|
||||
read -n 1
|
||||
|
||||
echo "正在停止服务..."
|
||||
kill $RTSP_PID 2>/dev/null
|
||||
kill $HTTP_PID 2>/dev/null
|
||||
echo "所有服务已停止"
|
||||
Reference in New Issue
Block a user