feat: eye filter flag + QA fixes (Gemma4 prompt, YOLO boundary, PaliGemma score, GDINO skip)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user