docs(网关待改动§9): 补无GUI服务器系统库依赖 + torch CPU源安装说明 + 无GPU实测结论
This commit is contained in:
+12
-4
@@ -185,20 +185,28 @@ worker 侧已上线 4 条路由,**网关尚无对应转发路由**(当前仅
|
||||
### 网关机部署前检查
|
||||
|
||||
1. **Python 3.10~3.12**(mediapipe 0.10.14 无 3.13 wheel)。
|
||||
2. **安装依赖**(网关 venv,国内镜像):
|
||||
2. **系统库**(无 GUI 服务器跑 opencv/mediapipe 必需,已装可跳过):
|
||||
|
||||
```bash
|
||||
sudo apt install -y libgl1 libglib2.0-0 libegl1
|
||||
```
|
||||
|
||||
3. **安装依赖**(网关 venv,国内镜像):
|
||||
|
||||
```bash
|
||||
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple \
|
||||
mediapipe==0.10.14 opencv-python==4.10.0.84 numpy==1.26.4
|
||||
|
||||
# 可选:BiSeNet 头发分割(发际线 5 点需要)。CPU 版 torch 仅 ~200MB:
|
||||
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple \
|
||||
torch==2.2.2 torchvision==0.17.2 --index-url https://download.pytorch.org/whl/cpu
|
||||
pip install torch==2.2.2 torchvision==0.17.2 --index-url https://download.pytorch.org/whl/cpu
|
||||
# 不装 torch 也能跑:60 个关键点正常返回,发际线 5 点为 null(hairline_source="unavailable")
|
||||
# ⚠️ 网关无 GPU——务必用上面的 CPU 专用源装 torch;装默认 PyPI 版会带 2.5G 的 CUDA 包,浪费但也能跑(自动回退 CPU)
|
||||
```
|
||||
|
||||
3. **权重已入 git**,`git clone/pull` 自动到位:`face_analysis/weights/79999_iter.pth`(51MB)。
|
||||
4. **权重已入 git**,`git clone/pull` 自动到位:`face_analysis/weights/79999_iter.pth`(51MB)。
|
||||
无需手动下载任何模型文件。
|
||||
5. **无 GPU 已实测**:`CUDA_VISIBLE_DEVICES=""` 模拟验证通过(70/70 点,与 GPU 结果一致);
|
||||
CPU 推理 16 核 0.18s/次,网关机核少时约 0.5~2s/次,低频可接受。
|
||||
|
||||
### 部署与冒烟
|
||||
|
||||
|
||||
Reference in New Issue
Block a user