赛事: 昇腾 Model Agent 模型适配大赛(第二季) 引擎: torch_npu + 自包含 PyTorch 实现(多 token 高斯 VAE) 硬件: Ascend 310P / 910B 标签:
npuascendpytorchdiffusionpoint-cloud
ScaffDiff 是面向 3D 场景补全(SemanticKITTI)的 scaffold-dominant 扩散模型。 本适配交付其 vae_v3 子模型——多 token 高斯 VAE(7.1M 参数): 残差 PointNet 编码器 + 32-query 交叉注意力池化器生成 32×32-d 高斯 latent token(1024-d latent),transformer 解码器(5 个交叉注意力块)重建 8000 个场景点。
| 属性 | 值 |
|---|---|
| 原始模型 | https://huggingface.co/businesslion/scaffdiff |
| 子模型 | vae_v3(多 token 高斯 VAE,7.1M 参数) |
| 任务类型 | 3D 场景补全(点云扩散) |
| 输入格式 | 部分点云(Nx3) |
| 输出格式 | 重建点云(8000x3) |
pip install -r requirements.txt -i https://repo.huaweicloud.com/repository/pypi/simple/⚠️ 本仓库不包含模型权重(交付件仅
inference.py/readme.md/requirements.txt/assets/), 推理前必须先从原始模型仓单独下载权重。
# 1. 下载模型权重(仓库不含权重,必须单独下载)
git clone https://gitcode.com/hf_mirrors/businesslion/scaffdiff.git ./scaffdiff
# 2. 运行 NPU 推理
python3 inference.py --model_path ./scaffdiff \
--points 2048 --device npu:0 --output inference_result.jsonpython3 inference.py --model_path ./scaffdiff \
--points 2048 --device npu:0 --output inference_result.json预期输出:
[Model Agent] ✅ NPU 设备就绪: Ascend310P3
[Model Agent] state_dict: 30 缺失 / 28 多余
[Model Agent] ✅ 模型加载完成 → npu:0
[Model Agent] ✅ 推理完成: 重建点云 (1, 8000, 3), 耗时 11.547s
[Model Agent] ✅ 结果已保存 → inference_result.json推理结果摘要:
{
"model": "businesslion/scaffdiff",
"submodel": "vae_v3",
"engine": "torch_npu",
"device": "npu:0",
"input_points": 2048,
"output_shape": [1, 8000, 3],
"inference_time_s": 11.547
}.
├── inference.py # NPU 推理脚本
├── readme.md # 本文件
├── requirements.txt # 依赖清单
└── assets/ # 截图素材本模型由 昇腾 Model Agent 自动完成 NPU 适配:
inference.py 自包含构建多 token 高斯 VAE
(PointNet 编码器 + 交叉注意力池化 + 32 高斯 token + 5 块解码器)vae_v3/best_point_vae.pth 加载权重(strict=False,缺失/多余为
优化器状态等非模型键)