Open Deepfake Detection - NPU 适配
Model Info
- Original Model: prithivMLmods/open-deepfake-detection
- Architecture: SiglipForImageClassification (SigLIP2 fine-tuned)
- Parameters: 92,885,762
- Labels:
{0: "Fake", 1: "Real"}
- Task: Open-set deepfake image classification
Environment
| Component | Version |
|---|
| PyTorch | 2.9.0 |
| torch_npu | 2.9.0.post1 |
| Ascend CANN | 8.5.1 |
| NPU | Ascend 910B4 (29.5GB) |
| Transformers | 4.57.6 |
Files
| File | Description |
|---|
inference.py | Single-image inference + benchmark mode |
accuracy_run.py | CPU vs NPU accuracy validation |
accuracy_run_perf.py | NPU performance benchmark |
result.json | Sample inference result |
accuracy_report.json | Accuracy validation report |
perf_report.json | Performance benchmark report |
Usage
Single Image Inference
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
Accuracy Validation
python3 accuracy_run.py \
--model_path /path/to/open-deepfake-detection \
--output accuracy_report.json
| Metric | Value |
|---|
| Avg Latency | 10.37 ms |
| Median Latency | 10.28 ms |
| P90 Latency | 10.58 ms |
| P99 Latency | 11.40 ms |
| Min Latency | 10.13 ms |
| Max Latency | 11.93 ms |
| Throughput | 96.44 img/s |
Sample Output
{
"predicted_class_id": 1,
"predicted_label": "Real",
"probabilities": [0.4700, 0.5300],
"inference_time_ms": 16409.99
}
First inference includes JIT compilation overhead (~16s). Subsequent inferences average ~10.4ms.
Notes
- This model is the open-set variant of deepfake detection (vs.
deepfake-detector-model-v1 which is the closed-set version)
- Both models share identical architecture and parameter count
open-deepfake-detection shows marginally better throughput (~96 vs ~90 img/s on 910B4)