feat: eye filter flag + QA fixes (Gemma4 prompt, YOLO boundary, PaliGemma score, GDINO skip)

This commit is contained in:
Accusys
2026-05-14 12:24:25 +08:00
parent f60a59b280
commit 39888ce3cc
5 changed files with 37 additions and 16 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
"""YOLO judge: object detection matching against expected objects"""
import cv2, numpy as np
import cv2, numpy as np, re
from ultralytics import YOLO
MODEL_PATH = "/Users/accusys/momentry_core_0.1/yolov8s.mlpackage"
@@ -30,8 +30,8 @@ def score(frames, prompt):
load()
prompt_lower = prompt.lower()
# Extract expected objects from prompt: check each COCO class
expected = [c for c in COCO if c in prompt_lower]
# Extract expected objects from prompt: check each COCO class (word boundary)
expected = [c for c in COCO if re.search(r'\b' + re.escape(c) + r'\b', prompt_lower)]
if not expected:
expected = ["person"] # default fallback