Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,8 @@ from forensics.minmax import minmax_process
|
|
26 |
from forensics.ela import ELA
|
27 |
from forensics.wavelet import noise_estimation
|
28 |
from forensics.bitplane import bit_plane_extractor
|
|
|
|
|
29 |
from utils.hf_logger import log_inference_data
|
30 |
from utils.load import load_image
|
31 |
from agents.ensemble_team import EnsembleMonitorAgent, WeightOptimizationAgent, SystemHealthAgent
|
@@ -276,9 +278,15 @@ def full_prediction(img, confidence_threshold, rotate_degrees, noise_level, shar
|
|
276 |
future_gradient2 = executor.submit(_run_forensic_task, gradient_processing, img_np_og, "Gradient processing: Int=45, Equalize=True", intensity=45, equalize=True)
|
277 |
future_minmax1 = executor.submit(_run_forensic_task, minmax_process, img_np_og, "MinMax processing: Deviations in local pixel values.")
|
278 |
future_minmax2 = executor.submit(_run_forensic_task, minmax_process, img_np_og, "MinMax processing (Radius=6): Deviations in local pixel values.", radius=6)
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
|
280 |
forensic_futures = [future_ela1, future_ela2, future_ela3, future_gradient1, future_gradient2, future_minmax1, future_minmax2]
|
281 |
-
|
282 |
for future in concurrent.futures.as_completed(forensic_futures):
|
283 |
processed_img, description = future.result()
|
284 |
if processed_img is not None:
|
@@ -312,6 +320,7 @@ def full_prediction(img, confidence_threshold, rotate_degrees, noise_level, shar
|
|
312 |
"Gradient processing: Int=45, Equalize=True",
|
313 |
"MinMax processing: Deviations in local pixel values.",
|
314 |
"MinMax processing (Radius=6): Deviations in local pixel values.",
|
|
|
315 |
# "Bit Plane extractor: Visualization of individual bit planes from different color channels."
|
316 |
]
|
317 |
detected_context_tags = context_agent.infer_context_tags(image_data_for_context, model_predictions_raw)
|
|
|
26 |
from forensics.ela import ELA
|
27 |
from forensics.wavelet import noise_estimation
|
28 |
from forensics.bitplane import bit_plane_extractor
|
29 |
+
from forensics.ela_hybrid import generate_concatenated_hybrid
|
30 |
+
|
31 |
from utils.hf_logger import log_inference_data
|
32 |
from utils.load import load_image
|
33 |
from agents.ensemble_team import EnsembleMonitorAgent, WeightOptimizationAgent, SystemHealthAgent
|
|
|
278 |
future_gradient2 = executor.submit(_run_forensic_task, gradient_processing, img_np_og, "Gradient processing: Int=45, Equalize=True", intensity=45, equalize=True)
|
279 |
future_minmax1 = executor.submit(_run_forensic_task, minmax_process, img_np_og, "MinMax processing: Deviations in local pixel values.")
|
280 |
future_minmax2 = executor.submit(_run_forensic_task, minmax_process, img_np_og, "MinMax processing (Radius=6): Deviations in local pixel values.", radius=6)
|
281 |
+
future_hybrid_ela = executor.submit(
|
282 |
+
_run_forensic_task,
|
283 |
+
lambda img: generate_concatenated_hybrid(generate_ela_hybrid(img)),
|
284 |
+
img_np_og,
|
285 |
+
"Hybrid ELA (Horizontal Stack: RGB + Error Map)"
|
286 |
+
)
|
287 |
|
288 |
forensic_futures = [future_ela1, future_ela2, future_ela3, future_gradient1, future_gradient2, future_minmax1, future_minmax2]
|
289 |
+
forensic_futures.append(future_hybrid_ela)
|
290 |
for future in concurrent.futures.as_completed(forensic_futures):
|
291 |
processed_img, description = future.result()
|
292 |
if processed_img is not None:
|
|
|
320 |
"Gradient processing: Int=45, Equalize=True",
|
321 |
"MinMax processing: Deviations in local pixel values.",
|
322 |
"MinMax processing (Radius=6): Deviations in local pixel values.",
|
323 |
+
"Hybrid ELA (Horizontal Stack: RGB + Error Map)",
|
324 |
# "Bit Plane extractor: Visualization of individual bit planes from different color channels."
|
325 |
]
|
326 |
detected_context_tags = context_agent.infer_context_tags(image_data_for_context, model_predictions_raw)
|