Refactor: Logging Cleanup

This commit is contained in:
ziesorx 2025-09-24 20:39:32 +07:00
parent 7a9a149955
commit 5176f99ba7
9 changed files with 37 additions and 72 deletions

View file

@ -503,17 +503,6 @@ class DetectionPipeline:
'filename': f"{uuid.uuid4()}.jpg"
}
# Save full frame for debugging
import cv2
debug_dir = "/Users/ziesorx/Documents/Work/Adsist/Bangchak/worker/python-detector-worker/debug_frames"
timestamp = detection_context.get('timestamp', 'unknown')
session_id = detection_context.get('session_id', 'unknown')
debug_filename = f"{debug_dir}/pipeline_full_frame_{session_id}_{timestamp}.jpg"
try:
cv2.imwrite(debug_filename, frame)
logger.info(f"[DEBUG PIPELINE] Saved full input frame: {debug_filename} ({frame.shape[1]}x{frame.shape[0]})")
except Exception as e:
logger.warning(f"[DEBUG PIPELINE] Failed to save debug frame: {e}")
# Run inference on single snapshot using .predict() method
detection_results = self.detection_model.model.predict(