Run this model with HF Jobs
Run amaye15/DaViT 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/DaViT. 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/DaViT 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/DaViT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amaye15/DaViT with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("amaye15/DaViT", device_map="auto") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
DaViT Model
This repository contains the implementation of the DaViT (Dual-Attention Vision Transformer) model for image classification tasks. The model leverages dual attention mechanisms to improve performance on various image datasets.
Model Description
DaViT (Dual-Attention Vision Transformer) is designed to handle image classification tasks effectively. It combines spatial and channel attention mechanisms to capture intricate details in images. The model has multiple stages, each with convolutional embeddings and attention blocks.
Example
Here is an example of how to use the DaViT model for image classification:
import torch
from transformers import AutoModel, AutoConfig
# Load the configuration and model
config = AutoConfig.from_pretrained("your-username/DaViT")
model = AutoModel.from_pretrained("your-username/DaViT")
# Generate a random sample input tensor with shape (batch_size, channels, height, width)
batch_size = 2
channels = 3
height = 224
width = 224
sample_input = torch.randn(batch_size, channels, height, width)
# Pass the sample input through the model
output = model(sample_input)
# Print the output shape
print(f"Output shape: {output.shape}")
Files
configuration_davit.py: Contains theDaViTConfigclass.modeling_davit.py: Contains theDaViTModelclass.test_davit_model.py: Script to test the model.config.json: Configuration file for the model.model.safetensors: Pretrained weights of the DaViT model.
Credits
This model is inspired by and builds upon the ideas presented in the Florence-2-large model by Microsoft.
- Downloads last month
- 17