/ Модель

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

Контекст
16 токенов
Лицензия
Apache 2.0
Архитектура
owlvit · dense
Опубликована
5 июл 2022

owlvit-base-patch32

Поиск объектовИзображение → bounding_boxes3 профессии

OWL-ViT находит и локализует объекты на изображениях по одному или нескольким текстовым запросам без фиксированного набора классов.

205 тыс.скачиваний за 30 дней152лайкавеса обновлены12 дек 2023

Бенчмарки

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

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

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

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

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

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

OWL-ViT — модель обнаружения объектов с открытым словарём, разработанная авторами статьи Simple Open-Vocabulary Object Detection with Vision Transformers. Она принимает изображение и один или несколько текстовых запросов и находит соответствующие объекты, возвращая их классы и рамки. Модель построена на мультимодальной основе CLIP с визуальным энкодером ViT-B/32 и трансформерным текстовым энкодером; к визуальным признакам добавлены лёгкие классификационная и рамочная головки. Репозиторий содержит веса PyTorch и Safetensors.

Модель подходит для поиска объектов по произвольным текстовым описаниям без необходимости заранее фиксировать набор классов. Её можно применять для исследовательских экспериментов с обобщением и устойчивостью компьютерного зрения, а также для поиска объектов на изображениях по текстовым запросам. Качество распознавания зависит от формулировок запросов и обучающих данных; карточка отмечает возможные смещения из-за состава интернет-данных. Лицензия — Apache-2.0.

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

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

Ограничения

Результаты зависят от формулировки текстовых запросов и ограничений обучающих данных; карточка предупреждает о смещениях, связанных с их интернет-происхождением. Модель представлена как исследовательский результат, а не как гарантия надёжности для критически важных применений.

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

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

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

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

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

Открыть на Hugging Face

Model Card: OWL-ViT

Model Details

The OWL-ViT (short for Vision Transformer for Open-World Localization) was proposed in Simple Open-Vocabulary Object Detection with Vision Transformers by Matthias Minderer, Alexey Gritsenko, Austin Stone, Maxim Neumann, Dirk Weissenborn, Alexey Dosovitskiy, Aravindh Mahendran, Anurag Arnab, Mostafa Dehghani, Zhuoran Shen, Xiao Wang, Xiaohua Zhai, Thomas Kipf, and Neil Houlsby. OWL-ViT is a zero-shot text-conditioned object detection model that can be used to query an image with one or multiple text queries.

OWL-ViT uses CLIP as its multi-modal backbone, with a ViT-like Transformer to get visual features and a causal language model to get the text features. To use CLIP for detection, OWL-ViT removes the final token pooling layer of the vision model and attaches a lightweight classification and box head to each transformer output token. Open-vocabulary classification is enabled by replacing the fixed classification layer weights with the class-name embeddings obtained from the text model. The authors first train CLIP from scratch and fine-tune it end-to-end with the classification and box heads on standard detection datasets using a bipartite matching loss. One or multiple text queries per image can be used to perform zero-shot text-conditioned object detection.

Model Date

May 2022

Model Type

The model uses a CLIP backbone with a ViT-B/32 Transformer architecture as an image encoder and uses a masked self-attention Transformer as a text encoder. These encoders are trained to maximize the similarity of (image, text) pairs via a contrastive loss. The CLIP backbone is trained from scratch and fine-tuned together with the box and class prediction heads with an object detection objective.

Documents

Use with Transformers

import requests
from PIL import Image
import torch

from transformers import OwlViTProcessor, OwlViTForObjectDetection

processor = OwlViTProcessor.from_pretrained("google/owlvit-base-patch32")
model = OwlViTForObjectDetection.from_pretrained("google/owlvit-base-patch32")

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
texts = [["a photo of a cat", "a photo of a dog"]]
inputs = processor(text=texts, images=image, return_tensors="pt")
outputs = model(**inputs)

# Target image sizes (height, width) to rescale box predictions [batch_size, 2]
target_sizes = torch.Tensor([image.size[::-1]])
# Convert outputs (bounding boxes and class logits) to COCO API
results = processor.post_process_object_detection(outputs=outputs, threshold=0.1, target_sizes=target_sizes)

i = 0  # Retrieve predictions for the first image for the corresponding text queries
text = texts[i]
boxes, scores, labels = results[i]["boxes"], results[i]["scores"], results[i]["labels"]

# Print detected objects and rescaled box coordinates
for box, score, label in zip(boxes, scores, labels):
    box = [round(i, 2) for i in box.tolist()]
    print(f"Detected {text[label]} with confidence {round(score.item(), 3)} at location {box}")

Model Use

Intended Use

The model is intended as a research output for research communities. We hope that this model will enable researchers to better understand and explore zero-shot, text-conditioned object detection. We also hope it can be used for interdisciplinary studies of the potential impact of such models, especially in areas that commonly require identifying objects whose label is unavailable during training.

Primary intended uses

The primary intended users of these models are AI researchers.

We primarily imagine the model will be used by researchers to better understand robustness, generalization, and other capabilities, biases, and constraints of computer vision models.

Data

The CLIP backbone of the model was trained on publicly available image-caption data. This was done through a combination of crawling a handful of websites and using commonly-used pre-existing image datasets such as YFCC100M. A large portion of the data comes from our crawling of the internet. This means that the data is more representative of people and societies most connected to the internet. The prediction heads of OWL-ViT, along with the CLIP backbone, are fine-tuned on publicly available object detection datasets such as COCO and OpenImages.

BibTeX entry and citation info

@article{minderer2022simple,
  title={Simple Open-Vocabulary Object Detection with Vision Transformers},
  author={Matthias Minderer, Alexey Gritsenko, Austin Stone, Maxim Neumann, Dirk Weissenborn, Alexey Dosovitskiy, Aravindh Mahendran, Anurag Arnab, Mostafa Dehghani, Zhuoran Shen, Xiao Wang, Xiaohua Zhai, Thomas Kipf, Neil Houlsby},
  journal={arXiv preprint arXiv:2205.06230},
  year={2022},
}

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

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

GPU в ailist

Универсальный рантайм · object-detection

Нельзя запустить

Для архитектуры owlvit нет загрузчика под задачу object-detection.

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

0 моделей