Instructions to use aeth0r/cat2vec with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aeth0r/cat2vec with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="aeth0r/cat2vec")# Load model directly from transformers import AutoImageProcessor, AutoModel processor = AutoImageProcessor.from_pretrained("aeth0r/cat2vec") model = AutoModel.from_pretrained("aeth0r/cat2vec", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| 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("aeth0r/cat2vec") | |
| inputs = processor(image, return_tensors="pt") | |
| with torch.no_grad(): | |
| features = model(**inputs) | |
| print(features) | |
| ``` |