Tasks

Image Feature Extraction

Image feature extraction is the task of extracting features learnt in a computer vision model.

Inputs
Image Feature Extraction Model
Output
Dimension 1 Dimension 2 Dimension 3
0.21236686408519745 1.0919708013534546 0.8512550592422485
0.809657871723175 -0.18544459342956543 -0.7851548194885254
1.3103108406066895 -0.2479034662246704 -0.9107287526130676
1.8536205291748047 -0.36419737339019775 0.09717650711536407

About Image Feature Extraction

Use Cases

Transfer Learning

Models trained on a specific dataset can learn features about the data. For instance, a model trained on a car classification dataset learns to recognize edges and curves on a very high level and car-specific features on a low level. This information can be transferred to a new model that is going to be trained on classifying trucks. This process of extracting features and transferring to another model is called transfer learning.

Similarity

Features extracted from models contain semantically meaningful information about the world. These features can be used to detect the similarity between two images. Assume there are two images: a photo of a stray cat in a street setting and a photo of a cat at home. These images both contain cats, and the features will contain the information that there's a cat in the image. Thus, comparing the features of a stray cat photo to the features of a domestic cat photo will result in higher similarity compared to any other image that doesn't contain any cats.

Inference

import torch
from transformers import pipeline

pipe = pipeline(task="image-feature-extraction", model_name="google/vit-base-patch16-384", framework="pt", pool=True)
pipe("https://huggingface.co./datasets/huggingface/documentation-images/resolve/main/cats.png")

feature_extractor(text,return_tensors = "pt")[0].numpy().mean(axis=0)

'[[[0.21236686408519745, 1.0919708013534546, 0.8512550592422485, ...]]]'

Compatible libraries

Image Feature Extraction demo

No example widget is defined for this task.

Note Contribute by proposing a widget for this task !

Models for Image Feature Extraction
Browse Models (476)

Note Strong image feature extraction model made for information retrieval from documents.

Note Strong image feature extraction model that can be used on images and documents.

Datasets for Image Feature Extraction
Browse Datasets (100)

No example dataset is defined for this task.

Note Contribute by proposing a dataset for this task !

Spaces using Image Feature Extraction

No example Space is defined for this task.

Note Contribute by proposing a Space for this task !

Metrics for Image Feature Extraction

No example metric is defined for this task.

Note Contribute by proposing a metric for this task !