Skip to content

Commit 05fe398

Browse files
author
Theo
committed
Revert "Merge pull request #33 from VeridisQuo-orga/inference_engine"
This reverts commit 676fc2a, reversing changes made to 9c9866e.
1 parent 676fc2a commit 05fe398

69 files changed

Lines changed: 2724 additions & 3267 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config.json

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
{
2+
"_comment": "VeridisQuo Production Configuration - Complete parameter registry for inference engine deployment",
3+
"_version": "1.0.0",
4+
"_last_updated": "2025-12-24",
5+
6+
"paths": {
7+
"_comment": "File paths and URLs for models and resources",
8+
"project_root": "./",
9+
"models": {
10+
"deepfake_detection": {
11+
"dir": "models/deepfake_detection",
12+
"filename": "veridisquo_40M.pth",
13+
"auto_download": true,
14+
"huggingface": {
15+
"repo_id": "Gazeux33/VeridisQuo",
16+
"model_filename": "veridisquo_40M.pth",
17+
"url": "https://huggingface.co/Gazeux33/VeridisQuo/resolve/main/veridisquo_40M.pth"
18+
}
19+
},
20+
"face_detection": {
21+
"path": "models/face_detection/face_detection.pt",
22+
"enabled": true
23+
},
24+
"efficientnet": {
25+
"_comment": "EfficientNet weights - null uses ImageNet pretrained",
26+
"custom_weights_path": null,
27+
"use_pretrained": true
28+
},
29+
"frequency_extractor": {
30+
"_comment": "Custom weights for frequency feature extractor MLP fusion",
31+
"fusion_weights_path": null
32+
},
33+
"classifier": {
34+
"_comment": "Custom weights for final classifier MLP",
35+
"weights_path": null
36+
}
37+
},
38+
"output": {
39+
"logs_dir": "logs",
40+
"results_dir": "output"
41+
}
42+
},
43+
44+
"device": {
45+
"_comment": "Device configuration for inference",
46+
"type": "auto",
47+
"_options": ["auto", "cpu", "cuda", "cuda:0", "cuda:1"],
48+
"_description": "auto selects CUDA if available, otherwise CPU"
49+
},
50+
51+
"model_architecture": {
52+
"_comment": "DeepFakeDetector model architecture parameters",
53+
54+
"channel_mode": "luminance",
55+
56+
"spatial_features": {
57+
"_comment": "EfficientNet-B4 for spatial feature extraction",
58+
"name": "EfficientNet-B4",
59+
"use_pretrained": true,
60+
"output_dim": 1792,
61+
"_description": "Pretrained on ImageNet, extracts spatial features from faces"
62+
},
63+
64+
"frequency_features": {
65+
"_comment": "FFT and DCT combined frequency analysis",
66+
"use_gpu_extractors": true,
67+
"_description": "Use PyTorch (GPU) vs NumPy (CPU) extractors",
68+
69+
"fft": {
70+
"_comment": "Fast Fourier Transform parameters",
71+
"feature_dim": 512,
72+
"num_radial_bands": 8,
73+
"window_function": "hann",
74+
"high_freq_emphasis": true,
75+
"epsilon": 1e-8,
76+
"num_azimuthal_sectors": 0,
77+
"high_freq_threshold_ratio": 0.5,
78+
"artifact_num_radial_samples": 50,
79+
"artifact_center_region_size": 20,
80+
"artifact_edge_width": 5,
81+
"default_smoothing_kernel_size": 5,
82+
"energy_band_start_multiplier": 2,
83+
"energy_band_end_multiplier": 3,
84+
"_description": "FFT extracts frequency patterns using concentric radial bands"
85+
},
86+
87+
"dct": {
88+
"_comment": "Discrete Cosine Transform parameters",
89+
"feature_dim": 512,
90+
"block_size": 8,
91+
"aggregation_method": "frequency_bands",
92+
"num_frequency_bands": 4,
93+
"high_freq_emphasis": true,
94+
"epsilon": 1e-8,
95+
"_description": "DCT divides image into blocks and extracts frequency coefficients"
96+
},
97+
98+
"fusion": {
99+
"_comment": "MLP fusion of FFT and DCT features",
100+
"output_dim": 1024,
101+
"hidden_dims": null,
102+
"dropout_rate": 0.3,
103+
"use_batch_norm": true,
104+
"_description": "Combines FFT (512) + DCT (512) → 1024 features via MLP"
105+
}
106+
},
107+
108+
"concatenation": {
109+
"_comment": "Concatenation of spatial and frequency features",
110+
"spatial_dim": 1792,
111+
"frequency_dim": 1024,
112+
"_description": "EfficientNet (1792) + Frequency (1024) = 2816"
113+
},
114+
115+
"classifier": {
116+
"_comment": "Final MLP classifier for REAL/FAKE prediction",
117+
"input_dim": 2816,
118+
"num_classes": 2,
119+
"hidden_dims": null,
120+
"dropout_rate": 0.2,
121+
"use_batch_norm": true,
122+
"_description": "2816 → [1024, 512, 256] → 2 (REAL/FAKE logits)"
123+
}
124+
},
125+
126+
"preprocessing": {
127+
"_comment": "Image and video preprocessing parameters",
128+
129+
"image": {
130+
"target_size": [224, 224],
131+
"_format": "[width, height]",
132+
"normalization": {
133+
"mean": [0.485, 0.456, 0.406],
134+
"std": [0.229, 0.224, 0.225],
135+
"_description": "ImageNet normalization statistics (RGB)"
136+
},
137+
"_description": "All images resized to 224x224 and normalized"
138+
},
139+
140+
"face_detection": {
141+
"_comment": "YOLO-based face detection for video inference",
142+
"enabled": true,
143+
"model_path": "models/face_detection/face_detection.pt",
144+
"min_face_size": 40,
145+
"confidence_threshold": 0.7,
146+
"only_keep_top": true,
147+
"_description": "Detects faces in frames, filters by size and confidence"
148+
},
149+
150+
"face_extraction": {
151+
"_comment": "Face region extraction and preprocessing",
152+
"target_size": [224, 224],
153+
"padding": 0,
154+
"_padding_unit": "pixels",
155+
"normalization_method": null,
156+
"_normalization_options": ["zero_one", "minus_one_one", null],
157+
"_description": "Extracts face region from frame with optional padding. Normalization handled by torchvision in InferenceEngine"
158+
},
159+
160+
"frame_extraction": {
161+
"_comment": "Video frame sampling parameters",
162+
"frames_per_second": 1,
163+
"_description": "Number of frames to extract per second of video",
164+
"max_frames": null,
165+
"_max_frames_description": "null means no limit, integer limits total frames analyzed",
166+
"use_optimized": true,
167+
"_optimized_description": "Use PyAV-based GPU-accelerated extractor (5-10x faster) if available"
168+
}
169+
},
170+
171+
"inference": {
172+
"_comment": "Inference runtime parameters",
173+
174+
"batch_processing": {
175+
"enabled": true,
176+
"default_batch_size": 32,
177+
"_description": "Batch multiple frames for GPU efficiency"
178+
},
179+
180+
"video_inference": {
181+
"_comment": "Video-specific inference settings",
182+
"frames_per_second": 1,
183+
"max_frames": null,
184+
"use_optimized_extractor": true,
185+
"aggregate_method": "majority"
186+
},
187+
188+
"score_aggregation": {
189+
"_comment": "ScoreAggregator parameters for video-level predictions",
190+
"default_method": "majority",
191+
"threshold": 0.5,
192+
"_description": "Combines frame-level predictions into single video prediction"
193+
},
194+
195+
"output_format": {
196+
"_comment": "Inference result formatting",
197+
"include_frame_results": true,
198+
"include_metadata": true,
199+
"include_raw_logits": false,
200+
"_description": "Control verbosity of inference results"
201+
}
202+
},
203+
204+
"logging": {
205+
"_comment": "Logging configuration",
206+
"enabled": true,
207+
"level": "DEBUG",
208+
"format": "%(asctime)s - %(name)s.%(funcName)s - %(levelname)s - %(message)s - %(lineno)d",
209+
"datefmt": "%Y-%m-%d %H:%M:%S",
210+
"file": {
211+
"enabled": true,
212+
"path": "logs/app.log",
213+
"backup_count": 5
214+
},
215+
"console": {
216+
"enabled": true,
217+
"level": "DEBUG"
218+
}
219+
},
220+
221+
"performance": {
222+
"_comment": "Performance optimization settings",
223+
224+
"gpu": {
225+
"enabled": "auto",
226+
"cudnn_benchmark": true
227+
},
228+
229+
"threading": {
230+
"_comment": "CPU threading for NumPy operations",
231+
"num_threads": null
232+
},
233+
234+
"caching": {
235+
"_comment": "Model and preprocessing caching",
236+
"cache_preprocessed_frames": false,
237+
"cache_extracted_features": false,
238+
"_description": "Trade memory for speed by caching intermediate results"
239+
}
240+
},
241+
242+
"production": {
243+
"_comment": "Production deployment specific settings",
244+
"api": {
245+
"enabled": false,
246+
"host": "0.0.0.0",
247+
"port": 8000,
248+
"workers": 4,
249+
"_description": "REST API configuration for production deployment"
250+
}
251+
}
252+
}

0 commit comments

Comments
 (0)