diff --git a/backend/app/tasks/ml.py b/backend/app/tasks/ml.py index 3be9f7b..7703447 100644 --- a/backend/app/tasks/ml.py +++ b/backend/app/tasks/ml.py @@ -35,8 +35,8 @@ def _is_video(path: Path) -> bool: retry_backoff_max=60, retry_jitter=True, max_retries=3, - # Sized for the video branch: sample 10 frames, run tagger + - # embedder on each (≈20 GPU ops vs 2 for an image). A loaded + # Sized for the video branch: sample 6 frames, run tagger + + # embedder on each (≈12 GPU ops vs 2 for an image). A loaded # ml-worker can take 5-10 min on a long video; bumped from # 5min/7min on 2026-05-28 after operator-flagged image 6288 (a # .mp4) hit the recovery sweep at 5 min while still legitimately @@ -50,7 +50,7 @@ def tag_and_embed(self, image_id: int) -> dict: then enqueue per-image allowlist application. Video: sample frames between 10% and 90% of duration (VIDEO_ML_FRAMES, - default 10). Max-pool tagger confidences across frames, mean-pool the + default 6). Max-pool tagger confidences across frames, mean-pool the SigLIP embeddings. On no-frames returns status='no_frames' (not an error). """ import os @@ -116,7 +116,7 @@ def tag_and_embed(self, image_id: int) -> dict: phase = "video_sample_frames" t0 = time.monotonic() frames = _sample_video_frames( - src, int(os.environ.get("VIDEO_ML_FRAMES", "10")) + src, int(os.environ.get("VIDEO_ML_FRAMES", "6")) ) log.info( "tag_and_embed sampled %d frame(s) in %.1fs: %s",