Run this model with HF Jobs
Run amaye15/aimv2-large-patch14-native-image-classification 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/amaye15/aimv2-large-patch14-native-image-classification. 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/amaye15/aimv2-large-patch14-native-image-classification 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.
Instructions to use amaye15/aimv2-large-patch14-native-image-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amaye15/aimv2-large-patch14-native-image-classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="amaye15/aimv2-large-patch14-native-image-classification", trust_remote_code=True) pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForImageClassification processor = AutoProcessor.from_pretrained("amaye15/aimv2-large-patch14-native-image-classification", trust_remote_code=True) model = AutoModelForImageClassification.from_pretrained("amaye15/aimv2-large-patch14-native-image-classification", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoProcessor, AutoModelForImageClassification
processor = AutoProcessor.from_pretrained("amaye15/aimv2-large-patch14-native-image-classification", trust_remote_code=True)
model = AutoModelForImageClassification.from_pretrained("amaye15/aimv2-large-patch14-native-image-classification", trust_remote_code=True, device_map="auto")AIMv2-Large-Patch14-Native Image Classification
This repository contains an adapted version of the original AIMv2 model, modified to be compatible with the AutoModelForImageClassification class from Hugging Face Transformers. This adaptation enables seamless use of the model for image classification tasks.
This model has not been trained/fine-tuned
Introduction
We have adapted the original apple/aimv2-large-patch14-native model to work with AutoModelForImageClassification. The AIMv2 family consists of vision models pre-trained with a multimodal autoregressive objective, offering robust performance across various benchmarks.
Some highlights of the AIMv2 models include:
- Outperforming OAI CLIP and SigLIP on the majority of multimodal understanding benchmarks.
- Surpassing DINOv2 in open-vocabulary object detection and referring expression comprehension.
- Demonstrating strong recognition performance, with AIMv2-3B achieving 89.5% on ImageNet using a frozen trunk.
Usage
PyTorch
import requests
from PIL import Image
from transformers import AutoImageProcessor, AutoModelForImageClassification
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
processor = AutoImageProcessor.from_pretrained(
"amaye15/aimv2-large-patch14-native-image-classification",
)
model = AutoModelForImageClassification.from_pretrained(
"amaye15/aimv2-large-patch14-native-image-classification",
trust_remote_code=True,
)
inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
# Get predicted class
predictions = outputs.logits.softmax(dim=-1)
predicted_class = predictions.argmax(-1).item()
print(f"Predicted class: {model.config.id2label[predicted_class]}")
Model Details
- Model Name:
amaye15/aimv2-large-patch14-native-image-classification - Original Model:
apple/aimv2-large-patch14-native - Adaptation: Modified to be compatible with
AutoModelForImageClassificationfor direct use in image classification tasks. - Framework: PyTorch
Citation
If you use this model or find it helpful, please consider citing the original AIMv2 paper:
@article{yang2023aimv2,
title={AIMv2: Advances in Multimodal Vision Models},
author={Yang, Li and others},
journal={arXiv preprint arXiv:2411.14402},
year={2023}
}
- Downloads last month
- 60
Model tree for amaye15/aimv2-large-patch14-native-image-classification
Base model
apple/aimv2-large-patch14-native
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="amaye15/aimv2-large-patch14-native-image-classification", trust_remote_code=True) pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")