|
|
|
|
|
from typing import Dict, List, Optional |
|
|
|
|
|
class BrandPrompts: |
|
|
""" |
|
|
品牌視覺特徵與多模態識別資料庫 |
|
|
提供品牌的視覺線索、OpenCLIP prompts、Hashtags |
|
|
""" |
|
|
|
|
|
def __init__(self): |
|
|
"""初始化品牌資料庫""" |
|
|
|
|
|
self.brand_prompts = { |
|
|
|
|
|
'luxury': { |
|
|
"Louis Vuitton": { |
|
|
"strong_cues": [ |
|
|
"LV monogram pattern with interlocking L and V letters on brown canvas", |
|
|
"Brown canvas with golden hardware and leather trim showing Louis Vuitton signature", |
|
|
"Damier checkerboard pattern in brown and tan showing LV design", |
|
|
"Monogram flower motifs with LV initials repeated across surface" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Luxury handbag with structured silhouette and top handles", |
|
|
"Premium leather goods with golden metal accents", |
|
|
"Designer bag with classic proportions and elegant hardware" |
|
|
], |
|
|
"region_contexts": ["bag_panel", "luggage_surface", "wallet_front", "accessory_detail"], |
|
|
"openclip_prompts": { |
|
|
"bag_panel": [ |
|
|
"Louis Vuitton monogram canvas handbag with leather trim and brass hardware", |
|
|
"LV brown monogram pattern on luxury bag with golden clasps", |
|
|
"Designer handbag showing Louis Vuitton signature canvas and leather details" |
|
|
], |
|
|
"luggage_surface": [ |
|
|
"Louis Vuitton monogram luggage with brown canvas and leather corners", |
|
|
"LV travel bag showing iconic monogram pattern with metallic accents", |
|
|
"Luxury suitcase with Louis Vuitton canvas and protective leather trim" |
|
|
], |
|
|
"wallet_front": [ |
|
|
"Louis Vuitton monogram wallet with compact folding design", |
|
|
"LV small leather good showing monogram canvas and card slots", |
|
|
"Designer wallet with Louis Vuitton pattern and golden hardware" |
|
|
] |
|
|
}, |
|
|
"aliases": ["LV", "Louis Vuitton Monogram", "VUITTON", "LOUIS VUITTON"], |
|
|
"hashtags": { |
|
|
"zh": ["LV", "路易威登", "奢侈品", "精品包", "時尚"], |
|
|
"en": ["LouisVuitton", "LV", "LuxuryFashion", "DesignerBag", "Luxury"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": False |
|
|
}, |
|
|
|
|
|
"Gucci": { |
|
|
"strong_cues": [ |
|
|
"Interlocking double G logo in gold or silver metal with heart shape design", |
|
|
"GG logo in shiny gold brass hardware on black quilted leather", |
|
|
"Green and red web stripe on beige or brown canvas background", |
|
|
"GG monogram pattern repeated across fabric or leather surface", |
|
|
"Chevron matelassé quilted leather with V-shaped stitching pattern", |
|
|
"Heart-shaped double G logo with antique gold finish", |
|
|
"Bamboo handle detail on handbag with curved shape and metal hardware" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Luxury fashion item with bold logo placement and premium materials", |
|
|
"Designer accessory with distinctive hardware and Italian branding", |
|
|
"High-end quilted leather goods with geometric stitching pattern", |
|
|
"Black leather handbag with gold chain strap and structured silhouette", |
|
|
"Luxury bag with chevron quilting and metallic hardware accents" |
|
|
], |
|
|
"region_contexts": ["bag_front", "bag_panel", "belt_buckle", "shoe_detail", "accessory_surface", "logo_area"], |
|
|
"openclip_prompts": { |
|
|
"bag_front": [ |
|
|
"Gucci Marmont handbag with heart-shaped GG logo in antique gold on quilted black leather", |
|
|
"Designer bag showing Gucci chevron matelassé quilted pattern with gold GG hardware", |
|
|
"Luxury handbag with double G heart logo and V-shaped quilting on black leather", |
|
|
"Gucci bag with interlocking GG logo web stripe and canvas texture", |
|
|
"Black quilted leather Gucci bag with shiny gold double G emblem and chain strap", |
|
|
"Gucci Marmont camera bag with chevron quilted leather and gold hardware", |
|
|
"Designer handbag featuring Gucci signature GG logo with geometric quilting pattern" |
|
|
], |
|
|
"bag_panel": [ |
|
|
"Gucci matelassé quilted leather surface with chevron V-pattern stitching", |
|
|
"Black quilted leather panel with Gucci heart-shaped GG logo in center", |
|
|
"Luxury leather with geometric quilting showing Gucci craftsmanship and gold hardware", |
|
|
"Chevron stitched leather surface with interlocking GG emblem in antique gold", |
|
|
"Gucci quilted pattern with V-shaped chevron design and metallic logo placement" |
|
|
], |
|
|
"belt_buckle": [ |
|
|
"Gucci belt with large interlocking GG buckle in polished gold metal", |
|
|
"Designer belt showing double G logo buckle with black or brown leather strap", |
|
|
"Luxury belt with Gucci signature GG buckle in brass finish and Italian leather", |
|
|
"Gucci GG Marmont belt with textured double G buckle and leather band" |
|
|
], |
|
|
"logo_area": [ |
|
|
"Close-up of Gucci interlocking GG logo in gold metal with heart shape", |
|
|
"Gucci double G emblem in antique gold brass on black leather background", |
|
|
"Heart-shaped GG logo with metallic gold finish showing Gucci branding", |
|
|
"Shiny gold Gucci GG hardware on quilted matelassé leather surface" |
|
|
] |
|
|
}, |
|
|
"aliases": ["GG", "GUCCI", "Gucci Marmont"], |
|
|
"hashtags": { |
|
|
"zh": ["Gucci", "古馳", "奢侈品", "精品", "義大利時尚", "Marmont"], |
|
|
"en": ["Gucci", "LuxuryFashion", "DesignerBrand", "ItalianFashion", "GG", "GucciMarmont"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": False |
|
|
}, |
|
|
|
|
|
"Chanel": { |
|
|
"strong_cues": [ |
|
|
"Interlocking double C logo in metal or quilted leather", |
|
|
"Quilted diamond pattern leather with chain strap", |
|
|
"Black and white color scheme with gold or silver chain", |
|
|
"Camellia flower motif as decorative element" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Elegant quilted leather handbag with chain details", |
|
|
"Luxury fashion item with classic French design", |
|
|
"Designer accessory with sophisticated minimalist styling" |
|
|
], |
|
|
"region_contexts": ["bag_flap", "jewelry_detail", "perfume_bottle", "clothing_label"], |
|
|
"openclip_prompts": { |
|
|
"bag_flap": [ |
|
|
"Chanel quilted bag with interlocking CC logo and chain strap", |
|
|
"Classic flap bag showing Chanel diamond quilting and gold hardware", |
|
|
"Luxury handbag with Chanel CC closure and leather chain" |
|
|
] |
|
|
}, |
|
|
"aliases": ["CC", "CHANEL"], |
|
|
"hashtags": { |
|
|
"zh": ["Chanel", "香奈兒", "奢侈品", "精品包", "法國時尚"], |
|
|
"en": ["Chanel", "ChanelBag", "Luxury", "FrenchFashion", "ClassicBag"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": False |
|
|
}, |
|
|
|
|
|
"Hermès": { |
|
|
"strong_cues": [ |
|
|
"Orange box or shopping bag with brown ribbon", |
|
|
"Birkin or Kelly bag with distinctive silhouette and hardware", |
|
|
"H logo belt buckle in polished metal", |
|
|
"Saddle stitching on leather goods with equestrian heritage" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Ultra-luxury leather handbag with exceptional craftsmanship", |
|
|
"Designer accessory with understated elegance and premium materials", |
|
|
"High-end fashion item with classic proportions and hardware" |
|
|
], |
|
|
"region_contexts": ["bag_structure", "belt_buckle", "scarf_pattern", "packaging"], |
|
|
"openclip_prompts": { |
|
|
"bag_structure": [ |
|
|
"Hermès Birkin bag with structured leather and golden padlock", |
|
|
"Luxury handbag showing Hermès Kelly bag silhouette with turnlock", |
|
|
"Designer bag with Hermès craftsmanship and distinctive hardware" |
|
|
] |
|
|
}, |
|
|
"aliases": ["HERMES", "HERMÈS", "BIRKIN", "KELLY"], |
|
|
"hashtags": { |
|
|
"zh": ["Hermès", "愛馬仕", "柏金包", "奢侈品", "頂級精品"], |
|
|
"en": ["Hermes", "Birkin", "KellyBag", "Luxury", "UltraLuxury"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": False |
|
|
}, |
|
|
|
|
|
"Prada": { |
|
|
"strong_cues": [ |
|
|
"Triangular metal logo plate with Prada Milano text", |
|
|
"Saffiano leather with crosshatch texture pattern", |
|
|
"Black nylon bag with triangular logo badge", |
|
|
"Minimalist design with subtle branding placement" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Italian luxury handbag with clean modern lines", |
|
|
"Designer accessory with understated contemporary styling", |
|
|
"High-end leather goods with minimalist aesthetic" |
|
|
], |
|
|
"region_contexts": ["bag_front", "wallet_surface", "shoe_heel", "clothing_tag"], |
|
|
"openclip_prompts": { |
|
|
"bag_front": [ |
|
|
"Prada bag with triangular metal logo and saffiano leather", |
|
|
"Designer handbag showing Prada Milano badge with textured leather", |
|
|
"Luxury bag with Prada signature triangle and minimalist design" |
|
|
] |
|
|
}, |
|
|
"aliases": ["PRADA", "MILANO"], |
|
|
"hashtags": { |
|
|
"zh": ["Prada", "普拉達", "奢侈品", "義大利精品", "時尚"], |
|
|
"en": ["Prada", "ItalianLuxury", "DesignerBag", "LuxuryFashion", "Minimalist"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": False |
|
|
} |
|
|
}, |
|
|
|
|
|
|
|
|
'sportswear': { |
|
|
"Nike": { |
|
|
"strong_cues": [ |
|
|
"Swoosh logo in black white or colored variations", |
|
|
"Just Do It slogan text accompanying swoosh", |
|
|
"Air Jordan jumpman silhouette logo", |
|
|
"Nike Air branding on shoe midsole or tongue" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Athletic footwear with sporty performance design", |
|
|
"Sportswear with moisture-wicking technical fabric", |
|
|
"Running shoe with cushioned midsole and branded details" |
|
|
], |
|
|
"region_contexts": ["shoe_side", "apparel_chest", "equipment_surface", "logo_placement"], |
|
|
"openclip_prompts": { |
|
|
"shoe_side": [ |
|
|
"Nike sneaker with swoosh logo on side panel", |
|
|
"Athletic shoe showing Nike branding and Air technology", |
|
|
"Running shoe with Nike swoosh and performance design" |
|
|
], |
|
|
"apparel_chest": [ |
|
|
"Nike athletic wear with swoosh logo on chest", |
|
|
"Sports apparel showing Nike branding and technical fabric", |
|
|
"Performance clothing with Nike swoosh and Just Do It text" |
|
|
] |
|
|
}, |
|
|
"aliases": ["NIKE", "JUST DO IT", "swoosh"], |
|
|
"hashtags": { |
|
|
"zh": ["Nike", "耐吉", "運動", "球鞋", "運動品牌"], |
|
|
"en": ["Nike", "JustDoIt", "Sneakers", "Athletic", "Sportswear"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": True |
|
|
}, |
|
|
|
|
|
"Adidas": { |
|
|
"strong_cues": [ |
|
|
"Three stripes design on side of shoes or apparel", |
|
|
"Trefoil logo with three-leaf clover design", |
|
|
"Performance logo with three bars forming mountain shape", |
|
|
"Boost technology branding on shoe midsole" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Athletic footwear with three-stripe design element", |
|
|
"Sportswear with retro or performance styling", |
|
|
"Running shoe with distinctive midsole technology" |
|
|
], |
|
|
"region_contexts": ["shoe_side", "apparel_sleeve", "equipment_detail", "logo_area"], |
|
|
"openclip_prompts": { |
|
|
"shoe_side": [ |
|
|
"Adidas sneaker with three stripes on side panel", |
|
|
"Athletic shoe showing Adidas branding and Boost sole", |
|
|
"Sports footwear with Adidas three-stripe design" |
|
|
] |
|
|
}, |
|
|
"aliases": ["ADIDAS", "ORIGINALS", "three stripes"], |
|
|
"hashtags": { |
|
|
"zh": ["Adidas", "愛迪達", "三條線", "運動", "球鞋"], |
|
|
"en": ["Adidas", "ThreeStripes", "Sneakers", "Sportswear", "Athletic"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": True |
|
|
}, |
|
|
|
|
|
"Puma": { |
|
|
"strong_cues": [ |
|
|
"Leaping puma cat logo in silhouette form", |
|
|
"Puma wordmark text in distinctive font", |
|
|
"Formstrip design on side of shoes", |
|
|
"Cat logo combined with Puma text branding" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Athletic footwear with sleek performance design", |
|
|
"Sportswear with modern styling and branding", |
|
|
"Running shoe with lightweight construction" |
|
|
], |
|
|
"region_contexts": ["shoe_side", "apparel_detail", "equipment_logo"], |
|
|
"openclip_prompts": { |
|
|
"shoe_side": [ |
|
|
"Puma sneaker with cat logo and formstrip design", |
|
|
"Athletic shoe showing Puma branding on side", |
|
|
"Sports footwear with Puma leaping cat emblem" |
|
|
] |
|
|
}, |
|
|
"aliases": ["PUMA"], |
|
|
"hashtags": { |
|
|
"zh": ["Puma", "彪馬", "運動品牌", "球鞋"], |
|
|
"en": ["Puma", "Sneakers", "Athletic", "Sportswear"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": True |
|
|
}, |
|
|
|
|
|
"Under Armour": { |
|
|
"strong_cues": [ |
|
|
"Interlocking UA logo design", |
|
|
"HeatGear or ColdGear technology branding", |
|
|
"Under Armour wordmark in athletic font", |
|
|
"Performance fabric with visible texture pattern" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Athletic apparel with technical performance features", |
|
|
"Sportswear with moisture management technology", |
|
|
"Training gear with modern athletic design" |
|
|
], |
|
|
"region_contexts": ["apparel_chest", "shoe_detail", "equipment_surface"], |
|
|
"openclip_prompts": { |
|
|
"apparel_chest": [ |
|
|
"Under Armour shirt with UA logo on chest", |
|
|
"Athletic wear showing Under Armour branding and HeatGear", |
|
|
"Performance apparel with Under Armour logo and technical fabric" |
|
|
] |
|
|
}, |
|
|
"aliases": ["UA", "UNDER ARMOUR"], |
|
|
"hashtags": { |
|
|
"zh": ["UnderArmour", "安德瑪", "運動服飾", "訓練裝備"], |
|
|
"en": ["UnderArmour", "UA", "Athletic", "PerformanceGear", "Training"] |
|
|
}, |
|
|
"visual_distinctive": False, |
|
|
"text_prominent": True |
|
|
} |
|
|
}, |
|
|
|
|
|
|
|
|
'tech': { |
|
|
"Apple": { |
|
|
"strong_cues": [ |
|
|
"Bitten apple logo in silver white or black", |
|
|
"Minimalist aluminum or glass device design", |
|
|
"iPhone with distinctive notch or dynamic island", |
|
|
"MacBook with glowing apple logo on lid" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Sleek electronic device with premium materials", |
|
|
"Smartphone with edge-to-edge display design", |
|
|
"Laptop with thin profile and minimal branding" |
|
|
], |
|
|
"region_contexts": ["device_back", "laptop_lid", "packaging", "product_front"], |
|
|
"openclip_prompts": { |
|
|
"device_back": [ |
|
|
"iPhone back with apple logo and camera array", |
|
|
"Apple device showing bitten apple emblem and glass back", |
|
|
"Smartphone with Apple branding and premium finish" |
|
|
], |
|
|
"laptop_lid": [ |
|
|
"MacBook with glowing apple logo on aluminum lid", |
|
|
"Apple laptop showing minimalist design and apple emblem", |
|
|
"Premium notebook with Apple branding and sleek profile" |
|
|
] |
|
|
}, |
|
|
"aliases": ["APPLE", "IPHONE", "IPAD", "MACBOOK", "apple logo"], |
|
|
"hashtags": { |
|
|
"zh": ["Apple", "蘋果", "iPhone", "科技", "蘋果產品"], |
|
|
"en": ["Apple", "iPhone", "MacBook", "Tech", "iOS"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": False |
|
|
}, |
|
|
|
|
|
"Samsung": { |
|
|
"strong_cues": [ |
|
|
"Samsung wordmark logo in blue or white", |
|
|
"Galaxy branding on smartphone", |
|
|
"Curved edge display on premium devices", |
|
|
"S Pen stylus with Samsung device" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Android smartphone with large display", |
|
|
"Electronic device with modern design", |
|
|
"Tech product with screen and branding" |
|
|
], |
|
|
"region_contexts": ["device_front", "product_back", "packaging"], |
|
|
"openclip_prompts": { |
|
|
"device_front": [ |
|
|
"Samsung Galaxy phone with curved display and minimal bezels", |
|
|
"Smartphone showing Samsung branding and screen", |
|
|
"Android device with Samsung logo and modern design" |
|
|
] |
|
|
}, |
|
|
"aliases": ["SAMSUNG", "Galaxy"], |
|
|
"hashtags": { |
|
|
"zh": ["Samsung", "三星", "Galaxy", "安卓", "科技"], |
|
|
"en": ["Samsung", "Galaxy", "Android", "Tech", "Smartphone"] |
|
|
}, |
|
|
"visual_distinctive": False, |
|
|
"text_prominent": True |
|
|
}, |
|
|
|
|
|
"Microsoft": { |
|
|
"strong_cues": [ |
|
|
"Four-colored square window logo", |
|
|
"Surface branding on devices", |
|
|
"Windows logo on keyboard or device", |
|
|
"Xbox green logo on gaming products" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Premium laptop or tablet device", |
|
|
"Gaming console or controller", |
|
|
"Computer hardware with modern design" |
|
|
], |
|
|
"region_contexts": ["device_surface", "keyboard_area", "product_branding"], |
|
|
"openclip_prompts": { |
|
|
"device_surface": [ |
|
|
"Microsoft Surface laptop with logo and premium build", |
|
|
"Device showing Microsoft branding and sleek design", |
|
|
"Surface product with distinctive kickstand and logo" |
|
|
] |
|
|
}, |
|
|
"aliases": ["MICROSOFT", "Surface", "Windows"], |
|
|
"hashtags": { |
|
|
"zh": ["Microsoft", "微軟", "Surface", "科技", "Windows"], |
|
|
"en": ["Microsoft", "Surface", "Windows", "Tech", "Xbox"] |
|
|
}, |
|
|
"visual_distinctive": False, |
|
|
"text_prominent": True |
|
|
} |
|
|
}, |
|
|
|
|
|
|
|
|
'automotive': { |
|
|
"Mercedes-Benz": { |
|
|
"strong_cues": [ |
|
|
"Three-pointed star logo in circle", |
|
|
"Mercedes-Benz wordmark on vehicle", |
|
|
"Large star emblem on front grille", |
|
|
"Hood ornament with standing star" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Luxury vehicle with premium design", |
|
|
"Car with elegant styling and badge", |
|
|
"Automobile with refined details" |
|
|
], |
|
|
"region_contexts": ["front_grille", "hood_ornament", "wheel_center", "badge"], |
|
|
"openclip_prompts": { |
|
|
"front_grille": [ |
|
|
"Mercedes-Benz front with three-pointed star on grille", |
|
|
"Luxury car showing Mercedes logo and elegant grille design", |
|
|
"Vehicle with Mercedes-Benz star emblem and premium styling" |
|
|
] |
|
|
}, |
|
|
"aliases": ["Mercedes", "Benz", "MB", "MERCEDES-BENZ"], |
|
|
"hashtags": { |
|
|
"zh": ["Mercedes", "賓士", "豪華車", "汽車", "德國車"], |
|
|
"en": ["Mercedes", "Benz", "LuxuryCar", "German", "Automotive"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": False |
|
|
}, |
|
|
|
|
|
"BMW": { |
|
|
"strong_cues": [ |
|
|
"Blue and white roundel logo with BMW letters", |
|
|
"Kidney grille design on front", |
|
|
"Hofmeister kink in rear window design", |
|
|
"BMW M badge for performance models" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Luxury sports sedan with dynamic styling", |
|
|
"Premium vehicle with distinctive design", |
|
|
"Car with performance-oriented features" |
|
|
], |
|
|
"region_contexts": ["front_badge", "wheel_center", "rear_emblem"], |
|
|
"openclip_prompts": { |
|
|
"front_badge": [ |
|
|
"BMW front with blue and white roundel and kidney grille", |
|
|
"Luxury car showing BMW logo and distinctive grille design", |
|
|
"Vehicle with BMW emblem and sporty styling" |
|
|
] |
|
|
}, |
|
|
"aliases": ["BMW"], |
|
|
"hashtags": { |
|
|
"zh": ["BMW", "寶馬", "豪華車", "德國車", "性能車"], |
|
|
"en": ["BMW", "LuxuryCar", "German", "Performance", "Ultimate Driving Machine"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": False |
|
|
}, |
|
|
|
|
|
"Tesla": { |
|
|
"strong_cues": [ |
|
|
"T-shaped logo resembling cross-section of electric motor", |
|
|
"Tesla wordmark on vehicle", |
|
|
"Minimalist design with flush door handles", |
|
|
"Large touchscreen display in interior" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Electric vehicle with modern design", |
|
|
"Car with clean aerodynamic styling", |
|
|
"Automobile with minimal exterior branding" |
|
|
], |
|
|
"region_contexts": ["front_badge", "rear_emblem", "wheel_center"], |
|
|
"openclip_prompts": { |
|
|
"front_badge": [ |
|
|
"Tesla front with T logo and minimalist design", |
|
|
"Electric vehicle showing Tesla branding and clean styling", |
|
|
"Car with Tesla emblem and aerodynamic profile" |
|
|
] |
|
|
}, |
|
|
"aliases": ["TESLA"], |
|
|
"hashtags": { |
|
|
"zh": ["Tesla", "特斯拉", "電動車", "科技", "環保"], |
|
|
"en": ["Tesla", "ElectricVehicle", "EV", "Tech", "Sustainable"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": False |
|
|
} |
|
|
}, |
|
|
|
|
|
|
|
|
'watches': { |
|
|
"Rolex": { |
|
|
"strong_cues": [ |
|
|
"Crown logo at 12 o'clock position", |
|
|
"Rolex wordmark on dial with Oyster Perpetual text", |
|
|
"Cyclops date magnifier on crystal", |
|
|
"Jubilee or Oyster bracelet design" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Luxury watch with metal bracelet", |
|
|
"Timepiece with classic round case", |
|
|
"Wristwatch with premium finish" |
|
|
], |
|
|
"region_contexts": ["watch_dial", "bracelet_clasp", "case_side"], |
|
|
"openclip_prompts": { |
|
|
"watch_dial": [ |
|
|
"Rolex watch dial with crown logo and Oyster Perpetual text", |
|
|
"Luxury timepiece showing Rolex branding and date window", |
|
|
"Wristwatch with Rolex crown emblem and classic design" |
|
|
] |
|
|
}, |
|
|
"aliases": ["ROLEX", "OYSTER PERPETUAL"], |
|
|
"hashtags": { |
|
|
"zh": ["Rolex", "勞力士", "手錶", "奢華", "瑞士錶"], |
|
|
"en": ["Rolex", "LuxuryWatch", "Swiss", "Timepiece", "OysterPerpetual"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": True |
|
|
}, |
|
|
|
|
|
"Omega": { |
|
|
"strong_cues": [ |
|
|
"Omega symbol Ω on dial or case", |
|
|
"Seamaster or Speedmaster model branding", |
|
|
"Co-Axial escapement text on dial", |
|
|
"Distinctive bracelet or strap design" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Swiss luxury watch with sporty design", |
|
|
"Timepiece with professional appearance", |
|
|
"Wristwatch with precision craftsmanship" |
|
|
], |
|
|
"region_contexts": ["watch_dial", "case_back", "bracelet"], |
|
|
"openclip_prompts": { |
|
|
"watch_dial": [ |
|
|
"Omega watch dial with Ω symbol and Seamaster branding", |
|
|
"Luxury timepiece showing Omega logo and Co-Axial text", |
|
|
"Wristwatch with Omega emblem and professional design" |
|
|
] |
|
|
}, |
|
|
"aliases": ["OMEGA", "Ω"], |
|
|
"hashtags": { |
|
|
"zh": ["Omega", "歐米茄", "手錶", "瑞士錶", "奢華"], |
|
|
"en": ["Omega", "Seamaster", "Speedmaster", "SwissWatch", "Luxury"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": True |
|
|
} |
|
|
}, |
|
|
|
|
|
|
|
|
'fashion': { |
|
|
"Zara": { |
|
|
"strong_cues": [ |
|
|
"Zara wordmark in sans-serif font", |
|
|
"Minimalist clothing tag design", |
|
|
"Fast fashion styling with current trends", |
|
|
"Zara logo on shopping bag or packaging" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Contemporary fashion apparel", |
|
|
"Trendy clothing with modern cut", |
|
|
"Affordable fashion item" |
|
|
], |
|
|
"region_contexts": ["clothing_tag", "shopping_bag", "label"], |
|
|
"openclip_prompts": { |
|
|
"clothing_tag": [ |
|
|
"Zara clothing tag with brand logo", |
|
|
"Fashion item showing Zara label", |
|
|
"Apparel with Zara branding" |
|
|
] |
|
|
}, |
|
|
"aliases": ["ZARA"], |
|
|
"hashtags": { |
|
|
"zh": ["Zara", "時尚", "快時尚", "穿搭"], |
|
|
"en": ["Zara", "Fashion", "FastFashion", "Style", "OOTD"] |
|
|
}, |
|
|
"visual_distinctive": False, |
|
|
"text_prominent": True |
|
|
}, |
|
|
|
|
|
"H&M": { |
|
|
"strong_cues": [ |
|
|
"H&M logo in red and white", |
|
|
"Hennes & Mauritz full brand name", |
|
|
"Conscious collection labeling", |
|
|
"Distinctive red shopping bag" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Affordable fashion clothing", |
|
|
"Casual apparel with trendy design", |
|
|
"Fast fashion item" |
|
|
], |
|
|
"region_contexts": ["clothing_tag", "label", "shopping_bag"], |
|
|
"openclip_prompts": { |
|
|
"clothing_tag": [ |
|
|
"H&M clothing tag with red and white logo", |
|
|
"Fashion item showing H&M branding", |
|
|
"Apparel with Hennes & Mauritz label" |
|
|
] |
|
|
}, |
|
|
"aliases": ["HM", "H&M", "HENNES", "MAURITZ"], |
|
|
"hashtags": { |
|
|
"zh": ["HM", "時尚", "快時尚", "平價時尚"], |
|
|
"en": ["HM", "Fashion", "FastFashion", "Style", "AffordableFashion"] |
|
|
}, |
|
|
"visual_distinctive": False, |
|
|
"text_prominent": True |
|
|
}, |
|
|
|
|
|
"Ralph Lauren": { |
|
|
"strong_cues": [ |
|
|
"Polo player on horse logo", |
|
|
"Polo Ralph Lauren text branding", |
|
|
"Preppy American style clothing", |
|
|
"Polo shirt with collar and logo" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Classic American fashion item", |
|
|
"Preppy styled clothing", |
|
|
"Casual wear with logo detail" |
|
|
], |
|
|
"region_contexts": ["shirt_chest", "clothing_tag", "logo_placement"], |
|
|
"openclip_prompts": { |
|
|
"shirt_chest": [ |
|
|
"Polo shirt with Ralph Lauren polo player logo", |
|
|
"Casual wear showing Polo Ralph Lauren emblem", |
|
|
"Apparel with Ralph Lauren polo player branding" |
|
|
] |
|
|
}, |
|
|
"aliases": ["Polo", "RALPH LAUREN", "RL"], |
|
|
"hashtags": { |
|
|
"zh": ["RalphLauren", "Polo", "美式風格", "經典時尚"], |
|
|
"en": ["RalphLauren", "Polo", "AmericanStyle", "Preppy", "Classic"] |
|
|
}, |
|
|
"visual_distinctive": True, |
|
|
"text_prominent": True |
|
|
}, |
|
|
|
|
|
"Tommy Hilfiger": { |
|
|
"strong_cues": [ |
|
|
"Red white and blue flag logo", |
|
|
"Tommy Hilfiger wordmark text", |
|
|
"Preppy American sportswear styling", |
|
|
"Flag emblem on clothing" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Casual American fashion", |
|
|
"Sporty preppy clothing", |
|
|
"Logo-embellished apparel" |
|
|
], |
|
|
"region_contexts": ["clothing_chest", "tag", "logo_area"], |
|
|
"openclip_prompts": { |
|
|
"clothing_chest": [ |
|
|
"Tommy Hilfiger apparel with flag logo", |
|
|
"Casual wear showing Tommy Hilfiger branding", |
|
|
"Clothing with red white blue Tommy emblem" |
|
|
] |
|
|
}, |
|
|
"hashtags": { |
|
|
"zh": ["TommyHilfiger", "美式休閒", "時尚", "經典"], |
|
|
"en": ["TommyHilfiger", "American", "Preppy", "Fashion", "Classic"] |
|
|
} |
|
|
}, |
|
|
|
|
|
"Uniqlo": { |
|
|
"strong_cues": [ |
|
|
"Uniqlo wordmark in red and white", |
|
|
"LifeWear philosophy branding", |
|
|
"Minimalist Japanese design aesthetic", |
|
|
"HeatTech or AIRism technology labels" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Simple functional clothing", |
|
|
"Basic casual apparel", |
|
|
"Affordable everyday wear" |
|
|
], |
|
|
"region_contexts": ["clothing_tag", "label", "shopping_bag"], |
|
|
"openclip_prompts": { |
|
|
"clothing_tag": [ |
|
|
"Uniqlo clothing tag with brand logo", |
|
|
"Apparel showing Uniqlo LifeWear branding", |
|
|
"Clothing with Uniqlo label and technology marker" |
|
|
] |
|
|
}, |
|
|
"hashtags": { |
|
|
"zh": ["Uniqlo", "優衣庫", "日系", "簡約", "基本款"], |
|
|
"en": ["Uniqlo", "LifeWear", "Japanese", "Minimalist", "Basics"] |
|
|
} |
|
|
}, |
|
|
|
|
|
"Gap": { |
|
|
"strong_cues": [ |
|
|
"Gap logo in blue square", |
|
|
"Classic American casual styling", |
|
|
"Denim and khaki product focus", |
|
|
"Gap wordmark on tags" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Casual American clothing", |
|
|
"Basic everyday apparel", |
|
|
"Classic wardrobe staples" |
|
|
], |
|
|
"region_contexts": ["clothing_tag", "label", "logo_placement"], |
|
|
"openclip_prompts": { |
|
|
"clothing_tag": [ |
|
|
"Gap clothing tag with blue logo", |
|
|
"Apparel showing Gap branding", |
|
|
"Casual wear with Gap label" |
|
|
] |
|
|
}, |
|
|
"hashtags": { |
|
|
"zh": ["Gap", "美式休閒", "經典", "基本款"], |
|
|
"en": ["Gap", "American", "Casual", "Classic", "Everyday"] |
|
|
} |
|
|
}, |
|
|
|
|
|
"Lacoste": { |
|
|
"strong_cues": [ |
|
|
"Green crocodile logo", |
|
|
"Polo shirt with crocodile emblem", |
|
|
"French sportswear styling", |
|
|
"Crocodile on left chest area" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Tennis-inspired fashion", |
|
|
"Sporty casual clothing", |
|
|
"Preppy athletic wear" |
|
|
], |
|
|
"region_contexts": ["shirt_chest", "clothing_detail", "logo_area"], |
|
|
"openclip_prompts": { |
|
|
"shirt_chest": [ |
|
|
"Lacoste polo shirt with green crocodile logo", |
|
|
"Sportswear showing Lacoste emblem on chest", |
|
|
"Tennis apparel with Lacoste crocodile branding" |
|
|
] |
|
|
}, |
|
|
"hashtags": { |
|
|
"zh": ["Lacoste", "鱷魚", "法國", "網球", "運動時尚"], |
|
|
"en": ["Lacoste", "Crocodile", "French", "Tennis", "Sporty"] |
|
|
} |
|
|
}, |
|
|
|
|
|
"Calvin Klein": { |
|
|
"strong_cues": [ |
|
|
"CK logo or Calvin Klein wordmark", |
|
|
"Minimalist modern design aesthetic", |
|
|
"Monochromatic color schemes", |
|
|
"Underwear waistband with CK logo" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Contemporary minimalist fashion", |
|
|
"Modern casual clothing", |
|
|
"Designer basics" |
|
|
], |
|
|
"region_contexts": ["clothing_tag", "waistband", "logo_area"], |
|
|
"openclip_prompts": { |
|
|
"clothing_tag": [ |
|
|
"Calvin Klein clothing with CK logo", |
|
|
"Apparel showing Calvin Klein minimalist branding", |
|
|
"Fashion item with CK monogram" |
|
|
] |
|
|
}, |
|
|
"hashtags": { |
|
|
"zh": ["CalvinKlein", "CK", "簡約", "美式時尚", "現代"], |
|
|
"en": ["CalvinKlein", "CK", "Minimalist", "Modern", "Designer"] |
|
|
} |
|
|
}, |
|
|
|
|
|
"Levi's": { |
|
|
"strong_cues": [ |
|
|
"Red tab on back pocket of jeans", |
|
|
"Two horse leather patch on waistband", |
|
|
"501 or other style number branding", |
|
|
"Arcuate stitching pattern on back pockets" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Classic denim jeans", |
|
|
"American workwear styling", |
|
|
"Vintage-inspired casual wear" |
|
|
], |
|
|
"region_contexts": ["jeans_pocket", "waistband_patch", "back_detail"], |
|
|
"openclip_prompts": { |
|
|
"jeans_pocket": [ |
|
|
"Levi's jeans with red tab on back pocket", |
|
|
"Denim showing Levi's two horse patch and arcuate stitching", |
|
|
"Jeans with Levi's 501 branding and classic details" |
|
|
] |
|
|
}, |
|
|
"hashtags": { |
|
|
"zh": ["Levis", "李維斯", "牛仔褲", "丹寧", "美式"], |
|
|
"en": ["Levis", "Denim", "Jeans", "American", "501"] |
|
|
} |
|
|
}, |
|
|
|
|
|
"The North Face": { |
|
|
"strong_cues": [ |
|
|
"Half dome logo design", |
|
|
"The North Face wordmark", |
|
|
"Outdoor technical gear styling", |
|
|
"Logo patch on jacket or backpack" |
|
|
], |
|
|
"weak_cues": [ |
|
|
"Outdoor athletic apparel", |
|
|
"Technical outdoor gear", |
|
|
"Adventure clothing" |
|
|
], |
|
|
"region_contexts": ["jacket_chest", "backpack_front", "apparel_sleeve"], |
|
|
"openclip_prompts": { |
|
|
"jacket_chest": [ |
|
|
"The North Face jacket with half dome logo", |
|
|
"Outdoor apparel showing North Face branding", |
|
|
"Technical gear with The North Face emblem" |
|
|
] |
|
|
}, |
|
|
"hashtags": { |
|
|
"zh": ["TheNorthFace", "北臉", "戶外", "機能", "登山"], |
|
|
"en": ["TheNorthFace", "Outdoor", "Adventure", "Technical", "Hiking"] |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
print(f"✓ Brand Prompts initialized with {self._count_brands()} brands across {len(self.brand_prompts)} categories") |
|
|
|
|
|
def _count_brands(self) -> int: |
|
|
"""計算總品牌數量""" |
|
|
total = 0 |
|
|
for category in self.brand_prompts.values(): |
|
|
total += len(category) |
|
|
return total |
|
|
|
|
|
def get_prompts(self, brand_name: str) -> Optional[Dict]: |
|
|
""" |
|
|
取得特定品牌的完整 prompt 資料 |
|
|
|
|
|
Args: |
|
|
brand_name: 品牌名稱 |
|
|
|
|
|
Returns: |
|
|
品牌資料字典,若不存在則返回 None |
|
|
""" |
|
|
for category in self.brand_prompts.values(): |
|
|
if brand_name in category: |
|
|
result = category[brand_name].copy() |
|
|
result['category'] = self.get_brand_category(brand_name) |
|
|
return result |
|
|
return None |
|
|
|
|
|
def get_brand_category(self, brand_name: str) -> str: |
|
|
""" |
|
|
取得品牌類別 |
|
|
|
|
|
Args: |
|
|
brand_name: 品牌名稱 |
|
|
|
|
|
Returns: |
|
|
品牌類別(luxury, sportswear, tech, etc.) |
|
|
""" |
|
|
for category_name, brands in self.brand_prompts.items(): |
|
|
if brand_name in brands: |
|
|
return category_name |
|
|
return 'unknown' |
|
|
|
|
|
def get_all_brands(self) -> Dict: |
|
|
""" |
|
|
取得所有品牌的扁平化字典 |
|
|
|
|
|
Returns: |
|
|
扁平化的品牌字典 {brand_name: brand_data} |
|
|
""" |
|
|
flat_brands = {} |
|
|
for category_name, brands in self.brand_prompts.items(): |
|
|
for brand_name, brand_data in brands.items(): |
|
|
brand_data_copy = brand_data.copy() |
|
|
brand_data_copy['category'] = category_name |
|
|
flat_brands[brand_name] = brand_data_copy |
|
|
return flat_brands |
|
|
|
|
|
def get_brands_by_category(self, category: str) -> Dict: |
|
|
""" |
|
|
取得特定類別的所有品牌 |
|
|
|
|
|
Args: |
|
|
category: 類別名稱 |
|
|
|
|
|
Returns: |
|
|
該類別的品牌字典 |
|
|
""" |
|
|
return self.brand_prompts.get(category, {}) |
|
|
|
|
|
def search_brand_by_alias(self, alias: str) -> Optional[str]: |
|
|
""" |
|
|
根據別名搜尋品牌名稱(模糊匹配) |
|
|
|
|
|
Args: |
|
|
alias: 品牌別名或簡稱 |
|
|
|
|
|
Returns: |
|
|
品牌正式名稱,若找不到則返回 None |
|
|
""" |
|
|
alias_lower = alias.lower() |
|
|
|
|
|
|
|
|
alias_map = { |
|
|
'lv': 'Louis Vuitton', |
|
|
'ck': 'Calvin Klein', |
|
|
'tnf': 'The North Face', |
|
|
'ua': 'Under Armour', |
|
|
'hm': 'H&M' |
|
|
} |
|
|
|
|
|
if alias_lower in alias_map: |
|
|
return alias_map[alias_lower] |
|
|
|
|
|
|
|
|
for brand_name in self.get_all_brands().keys(): |
|
|
if alias_lower in brand_name.lower(): |
|
|
return brand_name |
|
|
|
|
|
return None |
|
|
|
|
|
def get_hashtags(self, brand_name: str, language: str = 'zh') -> List[str]: |
|
|
""" |
|
|
取得品牌的 hashtags |
|
|
|
|
|
Args: |
|
|
brand_name: 品牌名稱 |
|
|
language: 語言 ('zh', 'en', 或 'zh-en') |
|
|
|
|
|
Returns: |
|
|
Hashtag 列表 |
|
|
""" |
|
|
brand_data = self.get_prompts(brand_name) |
|
|
if not brand_data: |
|
|
return [] |
|
|
|
|
|
hashtags = brand_data.get('hashtags', {}) |
|
|
|
|
|
if language == 'zh': |
|
|
return hashtags.get('zh', []) |
|
|
elif language == 'en': |
|
|
return hashtags.get('en', []) |
|
|
elif language == 'zh-en' or language == 'both': |
|
|
zh_tags = hashtags.get('zh', []) |
|
|
en_tags = hashtags.get('en', []) |
|
|
return zh_tags + en_tags |
|
|
else: |
|
|
return hashtags.get('zh', []) |
|
|
|
|
|
print("✓ BrandPrompts defined") |
|
|
|