Views
No views yet
masterCategory labels from the Fashion Product Images (small) dataset.| Item | Detail |
|---|---|
| Base checkpoint | google/vit-base-patch16-224-in21k |
| Task | Multi-class image classification (4 classes) |
| Labels | Apparel, Accessories, Footwear, Personal Care |
| Input | RGB images, 224×224 (use the bundled ViTImageProcessor / AutoImageProcessor) |
| Framework | PyTorch + Transformers |
Pipeline_1_fine_tuning_models.ipynb:ashraq/fashion-product-images-small (train split), rows with masterCategory in the four classes above.random_state=5 (SEED = 5):
google/vit-base-patch16-224-in21k, facebook/deit-tiny-patch16-224, google/mobilenet_v2_1.0_224.| Model | Test accuracy | Runtime (s / image) |
|---|---|---|
google/vit-base-patch16-224-in21k | 0.9975 | 0.000953 |
facebook/deit-tiny-patch16-224 | 0.9950 | 0.000886 |
google/mobilenet_v2_1.0_224 | 0.9375 | 0.001365 |
google/vit-base-patch16-224-in21k (accuracy 1.0000 on this test split).Note: Perfect accuracy on 400 samples does not guarantee generalization to all real-world product photos. Performance depends on image quality, viewpoint, and domain shift relative to the dataset.
masterCategory values for a class-balanced setup; other categories from the original catalog are not represented.1from transformers import AutoImageProcessor, AutoModelForImageClassification
2from PIL import Image
3import requests
4
5model_id = "Leoinhouse/ImagineClassification-finetuned-model" # or local path
6processor = AutoImageProcessor.from_pretrained(model_id)
7model = AutoModelForImageClassification.from_pretrained(model_id)
8
9image = Image.open(requests.get("https://example.com/product.jpg", stream=True).raw).convert("RGB")
10inputs = processor(images=image, return_tensors="pt")
11outputs = model(**inputs)
12predicted_id = outputs.logits.argmax(-1).item()
13label = model.config.id2label[predicted_id]
14print(label)1@inproceedings{wolf-etal-2020-transformers,
2 title={Transformers: State-of-the-Art Natural Language Processing},
3 author={Wolf, Thomas and others},
4 booktitle={EMNLP 2020: System Demonstrations},
5 year={2020}
6}google/vit-base-patch16-224-in21k.