Files
hair/requirements.txt
T
xsl 6d9e92f710 chore: torch 升级为 2.11.0+cu128 支持 RTX 5090 (sm_120)
原 torch 2.2.2+cu121 只编到 sm_90,在 RTX 5090 上 GPU 算子报
'no kernel image',接口2 因 SegFormer/BiSeNet 跑不动 GPU 而失败。
venv 实际已升级到 torch 2.11.0+cu128 / torchvision 0.26.0+cu128,
此处同步 requirements.txt 让文档与实际环境一致。

numpy 保持 1.26.4(<2,mediapipe/scikit-image 依赖),cu128 兼容。
2026-07-18 16:30:18 +08:00

34 lines
1.8 KiB
Plaintext
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.
fastapi==0.115.12
uvicorn[standard]==0.34.2
python-multipart==0.0.31
httpx==0.28.1
# 接口1:四庭七眼测量(worker 侧算法依赖)
mediapipe==0.10.14 # MediaPipe Face Mesh(经典 Solutions API,模型内置)
opencv-python==4.10.0.84 # 图片读取/处理 + solvePnP 姿态估计
Pillow==11.0.0 # 标注图生成(PNG 透明图层)
numpy==1.26.4 # 必须 <2,否则 mediapipe 0.10.x import 崩溃
# 方案 B:头发分割(BiSeNet face-parsing
# ⚠️ RTX 5090sm_120/Blackwell)必须用 cu128 构建——cu121(如 torch 2.2.2)只编到
# sm_90GPU 跑算子会报 "no kernel image"。cu128 含 sm_120BiSeNet/SegFormer 走 GPU。
# 安装(走 PyTorch 官方 cu128 index):
# ./venv/bin/pip install --index-url https://download.pytorch.org/whl/cu128 torch==2.11.0 torchvision==0.26.0
# numpy 必须保持 <2mediapipe 0.10.x / scikit-image 0.24.x 依赖),cu128 torch 兼容 numpy 1.26.4。
torch==2.11.0 # +cu128,支持 RTX 5090 sm_120GPU 推理
torchvision==0.26.0
# 接口2C端生发(发际线预览)
# MediaPipe Tasks(FaceLandmarker) 用已装的 mediapipe;新增 SegFormer 人脸分割:
transformers==4.45.2 # SegFormer 人脸分割(jonathandinu/face-parsing,本地权重)
# 接口3:B端生发(马克笔发际线检测)
# ⚠️ 必须 0.24.x —— 0.25+ 强依赖 numpy>=2,会顶掉 mediapipe 需要的 numpy<2
scikit-image==0.24.0 # route_through_array(黑帽响应图上的 Dijkstra 最小路径)
# 接口4:用户特征(火山方舟 豆包视觉模型)—— 已迁到**网关**实现,worker 不需要。
# 网关机装:volcengine-python-sdk[ark]from volcenginesdkarkruntime import Ark);API Key 走配置不入 git
# 测试
pytest==8.3.3