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
Update README.md
Browse files1231234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677---
license: mit
------license: mitbase_model:- apple/aimv2-large-patch14-nativepipeline_tag: image-classificationtags:- image-classification- vision---
# AIMv2-Large-Patch14-Native Image Classification
[Original AIMv2 Paper](https://arxiv.org/abs/2411.14402) | [BibTeX](#citation)
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.
## 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:
1. Outperforming OAI CLIP and SigLIP on the majority of multimodal understanding benchmarks.2. Surpassing DINOv2 in open-vocabulary object detection and referring expression comprehension.3. Demonstrating strong recognition performance, with AIMv2-3B achieving **89.5% on ImageNet using a frozen trunk**.
## Usage
### PyTorch
```pythonimport requestsfrom PIL import Imagefrom 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 classpredictions = 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 `AutoModelForImageClassification` for direct use in image classification tasks.- **Framework**: PyTorch- **License**: [Specify license if applicable]
## Citation
If you use this model or find it helpful, please consider citing the original AIMv2 paper:
```bibtex@article{yang2023aimv2, title={AIMv2: Advances in Multimodal Vision Models}, author={Yang, Li and others}, journal={arXiv preprint arXiv:2411.14402}, year={2023}}```README.md+77-3