Instructions to use khayreali/vit-base-ecommerce-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use khayreali/vit-base-ecommerce-classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="khayreali/vit-base-ecommerce-classification") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("khayreali/vit-base-ecommerce-classification") model = AutoModelForImageClassification.from_pretrained("khayreali/vit-base-ecommerce-classification") - Notebooks
- Google Colab
- Kaggle
E-commerce Classification Model
This model is a fine-tuned version of google/vit-base-patch16-224.
The training and evaluation data consists of product images scraped from e-commerce websites across 50 e-commerce categories. The data was then split into a training set (80%) and a test set (20%). During preprocessing, each image was converted to RGB and resized to 224x224 pixels.
See below to get started:
from transformers import AutoImageProcessor, AutoModelForImageClassification
from PIL import Image
model = AutoModelForImageClassification.from_pretrained("khayreali/vit-base-ecommerce-classification")
processor = AutoImageProcessor.from_pretrained("khayreali/vit-base-ecommerce-classification")
clf = pipeline('image-classification',
model=model,
image_processor=processor)
test_img = Image.open('IMAGE')
result = clf(test_img)
# Top predicted category
print(result[0]['label'])
- Downloads last month
- -
Model tree for khayreali/vit-base-ecommerce-classification
Base model
google/vit-base-patch16-224