Ellie Sleightholm
commited on
Commit
ยท
75fbfdf
1
Parent(s):
5db90f4
update items
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ from io import BytesIO
|
|
9 |
# Sidebar content
|
10 |
sidebar_markdown = """
|
11 |
|
12 |
-
Note, this demo can classify
|
13 |
|
14 |
## Documentation
|
15 |
๐ [Blog Post](https://www.marqo.ai/blog/search-model-for-fashion)
|
@@ -38,54 +38,26 @@ year = {2024}
|
|
38 |
|
39 |
# List of fashion items
|
40 |
items = [
|
41 |
-
'abaya', 'anorak', 'apron', '
|
42 |
-
'
|
43 |
-
'
|
44 |
-
'
|
45 |
-
'
|
46 |
-
'
|
47 |
-
'
|
48 |
-
'
|
49 |
-
'
|
50 |
-
'
|
51 |
-
'
|
52 |
-
'
|
53 |
-
'
|
54 |
-
'
|
55 |
-
'
|
56 |
-
'
|
57 |
-
'
|
58 |
-
'
|
59 |
-
'helmet', 'hem', 'high heels', 'hoodie', 'hook and eye', 'hose',
|
60 |
-
'hosiery', 'hospital gown', 'houndstooth', 'housecoat', 'jacket',
|
61 |
-
'jeans', 'jersey', 'jewelry', 'jodhpurs', 'jumper', 'jumpsuit', 'kerchief',
|
62 |
-
'khakis', 'kilt', 'kimono', 'kit', 'knickers', 'lab coat', 'lapel',
|
63 |
-
'leather jacket', 'leg warmers', 'leggings', 'leotard', 'life jacket',
|
64 |
-
'lingerie', 'loafers', 'loincloth', 'long johns', 'long underwear',
|
65 |
-
'miniskirt', 'mittens', 'moccasins', 'muffler', 'muumuu', 'neckerchief',
|
66 |
-
'necklace', 'nightgown', 'nightshirt', 'onesies', 'outerwear', 'outfit',
|
67 |
-
'overalls', 'overcoat', 'overshirt', 'pajamas', 'pants',
|
68 |
-
'pantsuit', 'pantyhose', 'parka', 'pea coat', 'peplum', 'petticoat',
|
69 |
-
'pinafore', 'pleat', 'polo shirt', 'poncho',
|
70 |
-
'poodle skirt', 'pullover', 'pumps', 'purse', 'raincoat',
|
71 |
-
'ring', 'robe', 'rugby shirt', 'sandals', 'sari', 'sarong', 'scarf',
|
72 |
-
'scrubs', 'shawl', 'shirt',
|
73 |
-
'shoes', 'shorts', 'shoulder pads', 'shrug', 'singlet', 'skirt',
|
74 |
-
'slacks', 'slip', 'slippers', 'smock', 'snaps', 'sneakers', 'socks',
|
75 |
-
'sombrero', 'spacesuit', 'stockings', 'stole', 'suit',
|
76 |
-
'sun hat', 'sunbonnet', 'sundress', 'sunglasses', 'suspenders',
|
77 |
-
'sweater', 'sweatpants', 'sweatshirt', 'sweatsuit', 'swimsuit',
|
78 |
-
'T-shirt', 'tam', 'tank top', 'threads', 'tiara', 'tie',
|
79 |
-
'tie clip', 'tights', 'toga', 'tog', 'top', 'top coat', 'top hat', 'train',
|
80 |
-
'trench coat', 'trousers', 'trunks', 'tube top', 'turban',
|
81 |
-
'turtleneck', 'turtleneck shirt', 'tutu', 'tuxedo', 'tweed jacket',
|
82 |
-
'twin set', 'umbrella', 'underclothes', 'undershirt',
|
83 |
-
'underwear', 'veil', 'Velcro', 'vest', 'vestments', 'visor',
|
84 |
-
'waders', 'waistcoat', 'wear', 'wedding gown', 'Wellingtons', 'wetsuit',
|
85 |
-
'windbreaker', 'woolens', 'wrap', 'yoke', 'zipper',
|
86 |
-
'zoris', 'jogger', 'palazzo', 'cargo', 'dresspants', 'chinos',
|
87 |
'crop top', 'romper', 'insulated jacket', 'fleece', 'rain jacket',
|
88 |
-
'running jacket', 'graphic top', 'pant', 'legging', 'skort',
|
89 |
'sports bra', 'water shorts', 'cover up', 'goggle', 'glove', 'mitten',
|
90 |
'leg gaiter', 'neck gaiter', 'watch', 'bag', 'swim trunk',
|
91 |
'pocket watch', 'insoles', "climbing shoes",
|
@@ -100,13 +72,13 @@ tokenizer = open_clip.get_tokenizer(model_name)
|
|
100 |
def generate_description(item):
|
101 |
if "Pants" in item or item in ["Leggings", "Jogger", "Cargo", "Chinos", "Palazzo", "Dresspants", "Sweatpants", "Pant", "Legging", "Skort", "Trouser"]:
|
102 |
return f"A pair of {item} pants"
|
103 |
-
elif item in ["Dress", "Blouse", "T-Shirt", "Tank Top", "Sweater", "Cardigan", "Hoodie", "Coat", "Jacket", "Polo Shirt", "Crop Top", "Romper", "Blazer", "Vest", "Bodysuit", "Maxi Dress", "Graphic Top", "Shirt", "Base Layer Top", "Base Layer Bottom", "Swimsuit", "Rashguard", "Cover Up", "
|
104 |
return f"A {item}"
|
105 |
elif item in ["Hat", "Sunglasses", "Glasses", "Sun Hat", "Goggle", "Balaclava"]:
|
106 |
return f"A {item} worn on the head or face"
|
107 |
elif item in ["Shoes", "Sandals", "Heels", "Trainers", "Boots", "Slippers", "Sneakers", "Insoles", "Socks"]:
|
108 |
return f"A pair of {item} worn on the feet"
|
109 |
-
elif item in ["Jeans", "Skirt", "Shorts", "Dungarees", "Poncho", "Overalls", "
|
110 |
return f"A {item} piece of clothing"
|
111 |
elif item in ["Boxing Gloves", "Glove", "Mitten"]:
|
112 |
return f"An item of {item} worn on the hands"
|
|
|
9 |
# Sidebar content
|
10 |
sidebar_markdown = """
|
11 |
|
12 |
+
Note, this demo can classify 200 items. If you didn't find what you're looking for, reach out to us on our [Community](https://join.slack.com/t/marqo-community/shared_invite/zt-2iab0260n-QJrZLUSOJYUifVxf964Gdw) and request an item to be added.
|
13 |
|
14 |
## Documentation
|
15 |
๐ [Blog Post](https://www.marqo.ai/blog/search-model-for-fashion)
|
|
|
38 |
|
39 |
# List of fashion items
|
40 |
items = [
|
41 |
+
'abaya', 'anorak', 'apron', 'ball gown', 'bandanna', 'baseball cap',
|
42 |
+
'beanie', 'belt', 'beret', 'Bermuda shorts', 'baby clothes',
|
43 |
+
'bib', 'bikini', 'blazer', 'blouse', 'boots', 'bow tie', 'boxer shorts', 'boxers', 'bra',
|
44 |
+
'bracelet', 'breeches', 'buckle', 'button', 'camouflage', 'cap', 'cape', 'cardigan', 'cloak', 'clogs',
|
45 |
+
'coat', 'corset', 'costume', 'crown', 'cuff links', 'dress', 'dress shirt', 'dungarees', 'earmuffs',
|
46 |
+
'earrings', 'flannel shirt', 'flip-flops', 'fur coat', 'gilet', 'glasses', 'gloves', 'gown', 'handbag',
|
47 |
+
'hat', 'Hawaiian shirt', 'helmet', 'hijab', 'high heels', 'hoodie', 'hospital gown', 'jacket',
|
48 |
+
'jeans', 'jewelry', 'jumper', 'jumpsuit', 'khakis', 'kilt', 'knickers', 'lab coat',
|
49 |
+
'leather jacket', 'leggings', 'leotard', 'life jacket', 'lingerie', 'loafers',
|
50 |
+
'miniskirt', 'mittens', 'necklace', 'nightgown', 'nightshirt', 'onesies','pajamas', 'pants',
|
51 |
+
'pantsuit', 'pantyhose', 'parka','polo shirt', 'poncho', 'purse', 'raincoat',
|
52 |
+
'ring', 'robe', 'rugby shirt', 'sandals', 'scarf', 'scrubs', 'shirt', 'shoes', 'shorts', 'skirt',
|
53 |
+
'slippers', 'sneakers', 'socks', 'spacesuit', 'stockings', 'stole', 'suit',
|
54 |
+
'sun hat', 'sundress', 'sunglasses', 'suspenders', 'sweater', 'sweatpants', 'sweatshirt', 'swimsuit',
|
55 |
+
'T-shirt', 'tank top', 'tiara', 'tie', 'tie clip', 'tights', 'toga', 'top', 'top coat', 'top hat', 'train',
|
56 |
+
'trench coat', 'trousers', 'trunks', 'tube top', 'turban', 'turtleneck', 'tutu', 'tuxedo', 'umbrella',
|
57 |
+
'veil', 'Velcro', 'vest', 'waistcoat', 'wedding gown', 'wetsuit',
|
58 |
+
'windbreaker', 'jogger', 'palazzo', 'cargo', 'dresspants', 'chinos',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
'crop top', 'romper', 'insulated jacket', 'fleece', 'rain jacket',
|
60 |
+
'running jacket', 'graphic top', 'pant', 'legging', 'skort',
|
61 |
'sports bra', 'water shorts', 'cover up', 'goggle', 'glove', 'mitten',
|
62 |
'leg gaiter', 'neck gaiter', 'watch', 'bag', 'swim trunk',
|
63 |
'pocket watch', 'insoles', "climbing shoes",
|
|
|
72 |
def generate_description(item):
|
73 |
if "Pants" in item or item in ["Leggings", "Jogger", "Cargo", "Chinos", "Palazzo", "Dresspants", "Sweatpants", "Pant", "Legging", "Skort", "Trouser"]:
|
74 |
return f"A pair of {item} pants"
|
75 |
+
elif item in ["Dress", "Blouse", "T-Shirt", "Tank Top", "Sweater", "Cardigan", "Hoodie", "Coat", "Jacket", "Polo Shirt", "Crop Top", "Romper", "Blazer", "Vest", "Bodysuit", "Maxi Dress", "Graphic Top", "Shirt", "Base Layer Top", "Base Layer Bottom", "Swimsuit", "Rashguard", "Cover Up", "Tuxedo"]:
|
76 |
return f"A {item}"
|
77 |
elif item in ["Hat", "Sunglasses", "Glasses", "Sun Hat", "Goggle", "Balaclava"]:
|
78 |
return f"A {item} worn on the head or face"
|
79 |
elif item in ["Shoes", "Sandals", "Heels", "Trainers", "Boots", "Slippers", "Sneakers", "Insoles", "Socks"]:
|
80 |
return f"A pair of {item} worn on the feet"
|
81 |
+
elif item in ["Jeans", "Skirt", "Shorts", "Dungarees", "Poncho", "Overalls", "Boxer", "Swim Trunk", "Ring", "Necklace", "Earing", "Pocket Watch"]:
|
82 |
return f"A {item} piece of clothing"
|
83 |
elif item in ["Boxing Gloves", "Glove", "Mitten"]:
|
84 |
return f"An item of {item} worn on the hands"
|