|
--- |
|
tags: |
|
- image-classification |
|
library_name: wildlife-datasets |
|
license: cc-by-nc-4.0 |
|
--- |
|
# Model card |
|
|
|
A DINOv2 based image feature model. Supervisely pre-trained on animal re-identification datasets. |
|
Original model: timm/vit_large_patch14_dinov2.lvd142m |
|
|
|
## Model Details |
|
- **Model Type:** Animal re-identification / feature backbone |
|
- **Model Stats:** |
|
- Params (M): 304.4 |
|
- GMACs: 507.1 |
|
- Activations (M): 1058.8 |
|
- Image size: 518 x 518 |
|
|
|
## Model Usage |
|
### Image Embeddings |
|
```python |
|
|
|
import timm |
|
import torch |
|
import torchvision.transforms as T |
|
|
|
from PIL import Image |
|
from urllib.request import urlopen |
|
|
|
model = timm.create_model("hf-hub:BVRA/MegaDescriptor-DINOv2-518", pretrained=True) |
|
model = model.eval() |
|
|
|
transforms = T.Compose([T.Resize(518), |
|
T.ToTensor(), |
|
T.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])]) |
|
|
|
img = Image.open(urlopen( |
|
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png' |
|
)) |
|
|
|
output = model(transforms(img).unsqueeze(0)) # output is (batch_size, num_features) shaped tensor |
|
# output is a (1, num_features) shaped tensor |
|
``` |
|
|
|
## Citation |
|
|
|
```bibtex |
|
@inproceedings{vcermak2024wildlifedatasets, |
|
title={WildlifeDatasets: An open-source toolkit for animal re-identification}, |
|
author={{\v{C}}erm{\'a}k, Vojt{\v{e}}ch and Picek, Lukas and Adam, Luk{\'a}{\v{s}} and Papafitsoros, Kostas}, |
|
booktitle={Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision}, |
|
pages={5953--5963}, |
|
year={2024} |
|
} |
|
``` |
|
|