This commit is contained in:
2026-03-26 04:24:32 -03:00
parent 08b67f2bb7
commit 08c58a6a9d
43 changed files with 2627 additions and 252 deletions

View File

@@ -1,6 +1,5 @@
from .base import (
ContentTypeProfile,
BrandDictionary,
CropContext,
DetectionConfig,
FrameExtractionConfig,
@@ -12,7 +11,6 @@ from .soccer import SoccerBroadcastProfile
__all__ = [
"ContentTypeProfile",
"BrandDictionary",
"CropContext",
"DetectionConfig",
"FrameExtractionConfig",

View File

@@ -44,12 +44,6 @@ class ResolverConfig:
fuzzy_threshold: int = 75
@dataclass
class BrandDictionary:
"""Maps canonical brand name → list of known aliases/spellings."""
brands: dict[str, list[str]] = field(default_factory=dict)
@dataclass
class CropContext:
image: bytes
@@ -64,7 +58,6 @@ class ContentTypeProfile(Protocol):
def scene_filter_config(self) -> SceneFilterConfig: ...
def detection_config(self) -> DetectionConfig: ...
def ocr_config(self) -> OCRConfig: ...
def brand_dictionary(self) -> BrandDictionary: ...
def resolver_config(self) -> ResolverConfig: ...
def vlm_prompt(self, crop_context: CropContext) -> str: ...
def aggregate(self, detections: list[BrandDetection]) -> DetectionReport: ...

View File

@@ -5,7 +5,6 @@ from __future__ import annotations
from detect.models import BrandDetection, BrandStats, DetectionReport, PipelineStats
from .base import (
BrandDictionary,
CropContext,
DetectionConfig,
FrameExtractionConfig,
@@ -34,22 +33,6 @@ class SoccerBroadcastProfile:
def ocr_config(self) -> OCRConfig:
return OCRConfig(languages=["en", "es"], min_confidence=0.5)
def brand_dictionary(self) -> BrandDictionary:
return BrandDictionary(brands={
"Nike": ["nike", "NIKE", "swoosh"],
"Adidas": ["adidas", "ADIDAS", "adi"],
"Puma": ["puma", "PUMA"],
"Emirates": ["emirates", "fly emirates", "EMIRATES"],
"Coca-Cola": ["coca-cola", "coca cola", "coke", "COCA-COLA"],
"Pepsi": ["pepsi", "PEPSI"],
"Mastercard": ["mastercard", "MASTERCARD"],
"Heineken": ["heineken", "HEINEKEN"],
"Santander": ["santander", "SANTANDER"],
"Gazprom": ["gazprom", "GAZPROM"],
"Qatar Airways": ["qatar airways", "QATAR AIRWAYS"],
"Lay's": ["lays", "lay's", "LAYS", "LAY'S"],
})
def resolver_config(self) -> ResolverConfig:
return ResolverConfig(fuzzy_threshold=75)

View File

@@ -5,7 +5,6 @@ from __future__ import annotations
from detect.models import BrandDetection, DetectionReport
from .base import (
BrandDictionary,
CropContext,
DetectionConfig,
FrameExtractionConfig,
@@ -30,9 +29,6 @@ class NewsBroadcastProfile:
def ocr_config(self) -> OCRConfig:
raise NotImplementedError
def brand_dictionary(self) -> BrandDictionary:
raise NotImplementedError
def resolver_config(self) -> ResolverConfig:
raise NotImplementedError
@@ -61,9 +57,6 @@ class AdvertisingProfile:
def ocr_config(self) -> OCRConfig:
raise NotImplementedError
def brand_dictionary(self) -> BrandDictionary:
raise NotImplementedError
def resolver_config(self) -> ResolverConfig:
raise NotImplementedError
@@ -92,9 +85,6 @@ class TranscriptProfile:
def ocr_config(self) -> OCRConfig:
raise NotImplementedError
def brand_dictionary(self) -> BrandDictionary:
raise NotImplementedError
def resolver_config(self) -> ResolverConfig:
raise NotImplementedError