Run this model with HF Jobs

Run facebook/levit-128S on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/facebook/levit-128S. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/facebook/levit-128S on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

LeViT

LeViT-128S model pre-trained on ImageNet-1k at resolution 224x224. It was introduced in the paper LeViT: a Vision Transformer in ConvNet's Clothing for Faster Inference by Graham et al. and first released in this repository.

Disclaimer: The team releasing LeViT did not write a model card for this model so this model card has been written by the Hugging Face team.

Usage

Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:

from transformers import LevitFeatureExtractor, LevitForImageClassificationWithTeacher
from PIL import Image
import requests

url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
image = Image.open(requests.get(url, stream=True).raw)

feature_extractor = LevitFeatureExtractor.from_pretrained('facebook/levit-128S')
model = LevitForImageClassificationWithTeacher.from_pretrained('facebook/levit-128S')

inputs = feature_extractor(images=image, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
# model predicts one of the 1000 ImageNet classes
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])
Downloads last month
5,003
Safetensors
Model size
7.91M params
Tensor type
I64
Β·
F32
Β·
Inference Providers NEW

Model tree for facebook/levit-128S

Finetunes
1 model

Dataset used to train facebook/levit-128S

Spaces using facebook/levit-128S 2

Paper for facebook/levit-128S