Update app.py
Browse files
app.py
CHANGED
|
@@ -50,10 +50,61 @@ if device.type == "cuda":
|
|
| 50 |
ocr_reader = easyocr.Reader(["en", "es", "fr", "de", "it"], gpu=(device.type == "cuda"))
|
| 51 |
|
| 52 |
# === Label sets (unchanged) ===
|
| 53 |
-
COMPREHENSIVE_PRODUCT_LABELS = [
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
# === Basic color palette for mapping ===
|
| 59 |
BASE_COLORS = {
|
|
|
|
| 50 |
ocr_reader = easyocr.Reader(["en", "es", "fr", "de", "it"], gpu=(device.type == "cuda"))
|
| 51 |
|
| 52 |
# === Label sets (unchanged) ===
|
| 53 |
+
COMPREHENSIVE_PRODUCT_LABELS = [
|
| 54 |
+
"trucker hat", "baseball cap", "beanie", "cap", "hat", "sunglasses", "watch", "jewelry",
|
| 55 |
+
"necklace", "bracelet", "ring", "earrings", "bag", "backpack", "purse", "wallet",
|
| 56 |
+
"belt", "scarf", "gloves", "shoes", "sneakers", "boots", "sandals", "heels",
|
| 57 |
+
"smartphone", "laptop", "tablet", "headphones", "earbuds", "speaker", "camera",
|
| 58 |
+
"gaming console", "controller", "keyboard", "mouse", "monitor", "TV", "remote",
|
| 59 |
+
"charger", "cable", "smartwatch", "fitness tracker", "drone", "robot",
|
| 60 |
+
"board game", "card game", "puzzle", "action figure", "doll", "toy car", "LEGO",
|
| 61 |
+
"building blocks", "stuffed animal", "teddy bear", "toy robot", "game controller",
|
| 62 |
+
"dice", "playing cards", "collectible card", "miniature figure", "model kit",
|
| 63 |
+
"perfume bottle", "cologne", "lipstick", "mascara", "foundation", "powder compact",
|
| 64 |
+
"nail polish", "skincare bottle", "lotion", "cream jar", "soap", "shampoo",
|
| 65 |
+
"conditioner", "toothbrush", "razor", "makeup brush", "mirror", "hair dryer",
|
| 66 |
+
"water bottle", "soda can", "beer bottle", "wine bottle", "coffee mug", "tea cup",
|
| 67 |
+
"food package", "cereal box", "snack bag", "candy bar", "chocolate", "cookie package",
|
| 68 |
+
"book", "magazine", "comic book", "DVD", "Blu-ray", "CD", "vinyl record",
|
| 69 |
+
"notebook", "journal", "planner", "calendar", "poster", "artwork", "photo frame",
|
| 70 |
+
"basketball", "football", "soccer ball", "tennis ball", "baseball", "golf ball",
|
| 71 |
+
"dumbbells", "yoga mat", "water bottle", "sports equipment", "helmet", "gloves",
|
| 72 |
+
"coffee maker", "blender", "toaster", "microwave", "pan", "pot", "plate", "bowl",
|
| 73 |
+
"cup", "glass", "utensils", "knife", "cutting board", "storage container",
|
| 74 |
+
"paint brush", "marker", "pen", "pencil", "crayon", "paint tube", "canvas",
|
| 75 |
+
"sketchbook", "ruler", "scissors", "glue", "tape", "stickers",
|
| 76 |
+
"box", "package", "container", "jar", "bottle", "can", "tube", "pouch", "bag"
|
| 77 |
+
]
|
| 78 |
+
|
| 79 |
+
COMPREHENSIVE_BRAND_LABELS = [
|
| 80 |
+
"Apple", "Samsung", "Google", "Microsoft", "Sony", "Nintendo", "PlayStation", "Xbox",
|
| 81 |
+
"HP", "Dell", "Lenovo", "ASUS", "Acer", "Canon", "Nikon", "GoPro", "DJI",
|
| 82 |
+
"Nike", "Adidas", "Puma", "Under Armour", "Reebok", "Converse", "Vans", "New Balance",
|
| 83 |
+
"Ray-Ban", "Oakley", "Rolex", "Casio", "Fossil", "Michael Kors", "Coach", "Louis Vuitton",
|
| 84 |
+
"L'Oreal", "Maybelline", "MAC", "Sephora", "Clinique", "Estee Lauder", "Chanel",
|
| 85 |
+
"Dior", "YSL", "Urban Decay", "Too Faced", "NARS", "Fenty Beauty",
|
| 86 |
+
"Hasbro", "Mattel", "LEGO", "Ravensburger", "Fantasy Flight Games", "Asmodee",
|
| 87 |
+
"Days of Wonder", "CMON", "Wizards of the Coast", "Pokémon", "Yu-Gi-Oh",
|
| 88 |
+
"Coca-Cola", "Pepsi", "Starbucks", "Red Bull", "Monster", "Gatorade", "Powerade",
|
| 89 |
+
"Nestle", "Hershey's", "Mars", "Ferrero", "Lindt", "Godiva",
|
| 90 |
+
"Crayola", "Sharpie", "Prismacolor", "Winsor & Newton", "Molotow", "Posca",
|
| 91 |
+
"Staedtler", "Faber-Castell", "Sakura", "Tombow", "Pilot", "Uni-ball",
|
| 92 |
+
"unknown", "generic", "no brand visible"
|
| 93 |
+
]
|
| 94 |
+
|
| 95 |
+
CHARACTER_LABELS = [
|
| 96 |
+
"person", "man", "woman", "child", "baby", "elderly person", "athlete", "professional",
|
| 97 |
+
"cartoon character", "anime character", "superhero", "mascot", "celebrity", "model",
|
| 98 |
+
"fantasy character", "sci-fi character", "historical figure", "fictional character"
|
| 99 |
+
]
|
| 100 |
+
|
| 101 |
+
DETAIL_LABELS = [
|
| 102 |
+
"text", "logo", "brand name", "price tag", "barcode", "QR code", "warning label",
|
| 103 |
+
"ingredients list", "nutritional information", "instructions", "serial number",
|
| 104 |
+
"model number", "size information", "color variants", "pattern", "texture",
|
| 105 |
+
"metallic finish", "matte finish", "glossy finish", "transparent", "translucent"
|
| 106 |
+
]
|
| 107 |
+
|
| 108 |
|
| 109 |
# === Basic color palette for mapping ===
|
| 110 |
BASE_COLORS = {
|