Files
jc-video-recognize/apps/server/start_server_with_env.sh
wwh e97bd503ec feat: 新增PaddlePaddle检测支持,重构项目架构
1. 新增concurrently依赖用于并行启动服务
2. 新增服务器启动脚本统一管理环境变量和虚拟环境
3. 新增PaddlePaddle推理引擎和配套工具代码
4. 新增抽烟检测Paddle模型支持,完善模型管理
5. 重构开发启动脚本,优化开发体验
6. 更新.gitignore排除不必要的外部目录和缓存
7. 完善文档说明,新增PaddlePaddle部署指南
2026-05-21 10:39:26 +08:00

38 lines
1.0 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 服务器启动包装脚本
# 确保 PaddlePaddle 环境变量正确设置
set -e
# 进入脚本所在目录apps/server
cd "$(dirname "$0")"
# 设置 PaddlePaddle 环境变量(必须在 Python 启动前设置)
export FLAGS_enable_pir_api=0
# 显示环境信息
echo "🔧 服务器启动环境"
echo "======================================"
echo "🏷️ FLAGS_enable_pir_api: $FLAGS_enable_pir_api"
echo "📂 工作目录: $(pwd)"
echo "======================================"
# 激活服务器虚拟环境(包含所有必需的 PaddlePaddle 依赖)
if [ -f "venv/bin/activate" ]; then
echo "✅ 激活服务器虚拟环境"
source venv/bin/activate
echo "🐍 Python 解释器: $(which python)"
else
echo "⚠️ 服务器虚拟环境不存在,使用系统环境"
fi
# 显示 Python 版本
echo "📦 Python 版本: $(python --version)"
# 启动服务器
echo "🚀 启动服务器..."
echo "======================================"
# 使用服务器虚拟环境的 Python 运行服务器
exec python main.py