File size: 757 Bytes
d6ffe98
 
7c31400
 
 
d6ffe98
 
 
 
 
d73f262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
license: gpl-3.0
base_model:
- microsoft/resnet-50
library_name: transformers
---
# cat2vec

The cat2vec model is a search model for cats.

It was trained using the [Labeled Cats In The Wild dataset](https://www.kaggle.com/datasets/dseidli/lcwlabeled-cats-in-the-wild) and a triplet loss.


# Usage

```python
from transformers import AutoImageProcessor, ResNetModel
import torch
from datasets import load_dataset

dataset = load_dataset("huggingface/cats-image")
image = dataset["test"]["image"][:2]

processor = AutoImageProcessor.from_pretrained("microsoft/resnet-50")
model = ResNetModel.from_pretrained("microsoft/resnet-50")

inputs = processor(image, return_tensors="pt")

with torch.no_grad():
    features = model(**inputs)

print(features)
```