Views
No views yet

Fashion-Product-articleType is a vision model fine-tuned from google/siglip2-base-patch16-224 using the SiglipForImageClassification architecture. It classifies fashion product images into one of 141 article types.
1Classification Report:
2 precision recall f1-score support
3
4 Accessory Gift Set 0.9898 1.0000 0.9949 97
5 Baby Dolls 0.6667 0.1429 0.2353 14
6 Backpacks 0.9582 0.9503 0.9542 724
7 Bangle 0.8421 0.7529 0.7950 85
8 Basketballs 0.7500 0.9231 0.8276 13
9 Bath Robe 0.8571 0.7059 0.7742 17
10 Beauty Accessory 0.0000 0.0000 0.0000 3
11 Belts 0.9842 0.9938 0.9890 813
12 Blazers 0.8333 0.6250 0.7143 8
13 Body Lotion 1.0000 0.3333 0.5000 3
14 Body Wash and Scrub 0.0000 0.0000 0.0000 1
15 Booties 0.6875 0.9167 0.7857 12
16 Boxers 0.8679 0.8846 0.8762 52
17 Bra 0.9614 0.9916 0.9763 477
18 Bracelet 0.7656 0.7424 0.7538 66
19 Briefs 0.9731 0.9811 0.9771 847
20 Camisoles 0.7500 0.5385 0.6269 39
21 Capris 0.6558 0.8057 0.7231 175
22 Caps 0.9317 0.9647 0.9479 283
23 Casual Shoes 0.8338 0.8643 0.8488 2845
24 Churidar 0.7500 0.5000 0.6000 30
25 Clothing Set 0.7500 0.3750 0.5000 8
26 Clutches 0.8015 0.7431 0.7712 288
27 Compact 0.8864 1.0000 0.9398 39
28 Concealer 0.7143 0.9091 0.8000 11
29 Cufflinks 0.9811 0.9811 0.9811 106
30 Cushion Covers 0.0000 0.0000 0.0000 1
31 Deodorant 0.8946 0.9539 0.9233 347
32 Dresses 0.7956 0.8642 0.8285 464
33 Duffel Bag 0.8947 0.5795 0.7034 88
34 Dupatta 0.9008 0.9397 0.9198 116
35 Earrings 0.9952 0.9880 0.9916 416
36 Eye Cream 1.0000 0.2500 0.4000 4
37 Eyeshadow 0.9062 0.9062 0.9062 32
38 Face Moisturisers 0.5846 0.8085 0.6786 47
39Face Scrub and Exfoliator 0.0000 0.0000 0.0000 4
40 Face Serum and Gel 0.0000 0.0000 0.0000 2
41 Face Wash and Cleanser 0.6667 0.6250 0.6452 16
42 Flats 0.5764 0.2640 0.3621 500
43 Flip Flops 0.8573 0.9464 0.8996 914
44 Footballs 1.0000 0.3750 0.5455 8
45 Formal Shoes 0.8246 0.8932 0.8576 637
46 Foundation and Primer 0.9524 0.8696 0.9091 69
47 Fragrance Gift Set 0.6842 0.9123 0.7820 57
48 Free Gifts 0.9000 0.0989 0.1782 91
49 Gloves 0.9375 0.7500 0.8333 20
50 Hair Accessory 0.0000 0.0000 0.0000 1
51 Hair Colour 0.8636 1.0000 0.9268 19
52 Handbags 0.8840 0.9744 0.9270 1759
53 Hat 0.0000 0.0000 0.0000 3
54 Headband 1.0000 0.5714 0.7273 7
55 Heels 0.7622 0.9206 0.8340 1323
56 Highlighter and Blush 0.9697 0.8421 0.9014 38
57 Innerwear Vests 0.9056 0.8719 0.8884 242
58 Ipad 0.0000 0.0000 0.0000 1
59 Jackets 0.7950 0.6163 0.6943 258
60 Jeans 0.8118 0.9385 0.8706 602
61 Jeggings 1.0000 0.0882 0.1622 34
62 Jewellery Set 0.9333 0.9655 0.9492 58
63 Jumpsuit 0.0000 0.0000 0.0000 16
64 Kajal and Eyeliner 0.7241 0.8936 0.8000 94
65 Key chain 0.0000 0.0000 0.0000 2
66 Kurta Sets 0.8774 0.9894 0.9300 94
67 Kurtas 0.9348 0.9414 0.9381 1844
68 Kurtis 0.5000 0.5427 0.5205 234
69 Laptop Bag 0.6338 0.5488 0.5882 82
70 Leggings 0.7590 0.8362 0.7957 177
71 Lehenga Choli 0.0000 0.0000 0.0000 4
72 Lip Care 0.8000 0.5714 0.6667 7
73 Lip Gloss 0.8718 0.9358 0.9027 109
74 Lip Liner 0.8846 0.5111 0.6479 45
75 Lip Plumper 1.0000 0.5000 0.6667 4
76 Lipstick 0.9660 0.9846 0.9752 260
77 Lounge Pants 0.7727 0.2787 0.4096 61
78 Lounge Shorts 1.0000 0.1176 0.2105 34
79 Lounge Tshirts 0.5000 0.6667 0.5714 3
80 Makeup Remover 0.0000 0.0000 0.0000 2
81 Mascara 0.6000 0.5000 0.5455 12
82 Mask and Peel 0.7778 0.7000 0.7368 10
83 Mens Grooming Kit 0.0000 0.0000 0.0000 1
84 Messenger Bag 0.6818 0.3409 0.4545 44
85 Mobile Pouch 0.5714 0.5106 0.5393 47
86 Mufflers 0.8056 0.7632 0.7838 38
87 Nail Essentials 1.0000 0.5000 0.6667 6
88 Nail Polish 0.9928 0.9964 0.9946 278
89 Necklace and Chains 0.9375 0.9375 0.9375 160
90 Nehru Jackets 0.0000 0.0000 0.0000 5
91 Night suits 0.8792 0.9291 0.9034 141
92 Nightdress 0.7730 0.7606 0.7668 188
93 Patiala 1.0000 0.7368 0.8485 38
94 Pendant 0.9181 0.8920 0.9049 176
95 Perfume and Body Mist 0.9463 0.9055 0.9254 603
96 Rain Jacket 0.0000 0.0000 0.0000 7
97 Ring 0.8952 0.9407 0.9174 118
98 Robe 0.0000 0.0000 0.0000 4
99 Rompers 1.0000 1.0000 1.0000 12
100 Rucksacks 0.7143 0.4545 0.5556 11
101 Salwar 0.6122 0.9375 0.7407 32
102 Salwar and Dupatta 1.0000 0.8571 0.9231 7
103 Sandals 0.8618 0.8291 0.8451 895
104 Sarees 0.9660 0.9977 0.9816 427
105 Scarves 0.8333 0.7983 0.8155 119
106 Shapewear 0.2500 0.1111 0.1538 9
107 Shirts 0.9360 0.9614 0.9485 3212
108 Shoe Accessories 0.0000 0.0000 0.0000 3
109 Shoe Laces 0.0000 0.0000 0.0000 1
110 Shorts 0.8986 0.9232 0.9107 547
111 Shrug 0.0000 0.0000 0.0000 6
112 Skirts 0.8293 0.7969 0.8127 128
113 Socks 0.9869 0.9883 0.9876 686
114 Sports Sandals 0.6111 0.1642 0.2588 67
115 Sports Shoes 0.8880 0.8100 0.8472 2016
116 Stockings 0.8824 0.9375 0.9091 32
117 Stoles 0.8690 0.8111 0.8391 90
118 Sunglasses 0.9898 0.9991 0.9944 1073
119 Sunscreen 1.0000 0.7333 0.8462 15
120 Suspenders 1.0000 1.0000 1.0000 40
121 Sweaters 0.7488 0.5812 0.6545 277
122 Sweatshirts 0.6348 0.7930 0.7051 285
123 Swimwear 0.9000 0.5294 0.6667 17
124 Tablet Sleeve 0.0000 0.0000 0.0000 3
125 Ties 1.0000 0.9886 0.9943 263
126 Ties and Cufflinks 0.0000 0.0000 0.0000 2
127 Tights 1.0000 0.3333 0.5000 9
128 Toner 0.0000 0.0000 0.0000 2
129 Tops 0.7591 0.7208 0.7394 1762
130 Track Pants 0.8537 0.8257 0.8395 304
131 Tracksuits 0.8750 0.9655 0.9180 29
132 Travel Accessory 1.0000 0.1875 0.3158 16
133 Trolley Bag 0.0000 0.0000 0.0000 3
134 Trousers 0.9428 0.8396 0.8882 530
135 Trunk 0.8819 0.9071 0.8944 140
136 Tshirts 0.9273 0.9580 0.9424 7065
137 Tunics 0.6129 0.1659 0.2612 229
138 Umbrellas 1.0000 1.0000 1.0000 6
139 Waist Pouch 1.0000 0.1176 0.2105 17
140 Waistcoat 1.0000 0.2667 0.4211 15
141 Wallets 0.9491 0.9235 0.9361 928
142 Watches 0.9817 0.9929 0.9873 2542
143 Water Bottle 1.0000 0.8182 0.9000 11
144 Wristbands 0.8571 0.8571 0.8571 7
145
146 accuracy 0.8911 44072
147 macro avg 0.7131 0.6174 0.6361 44072
148 weighted avg 0.8877 0.8911 0.8846 44072pip install -q transformers torch pillow gradio1import gradio as gr
2from transformers import AutoImageProcessor, SiglipForImageClassification
3from PIL import Image
4import torch
5
6# Load model and processor
7model_name = "prithivMLmods/Fashion-Product-articleType" # Replace with your actual model path
8model = SiglipForImageClassification.from_pretrained(model_name)
9processor = AutoImageProcessor.from_pretrained(model_name)
10
11# Label mapping
12id2label = {
13 0: "Accessory Gift Set",
14 1: "Baby Dolls",
15 2: "Backpacks",
16 3: "Bangle",
17 4: "Basketballs",
18 5: "Bath Robe",
19 6: "Beauty Accessory",
20 7: "Belts",
21 8: "Blazers",
22 9: "Body Lotion",
23 10: "Body Wash and Scrub",
24 11: "Booties",
25 12: "Boxers",
26 13: "Bra",
27 14: "Bracelet",
28 15: "Briefs",
29 16: "Camisoles",
30 17: "Capris",
31 18: "Caps",
32 19: "Casual Shoes",
33 20: "Churidar",
34 21: "Clothing Set",
35 22: "Clutches",
36 23: "Compact",
37 24: "Concealer",
38 25: "Cufflinks",
39 26: "Cushion Covers",
40 27: "Deodorant",
41 28: "Dresses",
42 29: "Duffel Bag",
43 30: "Dupatta",
44 31: "Earrings",
45 32: "Eye Cream",
46 33: "Eyeshadow",
47 34: "Face Moisturisers",
48 35: "Face Scrub and Exfoliator",
49 36: "Face Serum and Gel",
50 37: "Face Wash and Cleanser",
51 38: "Flats",
52 39: "Flip Flops",
53 40: "Footballs",
54 41: "Formal Shoes",
55 42: "Foundation and Primer",
56 43: "Fragrance Gift Set",
57 44: "Free Gifts",
58 45: "Gloves",
59 46: "Hair Accessory",
60 47: "Hair Colour",
61 48: "Handbags",
62 49: "Hat",
63 50: "Headband",
64 51: "Heels",
65 52: "Highlighter and Blush",
66 53: "Innerwear Vests",
67 54: "Ipad",
68 55: "Jackets",
69 56: "Jeans",
70 57: "Jeggings",
71 58: "Jewellery Set",
72 59: "Jumpsuit",
73 60: "Kajal and Eyeliner",
74 61: "Key chain",
75 62: "Kurta Sets",
76 63: "Kurtas",
77 64: "Kurtis",
78 65: "Laptop Bag",
79 66: "Leggings",
80 67: "Lehenga Choli",
81 68: "Lip Care",
82 69: "Lip Gloss",
83 70: "Lip Liner",
84 71: "Lip Plumper",
85 72: "Lipstick",
86 73: "Lounge Pants",
87 74: "Lounge Shorts",
88 75: "Lounge Tshirts",
89 76: "Makeup Remover",
90 77: "Mascara",
91 78: "Mask and Peel",
92 79: "Mens Grooming Kit",
93 80: "Messenger Bag",
94 81: "Mobile Pouch",
95 82: "Mufflers",
96 83: "Nail Essentials",
97 84: "Nail Polish",
98 85: "Necklace and Chains",
99 86: "Nehru Jackets",
100 87: "Night suits",
101 88: "Nightdress",
102 89: "Patiala",
103 90: "Pendant",
104 91: "Perfume and Body Mist",
105 92: "Rain Jacket",
106 93: "Ring",
107 94: "Robe",
108 95: "Rompers",
109 96: "Rucksacks",
110 97: "Salwar",
111 98: "Salwar and Dupatta",
112 99: "Sandals",
113 100: "Sarees",
114 101: "Scarves",
115 102: "Shapewear",
116 103: "Shirts",
117 104: "Shoe Accessories",
118 105: "Shoe Laces",
119 106: "Shorts",
120 107: "Shrug",
121 108: "Skirts",
122 109: "Socks",
123 110: "Sports Sandals",
124 111: "Sports Shoes",
125 112: "Stockings",
126 113: "Stoles",
127 114: "Sunglasses",
128 115: "Sunscreen",
129 116: "Suspenders",
130 117: "Sweaters",
131 118: "Sweatshirts",
132 119: "Swimwear",
133 120: "Tablet Sleeve",
134 121: "Ties",
135 122: "Ties and Cufflinks",
136 123: "Tights",
137 124: "Toner",
138 125: "Tops",
139 126: "Track Pants",
140 127: "Tracksuits",
141 128: "Travel Accessory",
142 129: "Trolley Bag",
143 130: "Trousers",
144 131: "Trunk",
145 132: "Tshirts",
146 133: "Tunics",
147 134: "Umbrellas",
148 135: "Waist Pouch",
149 136: "Waistcoat",
150 137: "Wallets",
151 138: "Watches",
152 139: "Water Bottle",
153 140: "Wristbands"
154}
155
156def classify_article_type(image):
157 """Predicts the article type for a fashion product."""
158 image = Image.fromarray(image).convert("RGB")
159 inputs = processor(images=image, return_tensors="pt")
160
161 with torch.no_grad():
162 outputs = model(**inputs)
163 logits = outputs.logits
164 probs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist()
165
166 predictions = {id2label[i]: round(probs[i], 3) for i in range(len(probs))}
167 return predictions
168
169# Gradio interface
170iface = gr.Interface(
171 fn=classify_article_type,
172 inputs=gr.Image(type="numpy"),
173 outputs=gr.Label(label="Article Type Prediction Scores"),
174 title="Fashion-Product-articleType",
175 description="Upload a fashion product image to predict its article type (e.g., T-shirt, Jeans, Handbag, etc)."
176)
177
178# Launch the app
179if __name__ == "__main__":
180 iface.launch()