chore: SegFormer 模型不入库,改为手动下载
- .gitignore 排除 hairline/models/face-parsing/model.safetensors(~323MB) - OFFLINE_ASSETS.md 更新:区分已入库文件和需手动下载文件,补充 SegFormer sha256
This commit is contained in:
+2
-2
@@ -10,8 +10,8 @@ gateway/config.json
|
|||||||
# worker 配置(含鉴权密码,不入 git)
|
# worker 配置(含鉴权密码,不入 git)
|
||||||
worker_config.json
|
worker_config.json
|
||||||
|
|
||||||
# 模型权重(不入 git,由 scripts/download_weights.sh 拉取,见 OFFLINE_ASSETS.md)
|
# SegFormer 模型权重(~323MB,体积过大,不入 git,见 OFFLINE_ASSETS.md)
|
||||||
face_analysis/weights/*.pth
|
hairline/models/face-parsing/model.safetensors
|
||||||
|
|
||||||
# 生成的标注图、测试输出
|
# 生成的标注图、测试输出
|
||||||
static/annotations/*
|
static/annotations/*
|
||||||
|
|||||||
+31
-15
@@ -1,19 +1,40 @@
|
|||||||
# 离线资产清单(内网部署用)
|
# 离线资产清单(内网部署用)
|
||||||
|
|
||||||
开发/部署机在内网无法联网,以下模型权重与字体**已预先下载**放在仓库对应目录。
|
## 已入库文件(git clone 后自动到位)
|
||||||
这些文件**不进 git**(见 `.gitignore`),通过文件拷贝(U盘/内网共享)随项目一起带到内网机即可。
|
|
||||||
|
|
||||||
> 拷贝到内网机后,用本文件末尾的 sha256 校验完整性,确认未损坏。
|
以下文件体积适中,已直接提交进 git,clone 仓库即可:
|
||||||
|
|
||||||
## 文件清单
|
|
||||||
|
|
||||||
| 文件 | 路径 | 大小 | 用途 |
|
| 文件 | 路径 | 大小 | 用途 |
|
||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| BiSeNet 主权重 | `face_analysis/weights/79999_iter.pth` | 53,289,463 B (~53MB) | 人脸解析分割(方案 B,取真实发际线/头顶) |
|
| BiSeNet 主权重 | `face_analysis/weights/79999_iter.pth` | ~53MB | 人脸解析分割(接口1方案B,取真实发际线/头顶) |
|
||||||
| resnet18 骨干 | `face_analysis/weights/resnet18-5c106cde.pth` | 46,827,520 B (~45MB) | BiSeNet 的骨干网络,**内网必需**(见下) |
|
| resnet18 骨干 | `face_analysis/weights/resnet18-5c106cde.pth` | ~45MB | BiSeNet 骨干网络 |
|
||||||
| 中文字体 | `face_analysis/fonts/NotoSansCJKsc-Regular.otf` | 16,437,364 B (~16MB) | 标注图中文渲染(= 思源黑体,同一套字体) |
|
| 中文字体 | `face_analysis/fonts/NotoSansCJKsc-Regular.otf` | ~16MB | 标注图中文渲染 |
|
||||||
|
| MediaPipe 模型 | `hairline/models/face_landmarker.task` | ~3.7MB | 468点人脸关键点检测(接口2) |
|
||||||
|
|
||||||
## sha256 校验
|
## 需手动下载文件(体积过大,不入 git)
|
||||||
|
|
||||||
|
### SegFormer 人脸分割模型(接口2必需)
|
||||||
|
|
||||||
|
| 文件 | 路径 | 大小 |
|
||||||
|
|------|------|------|
|
||||||
|
| model.safetensors | `hairline/models/face-parsing/model.safetensors` | 338,580,732 B (~323MB) |
|
||||||
|
|
||||||
|
下载命令:
|
||||||
|
```bash
|
||||||
|
curl -L -o hairline/models/face-parsing/model.safetensors \
|
||||||
|
"https://huggingface.co/jonathandinu/face-parsing/resolve/main/model.safetensors"
|
||||||
|
```
|
||||||
|
|
||||||
|
sha256 校验:
|
||||||
|
```
|
||||||
|
c2bec795a8c243db71bd95be538fd62559003566466c71237e45c99b920f4b62 hairline/models/face-parsing/model.safetensors
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sha256sum hairline/models/face-parsing/model.safetensors
|
||||||
|
```
|
||||||
|
|
||||||
|
## sha256 校验(已入库文件)
|
||||||
|
|
||||||
```
|
```
|
||||||
468e13ca13a9b43cc0881a9f99083a430e9c0a38abd935431d1c28ee94b26567 face_analysis/weights/79999_iter.pth
|
468e13ca13a9b43cc0881a9f99083a430e9c0a38abd935431d1c28ee94b26567 face_analysis/weights/79999_iter.pth
|
||||||
@@ -21,19 +42,13 @@
|
|||||||
2c76254f6fc379fddfce0a7e84fb5385bb135d3e399294f6eeb6680d0365b74b face_analysis/fonts/NotoSansCJKsc-Regular.otf
|
2c76254f6fc379fddfce0a7e84fb5385bb135d3e399294f6eeb6680d0365b74b face_analysis/fonts/NotoSansCJKsc-Regular.otf
|
||||||
```
|
```
|
||||||
|
|
||||||
校验命令:
|
|
||||||
```bash
|
```bash
|
||||||
# Linux/macOS
|
|
||||||
sha256sum -c <<'EOF'
|
sha256sum -c <<'EOF'
|
||||||
468e13ca13a9b43cc0881a9f99083a430e9c0a38abd935431d1c28ee94b26567 face_analysis/weights/79999_iter.pth
|
468e13ca13a9b43cc0881a9f99083a430e9c0a38abd935431d1c28ee94b26567 face_analysis/weights/79999_iter.pth
|
||||||
5c106cde386e87d4033832f2996f5493238eda96ccf559d1d62760c4de0613f8 face_analysis/weights/resnet18-5c106cde.pth
|
5c106cde386e87d4033832f2996f5493238eda96ccf559d1d62760c4de0613f8 face_analysis/weights/resnet18-5c106cde.pth
|
||||||
2c76254f6fc379fddfce0a7e84fb5385bb135d3e399294f6eeb6680d0365b74b face_analysis/fonts/NotoSansCJKsc-Regular.otf
|
2c76254f6fc379fddfce0a7e84fb5385bb135d3e399294f6eeb6680d0365b74b face_analysis/fonts/NotoSansCJKsc-Regular.otf
|
||||||
EOF
|
EOF
|
||||||
```
|
```
|
||||||
```powershell
|
|
||||||
# Windows PowerShell
|
|
||||||
Get-FileHash face_analysis\weights\79999_iter.pth -Algorithm SHA256
|
|
||||||
```
|
|
||||||
|
|
||||||
> resnet18 文件名内嵌的 `5c106cde` 即其官方 sha256 前 8 位(torchvision 命名惯例),与上表一致 = 官方权重无误。
|
> resnet18 文件名内嵌的 `5c106cde` 即其官方 sha256 前 8 位(torchvision 命名惯例),与上表一致 = 官方权重无误。
|
||||||
|
|
||||||
@@ -55,6 +70,7 @@ BiSeNet 初始化时会调用 `torch.utils.model_zoo` / `torchvision` **联网
|
|||||||
79999_iter.pth https://huggingface.co/ManyOtherFunctions/face-parse-bisent/resolve/main/79999_iter.pth
|
79999_iter.pth https://huggingface.co/ManyOtherFunctions/face-parse-bisent/resolve/main/79999_iter.pth
|
||||||
resnet18-5c106cde.pth https://download.pytorch.org/models/resnet18-5c106cde.pth
|
resnet18-5c106cde.pth https://download.pytorch.org/models/resnet18-5c106cde.pth
|
||||||
NotoSansCJKsc-Regular.otf https://github.com/notofonts/noto-cjk/raw/main/Sans/OTF/SimplifiedChinese/NotoSansCJKsc-Regular.otf
|
NotoSansCJKsc-Regular.otf https://github.com/notofonts/noto-cjk/raw/main/Sans/OTF/SimplifiedChinese/NotoSansCJKsc-Regular.otf
|
||||||
|
model.safetensors https://huggingface.co/jonathandinu/face-parsing/resolve/main/model.safetensors
|
||||||
```
|
```
|
||||||
|
|
||||||
## 还差什么(pip 依赖)
|
## 还差什么(pip 依赖)
|
||||||
|
|||||||
Reference in New Issue
Block a user