-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathinference_config.yml
More file actions
216 lines (186 loc) · 6.33 KB
/
Copy pathinference_config.yml
File metadata and controls
216 lines (186 loc) · 6.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# VeridisQuo Production Configuration - Complete parameter registry for inference engine deployment
type: inference
name: inference_config
paths:
# File paths and URLs for models and resources
project_root: ./
models:
deepfake_detection:
dir: models/deepfake_detection
filename: veridisquo_40M.pth
auto_download: true
huggingface:
repo_id: Gazeux33/VeridisQuo
model_filename: veridisquo_40M.pth
url: https://huggingface.co/Gazeux33/VeridisQuo/resolve/main/veridisquo_40M.pth
face_detection:
custom_weights_path: models/face_detection/model.pt
enabled: true
efficientnet:
# EfficientNet weights - null uses ImageNet pretrained
custom_weights_path: null
frequency_extractor:
# Custom weights for frequency feature extractor MLP fusion
custom_weights_path: null
classifier:
# Custom weights for final classifier MLP
custom_weights_path: null
output:
# Directory to save logs
logs_dir: logs
# Directory to save inference results
results_dir: output
device:
# Device configuration for inference
# Options: auto, cpu, cuda, cuda:0, cuda:1
# Description: auto selects CUDA if available, otherwise CPU
type: auto
model_architecture:
# DeepFakeDetector model architecture parameters
# Input channel mode for images
# Implemented channel mode options: luminance, grayscale, YCbCr, RGB
channel_mode: luminance
spatial_features:
# EfficientNet-B4 for spatial feature extraction
# Description: Pretrained on ImageNet, extracts spatial features from faces
name: EfficientNet-B4
output_dim: 1792
frequency_features:
# FFT and DCT combined frequency analysis
# Description: Use PyTorch (GPU) vs NumPy (CPU) extractors
use_gpu_extractors: true
fft:
# Fast Fourier Transform parameters
feature_dim: 512
num_radial_bands: 8
window_function: hann
high_freq_emphasis: true
# FFT calculation constants
constants:
epsilon: 1e-8
num_azimuthal_sectors: 8
high_freq_threshold_ratio: 0.5
artifact_num_radial_samples: 50
artifact_center_region_size: 20
artifact_edge_width: 5
default_smoothing_kernel_size: 5
energy_band_start_multiplier: 2
energy_band_end_multiplier: 3
dct:
# Discrete Cosine Transform parameters
feature_dim: 512
block_size: 8
aggregation_method: frequency_bands
num_frequency_bands: 4
# DCT calculation constants
constants:
high_freq_emphasis: true
epsilon: 1e-8
fusion:
# MLP fusion of FFT and DCT features
output_dim: 1024
hidden_dims: null
dropout_rate: 0.3
use_batch_norm: true
concatenation:
# Concatenation of spatial and frequency features
spatial_dim: 1792
frequency_dim: 1024
classifier:
# Final MLP classifier for class prediction
# Implemented classes: 2 (REAL, FAKE)
input_dim: 2816
num_classes: 2
hidden_dims: null
dropout_rate: 0.2
use_batch_norm: true
preprocessing:
# Image and video preprocessing parameters
image:
# Format: [width, height]
# Description: All images resized to 224x224 and normalized using ImageNet stats to match EfficientNet input requirements
target_size: [224, 224]
normalization:
# Description: ImageNet normalization statistics (RGB)
mean: [0.485, 0.456, 0.406]
std: [0.229, 0.224, 0.225]
face_detection:
# YOLO-based face detection for video inference
# Description: Detects faces in frames, filters by size and confidence
enabled: true
min_face_size: 40
confidence_threshold: 0.7
only_keep_top: true
face_extraction:
# Face region extraction and preprocessing
# Description: Extracts face region from frame with optional padding. Normalization handled by torchvision in InferenceEngine
# Padding unit: pixels
# Normalization options: zero_one, minus_one_one, null
target_size: [224, 224]
padding: 0
# Custom normalization method for face crops - If null, uses ImageNet stats from image normalization
normalization_method: null
frame_extraction:
# Video frame sampling parameters
# Description: Number of frames to extract per second of video
# max_frames description: null means no limit, integer limits total frames analyzed
# optimized description: Use PyAV-based GPU-accelerated extractor (5-10x faster) if available
frames_per_second: 1
max_frames: null
# Two frame extractors: optimized (GPU, using PyAV) and standard (CPU)
# If optimized is selected but not available, falls back to standard extractor
use_optimized: true
inference:
# Inference runtime specific parameters
batch_processing:
# Description: Batch multiple frames for GPU efficiency
enabled: true
default_batch_size: 32
score_aggregation:
# ScoreAggregator parameters to combine frame-level predictions into single video prediction
# Implemented methods: majority, average, weighted_average, threshold
aggregation_method: majority
# Several methods use thresholds to determine final class according to probability
threshold: 0.5
output_format:
# Inference result formatting
# Description: Control verbosity of inference results
include_frame_results: true
include_metadata: true
include_raw_logits: false
logging:
# Logging configuration
enabled: true
level: DEBUG
format: "%(asctime)s - %(name)s.%(funcName)s - %(levelname)s - %(message)s - %(lineno)d"
datefmt: "%Y-%m-%d %H:%M:%S"
file:
enabled: true
# Path relative to logs_dir
path: inference.log
backup_count: 5
console:
enabled: true
level: DEBUG
performance:
# Performance optimization settings
gpu:
enabled: auto
# Description: Enable cuDNN benchmark for optimized performance on fixed-size inputs
cudnn_benchmark: true
threading:
# CPU threading for NumPy operations
num_threads: null
caching:
# Model and preprocessing caching
# Description: Trade memory for speed by caching intermediate results
cache_preprocessed_frames: false
cache_extracted_features: false
production:
# Production deployment specific settings
api:
# Description: REST API configuration for production deployment
enabled: false
host: 0.0.0.0
port: 8000
workers: 4