凤
weixin_44093752/Reloc3r-224
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

siyan824/reloc3r-224 Ascend NPU 适配

Reloc3r 是相机相对位姿估计模型(24 层 ViT 编码器 + 12 层解码器,RoPE100,基于 croco 架构)。本仓完成其在昇腾 Ascend910 NPU 上的真实推理适配与 CPU/NPU 精度对拍。

适配内容

  • 使用官方源码(reloc3r.reloc3r_relpose.Reloc3rRelpose,model_hub_mixin,GitHub: ffrivera0/reloc3r)
  • 权重:model.safetensors(1627 MB,SHA-256 见 validation/weight.sha256)
  • 严格加载(strict load),固定合成图像 img [1,3,224,224](双视角,输出相对位姿)
  • CPU 与 NPU 均使用 cls_default_noretrieval.json 配置(noretrieval 模式,避免 CUDA-only retrieval 依赖)

验证结果

指标CPUNPU (Ascend910 npu:0)
平均延迟6128.08 ms3569.03 ms
输出 shape[1,16][1,16]

精度对拍(CPU vs NPU,fp32):

指标值
cosine similarity0.999999997
max_abs_error1.486e-04
mean_abs_error1.802e-05
precision_passtrue

证据

工作流

agent_workflow

NPU 设备调用

npu_device_call

模型推理结果

model_result

运行

python3 inference.py --device cpu   # CPU 推理
python3 inference.py --device npu   # NPU 推理(需 Ascend910 + torch_npu)

依赖:torch、transformers、numpy、huggingface_hub、kditransform(LimiX 推理所需)。