g
gcw_C8PI9e90/open-deepfake-detection-npu
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

Open Deepfake Detection - NPU 适配

模型信息

  • 原始模型:prithivMLmods/open-deepfake-detection
  • 架构:SiglipForImageClassification(SigLIP2 微调版)
  • 参数数量:92,885,762
  • 标签:{0: "Fake", 1: "Real"}
  • 任务:开集深度伪造图像分类

环境配置

组件版本
PyTorch2.9.0
torch_npu2.9.0.post1
昇腾 CANN8.5.1
NPU昇腾 910B4(29.5GB)
Transformers4.57.6

文件说明

文件描述
inference.py单图像推理 + 基准测试模式
accuracy_run.pyCPU 与 NPU 精度验证
accuracy_run_perf.pyNPU 性能基准测试
result.json推理结果示例
accuracy_report.json精度验证报告
perf_report.json性能基准测试报告

使用方法

单图像推理

python3 inference.py \
  --model_path /path/to/open-deepfake-detection \
  --image /path/to/face_image.jpg \
  --output result.json

性能基准测试

python3 accuracy_run_perf.py /path/to/open-deepfake-detection 10 perf_report.json

准确性验证

python3 accuracy_run.py \
  --model_path /path/to/open-deepfake-detection \
  --output accuracy_report.json

性能结果(昇腾 910B4)

指标数值
平均延迟10.37 ms
中位延迟10.28 ms
P90 延迟10.58 ms
P99 延迟11.40 ms
最小延迟10.13 ms
最大延迟11.93 ms
吞吐量96.44 img/s

示例输出

{
  "predicted_class_id": 1,
  "predicted_label": "Real",
  "probabilities": [0.4700, 0.5300],
  "inference_time_ms": 16409.99
}

首次推理包含 JIT 编译开销(约 16 秒)。后续推理平均耗时约 10.4 毫秒。

注意事项

  • 该模型是深度伪造检测的开集变体(而 deepfake-detector-model-v1 是闭集版本)
  • 两个模型具有相同的架构和参数数量
  • open-deepfake-detection 的吞吐量略高(在 910B4 上约为 96 张/秒,而对比模型约为 90 张/秒)