Properly capitalize delivery services

This commit is contained in:
Nicolas Mowen 2026-04-06 12:27:17 -06:00
parent 26c7092283
commit 9e0e4162f9
2 changed files with 24 additions and 2 deletions

View File

@ -44,6 +44,22 @@ DEFAULT_ATTRIBUTE_LABEL_MAP = {
], ],
"motorcycle": ["license_plate"], "motorcycle": ["license_plate"],
} }
ATTRIBUTE_LABEL_DISPLAY_MAP = {
"amazon": "Amazon",
"an_post": "An Post",
"canada_post": "Canada Post",
"dhl": "DHL",
"dpd": "DPD",
"fedex": "FedEx",
"gls": "GLS",
"nzpost": "NZ Post",
"postnl": "PostNL",
"postnord": "PostNord",
"purolator": "Purolator",
"royal_mail": "Royal Mail",
"ups": "UPS",
"usps": "USPS",
}
LABEL_CONSOLIDATION_MAP = { LABEL_CONSOLIDATION_MAP = {
"car": 0.8, "car": 0.8,
"face": 0.5, "face": 0.5,

View File

@ -19,7 +19,12 @@ from frigate.comms.inter_process import InterProcessRequestor
from frigate.config import FrigateConfig from frigate.config import FrigateConfig
from frigate.config.camera import CameraConfig from frigate.config.camera import CameraConfig
from frigate.config.camera.review import GenAIReviewConfig, ImageSourceEnum from frigate.config.camera.review import GenAIReviewConfig, ImageSourceEnum
from frigate.const import CACHE_DIR, CLIPS_DIR, UPDATE_REVIEW_DESCRIPTION from frigate.const import (
ATTRIBUTE_LABEL_DISPLAY_MAP,
CACHE_DIR,
CLIPS_DIR,
UPDATE_REVIEW_DESCRIPTION,
)
from frigate.data_processing.types import PostProcessDataEnum from frigate.data_processing.types import PostProcessDataEnum
from frigate.genai import GenAIClient from frigate.genai import GenAIClient
from frigate.genai.manager import GenAIClientManager from frigate.genai.manager import GenAIClientManager
@ -559,7 +564,8 @@ def run_analysis(
object_type = label.replace("_", " ") object_type = label.replace("_", " ")
if label in attribute_labels: if label in attribute_labels:
unified_objects.append(f"{object_type} (delivery/service)") display_name = ATTRIBUTE_LABEL_DISPLAY_MAP.get(label, object_type)
unified_objects.append(f"{display_name} (delivery/service)")
else: else:
unified_objects.append(object_type) unified_objects.append(object_type)