将 timm 框架的 ConvNeXt Base 模型适配到华为昇腾 NPU (Ascend910)。该模型在 ImageNet-22K 上预训练并微调至 ImageNet-1K,输入分辨率为 384x384。
pip install -r requirements.txt
python inference.py推理结果 (NPU Top-5):
日志保存在 logs/inference.log。
对单张测试图片进行 CPU 与 NPU 一致性验证:
| 指标 | 数值 |
|---|---|
| max_abs_error | 0.017323 |
| mean_abs_error | 0.003928 |
| relative_error | 0.8273% |
| cosine_similarity | 0.999974 |
| threshold | 1.0% |
| 结果 | PASS |
| 指标 | 数值 |
|---|---|
| avg_latency | 0.0165s |
| min_latency | 0.0164s |
| max_latency | 0.0165s |
| p50_latency | 0.0164s |
| p90_latency | 0.0165s |
| p95_latency | 0.0165s |
| throughput | 60.77 images/sec |
本项目包含单图 smoke consistency 验证,非官方 ImageNet 完整验证集评测。详细指标见第 4 节。
详见 screenshots/self_verification.png。
logs/inference.log - 推理运行日志logs/accuracy.log - 精度验证日志logs/benchmark.log - 性能基准测试日志