|
Download README.md from Cozy000000/calligen-mopd-student: direct link, hf CLI and curl.
- Browser
- Download file 1.98 kB
-
https://huggingface.co/Cozy000000/calligen-mopd-student/resolve/main/README.md
- Command line
-
hf download hf://Cozy000000/calligen-mopd-student/README.md
-
curl -L -o README.md https://huggingface.co/Cozy000000/calligen-mopd-student/resolve/main/README.md
1.98 kB
metadata
language:
- zh
tags:
- calligraphy
- image-to-image
- flow-matching
- knowledge-distillation
- pytorch
pipeline_tag: image-to-image
CalliGen MOPD Student
EXP04 的最终多字体 Student。一个模型接收骨架图及字体条件,生成文楷、行书或草书笔画风格的图像。
模型信息
- Checkpoint:
best.pt,MOPD step 3000。 - 参数量:85,760,897(约 85.76M)。
- 架构:骨架条件 Flow Matching U-Net,包含三个字体条件嵌入。
- 输入/输出:512×512,灰度。
- 字体:
wenkai(文楷)、xingshu(行书)、caoshu(草书)。 - 采样:Euler,32 步,默认 seed 42。
- 训练:共同 warmup 2000 步,然后 MOPD 分支训练 3000 步。
- 推理只需要 Student。三个 Teacher 不包含在本仓库中。
下载内容
best.pt:最终 Student checkpoint,包含权重和模型配置。mopd_student_step3000_e70540f6.zip:同一 checkpoint 的 ZIP 下载包,包含说明与校验信息。manifest.json/SHA256SUMS.txt:模型信息与 SHA-256 校验值。
使用
需要安装 CalliGen 项目 中支持 EXP04 的代码和依赖,使用包含 calligen/multistyle.py 的版本。本 checkpoint 使用项目自定义加载器,不是独立的 Diffusers pipeline。
在项目环境中运行:
from PIL import Image
from calligen.inference import ModelRunner
runner = ModelRunner('best.pt', device='cuda:0')
skeleton = Image.open('skeleton.png')
for style in ('wenkai', 'xingshu', 'caoshu'):
runner.generate(skeleton, style=style).save(f'{style}.png')
输出含义
模型保留输入骨架和布局,切换笔画风格。切换字体条件不保证将同一骨架改写为另一字体的规范字形结构。字体之间的区分程度取决于输入,部分行书与草书结果可能接近。
本仓库提供的是训练完成的 Student;具体文件校验信息见 manifest.json。