LPX55 commited on
Commit
1cb42f5
Β·
1 Parent(s): 0b8f9cb

Update README.md (#7)

Browse files

- Update README.md (528fa9c9343c0f685957b428b97976d097af3261)

Files changed (1) hide show
  1. README.md +10 -10
README.md CHANGED
@@ -108,23 +108,23 @@ print(f"verdict: {'fake' if fake_prob > 0.5 else 'real'}")
108
 
109
  Five pre-exported ONNX models with different size/speed trade-offs. All use the corrected config (single-class sigmoid output).
110
 
111
- | Variant | Size | Speed (CPU) | Accuracy | Best For |
112
  |---|---|---|---|---|
113
- | `model.onnx` (full) | 84 MB | β˜…β˜…β˜… | β˜…β˜…β˜…β˜…β˜… | Maximum accuracy, server-side |
114
- | `model_int8.onnx` | 22 MB | β˜…β˜…β˜…β˜…β˜… | β˜…β˜…β˜…β˜… | **Fastest CPU**, general deployment |
115
- | `model_uint8.onnx` | 22 MB | β˜…β˜…β˜…β˜…β˜… | β˜…β˜…β˜…β˜… | Fast CPU, unsigned variant |
116
- | `model_quantized.onnx` | 22 MB | β˜…β˜…β˜…β˜…β˜… | β˜…β˜…β˜…β˜… | Alias of INT8 for compatibility |
117
- | `model_q4.onnx` | 16 MB | β˜…β˜…β˜… | β˜…β˜…β˜… | Smallest, low disk/RAM |
118
 
119
  **Which variant should I use?**
120
 
121
  | Use case | Recommended variant | Why |
122
  |---|---|---|
123
- | Server-side, maximum accuracy | `model.onnx` (full) | No quantization loss, FP32 precision |
124
- | General CPU deployment | `model_int8.onnx` | Fastest CPU inference, strong accuracy on real-world images |
125
- | Disk/RAM constrained | `model_q4.onnx` | Smallest file size, slower inference |
126
 
127
- > **Quantization note**: Dynamic quantization accuracy varies by input. On real-world photos and AI-generated images, all variants agree with FP32 within ~1%. On synthetic noise or extreme aspect ratios, quantized variants may diverge more. For maximum accuracy, use `model.onnx` (FP32).
128
 
129
  ```python
130
  import onnxruntime as ort, numpy as np
 
108
 
109
  Five pre-exported ONNX models with different size/speed trade-offs. All use the corrected config (single-class sigmoid output).
110
 
111
+ | Variant | Size | Speed (CPU) | Fidelity vs FP32 | Best For |
112
  |---|---|---|---|---|
113
+ | `model.onnx` (full) | 83 MB | β˜…β˜…β˜… | Reference (FP32) | Maximum accuracy, server-side baseline |
114
+ | `model_int8.onnx` | 22 MB | β˜…β˜…β˜…β˜…β˜… | High fidelity on standard inputs; may diverge on OOD generators | **Fastest CPU**, general deployment |
115
+ | `model_uint8.onnx` | 22 MB | β˜…β˜…β˜…β˜…β˜… | Alternative dynamic quantization error profile | Fast CPU deployment |
116
+ | `model_quantized.onnx` | 22 MB | β˜…β˜…β˜…β˜…β˜… | Identical to `model_int8.onnx` | Drop-in INT8 alias |
117
+ | `model_q4.onnx` | 15 MB | β˜…β˜…β˜… | Aggressive weight quantization; high variance on subtle inputs | Smallest disk/RAM footprint |
118
 
119
  **Which variant should I use?**
120
 
121
  | Use case | Recommended variant | Why |
122
  |---|---|---|
123
+ | Server-side, maximum accuracy | `model.onnx` (full) | No quantization loss, FP32 precision β€” reference baseline |
124
+ | General CPU deployment | `model_int8.onnx` | Fastest CPU inference, matches FP32 on clear-cut inputs |
125
+ | Disk/RAM constrained | `model_q4.onnx` | Smallest file size (15 MB), low disk/RAM footprint |
126
 
127
+ > **Quantization note**: Dynamic per-tensor quantization without calibration causes quantized variants to diverge from FP32 on certain inputs (up to 10–70 percentage points) β€” particularly images from generators outside the training set. **Significant disagreement between FP32 and INT8/Q4 indicates the input is near the model's decision boundary or out-of-distribution.** For maximum single-model consistency, use `model.onnx` (FP32).
128
 
129
  ```python
130
  import onnxruntime as ort, numpy as np