Views
No views yet
| Category | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| Fashion | 0.97 | 0.99 | 0.98 | 35,880 |
| Jewelry | 0.95 | 0.97 | 0.96 | 2,474 |
| Baby & Kids | 0.91 | 0.88 | 0.90 | 2,511 |
| Consumer Electronics | 0.91 | 0.83 | 0.87 | 1,599 |
| Lights | 0.90 | 0.92 | 0.91 | 3,504 |
| Others | 0.90 | 0.68 | 0.77 | 1,930 |
| Beauty & Personal Care | 0.85 | 0.85 | 0.85 | 1,354 |
| Home & Interior | 0.81 | 0.89 | 0.85 | 6,006 |
| Sports & Fitness Equipment | 0.80 | 0.61 | 0.69 | 727 |
| Outdoor, Garden & Adventure Gear | 0.79 | 0.72 | 0.76 | 1,962 |
| Health & Supplements | 0.74 | 0.56 | 0.64 | 1,240 |
| Hobbies & Collectibles | 0.64 | 0.57 | 0.61 | 435 |
| Office Supplies | 0.51 | 0.45 | 0.48 | 153 |
| Food & Beverages | 0.00 | 0.00 | 0.00 | 14 |
1from huggingface_hub import hf_hub_download
2from transformers import AutoTokenizer, AutoProcessor, SiglipModel
3import torch
4from PIL import Image
5import json
6from model_arch import MultimodalClassifier
7
8# Download model and config from Hugging Face
9repo_id = "manavbangotra/sinc-v1-siglip2-kee-speed-small" # Replace with your repo
10model_path = hf_hub_download(repo_id=repo_id, filename="best_multimodal.pt")
11config_path = hf_hub_download(repo_id=repo_id, filename="config.json")
12
13# Load configuration
14with open(config_path) as f:
15 config = json.load(f)
16
17labels = config["labels"]
18num_labels = config["num_labels"]
19
20# Load model components
21tokenizer = AutoTokenizer.from_pretrained("microsoft/deberta-v3-small")
22processor = AutoProcessor.from_pretrained("google/siglip2-base-patch16-256")
23clip_model = SiglipModel.from_pretrained("google/siglip2-base-patch16-256")
24
25model = MultimodalClassifier("microsoft/deberta-v3-small", clip_model, num_labels, text_finetune=True, clip_finetune=False)
26#Use cuda if available
27model.load_state_dict(torch.load(model_path, map_location="cpu"))
28
29# Example usage
30text = "Elegant summer dress with floral pattern"
31image = Image.open("product_image.jpg")
32
33text_inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=64)
34image_inputs = processor(images=image, return_tensors="pt")
35
36# Predict
37with torch.no_grad():
38 outputs = model(
39 input_ids=text_inputs["input_ids"],
40 attention_mask=text_inputs["attention_mask"],
41 pixel_values=image_inputs["pixel_values"]
42 )
43 predictions = torch.softmax(outputs["logits"], dim=-1)
44 predicted_class = torch.argmax(predictions, dim=-1).item()
45 confidence = predictions[0][predicted_class].item()
46
47print(f"Predicted: {labels[predicted_class]} ({confidence:.2%})")1@misc{sinc-v1-siglip2-kee-speed-small,
2 title={SINC-V1-SIGLIP2-KEE-SPEED-small: High-Performance Multimodal Product Classifier},
3 author={Manav Bangotra},
4 year={2025},
5 url={https://huggingface.co/manavbangotra/sinc-v1-siglip2-kee-speed-small}
6}