BVRA
/

picekl's picture
Create README.md
4221c4c
|
raw
history blame
1.38 kB
metadata
tags:
  - image-classification
  - ecology
  - animals
  - re-identification
library_name: wildlife-datasets
license: cc-by-nc-4.0

Model card for MegaDescriptor-B-224

A Swin-L image feature model. Superwisely pre-trained on animal re-identification datasets.

Model Details

  • Model Type: Animal re-identification / feature backbone
  • Model Stats:
    • Params (M): ??
    • Image size: 384 x 384
  • Papers:
  • Original: ??
  • Pretrain Dataset: All available re-identification datasets --> TBD

Model Usage

Image Embeddings


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/wildlife-mega", pretrained=True)
model = model.eval()

train_transforms = T.Compose([T.Resize(224), 
                              T.ToTensor(), 
                              T.Normalize([0.5, 0.5, 0.5], [0.5, 0.5, 0.5])]) 

img = Image.open(urlopen(
    'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))

output = model(train_transforms(img).unsqueeze(0))  # output is (batch_size, num_features) shaped tensor
# output is a (1, num_features) shaped tensor

Citation

TBD