/ Модель

Характеристики

Параметры
33 млн
Лицензия
CC BY-NC 4.0
Архитектура
hiera · dense
Библиотека
transformers
Опубликована
12 мая 2024

hiera-small-224-hf

Эмбеддинги изображений3 профессии

Компактный визуальный трансформер Hiera извлекает признаки из изображений для задач компьютерного зрения.

53скачиваний за 30 дней0лайковвеса обновлены20 июн 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

facebook/hiera-small-224-hf — модель визуального энкодера Hiera, разработанная Meta и представленная в исследовании Hiera: A Hierarchical Vision Transformer without the Bells-and-Whistles. Это компактный иерархический Vision Transformer примерно с 33 млн параметров, дообученный на ImageNet-1K и предназначенный прежде всего для извлечения признаков из изображений. Модель принимает изображение и формирует его векторное представление для последующего использования в компьютерном зрении.

Hiera использует иерархическую архитектуру, постепенно уменьшающую пространственное разрешение и меняющую число признаков по слоям. Авторы описывают её как более простую и эффективную альтернативу ряду специализированных визуальных трансформеров; семейство также применяется для классификации изображений и распознавания видео, но данный чекпойнт позиционируется именно как экстрактор признаков. Для работы в Transformers указан формат safetensors. Карточка не сообщает длину контекста, что для этой модели не является типичной характеристикой.

Чекпойнт подходит для построения визуальных эмбеддингов и как компонент последующих задач компьютерного зрения. Карточка не приводит подробных ограничений качества или оценки на конкретных сценариях. Лицензия CC BY-NC 4.0 разрешает использование с указанием авторства, но ограничивает коммерческое применение.

Сценарии применения

  • извлечение признаков и эмбеддингов из изображений
  • подготовка визуальных признаков для последующей классификации
  • использование визуального энкодера в конвейере компьютерного зрения

Ограничения

Этот чекпойнт предназначен для извлечения признаков, а не для непосредственной генерации текста или изображений. Лицензия CC BY-NC 4.0 ограничивает коммерческое использование.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Hiera Model (Tiny, fine-tuned on IN1K)

Hiera is a hierarchical vision transformer that is fast, powerful, and, above all, simple. It was introduced in the paper Hiera: A Hierarchical Vision Transformer without the Bells-and-Whistles and outperforms the state-of-the-art across a wide array of image and video tasks while being much faster.

How does it work?

A diagram of Hiera's architecture.

Vision transformers like ViT use the same spatial resolution and number of features throughout the whole network. But this is inefficient: the early layers don't need that many features, and the later layers don't need that much spatial resolution. Prior hierarchical models like ResNet accounted for this by using fewer features at the start and less spatial resolution at the end.

Several domain specific vision transformers have been introduced that employ this hierarchical design, such as Swin or MViT. But in the pursuit of state-of-the-art results using fully supervised training on ImageNet-1K, these models have become more and more complicated as they add specialized modules to make up for spatial biases that ViTs lack. While these changes produce effective models with attractive FLOP counts, under the hood the added complexity makes these models slower overall.

We show that a lot of this bulk is actually unnecessary. Instead of manually adding spatial bases through architectural changes, we opt to teach the model these biases instead. By training with MAE, we can simplify or remove all of these bulky modules in existing transformers and increase accuracy in the process. The result is Hiera, an extremely efficient and simple architecture that outperforms the state-of-the-art in several image and video recognition tasks.

Intended uses & limitations

Hiera can be used for image classification, feature extraction or masked image modeling. This checkpoint in specific is intended for Feature Extraction.

How to use

from transformers import AutoImageProcessor, HieraModel
import torch
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("facebook/hiera-small-224-hf")
model = HieraModel.from_pretrained("facebook/hiera-small-224-hf")

inputs = image_processor(images=image, return_tensors="pt")
outputs = model(**inputs)

You can also extract feature maps from different stages of the model using HieraBackbone and setting out_features when loading the model. This is how you would extract feature maps from every stage:

from transformers import AutoImageProcessor, HieraBackbone
import torch
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("facebook/hiera-small-224-hf")
# `out_features` should be a subset of ['stem', 'stage1', 'stage2', 'stage3', 'stage4']
# This introduce new LayerNorm layers and should probably train on a down-stream task
model = HieraBackbone.from_pretrained("facebook/hiera-small-224-hf", out_features=['stage1', 'stage2', 'stage3', 'stage4'])

inputs = image_processor(images=image, return_tensors="pt")
outputs = model(**inputs)
feature_maps = outputs.feature_maps

BibTeX entry and citation info

If you use Hiera or this code in your work, please cite:

@article{ryali2023hiera,
  title={Hiera: A Hierarchical Vision Transformer without the Bells-and-Whistles},
  author={Ryali, Chaitanya and Hu, Yuan-Ting and Bolya, Daniel and Wei, Chen and Fan, Haoqi and Huang, Po-Yao and Aggarwal, Vaibhav and Chowdhury, Arkabandhu and Poursaeed, Omid and Hoffman, Judy and Malik, Jitendra and Li, Yanghao and Feichtenhofer, Christoph},
  journal={ICML},
  year={2023}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · image-feature-extraction

Можно запустить

Подбираем GPU…

Класс архитектуры
HieraModel
Ревизия весов
b0fb0d7

0 моделей