/ Модель

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

Лицензия
Своя лицензия
Архитектура
mobilevit · dense
Опубликована
13 окт 2023

MobileViT_DeepLabv3

Сегментация изображенийИзображение → mask3 профессии

Компактная модель MobileViT-XX-Small с головой DeepLabV3 для семантической сегментации изображений, дообученная на PASCAL VOC2012.

158скачиваний за 30 дней0лайковвеса обновлены22 янв 2024

Бенчмарки

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

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

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

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

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

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

SpotLab/MobileViT_DeepLabv3 — компактная модель семантической сегментации изображений на основе MobileViT-XX-Small и головы DeepLabV3. Архитектура MobileViT сочетает свёрточные блоки в стиле MobileNetV2 с Transformer-блоками для глобальной обработки патчей; модель предназначена для сегментации объектов на изображениях и рассчитана на мобильное применение с низкой задержкой.

Модель обучена на ImageNet-1k, затем дообучена на PASCAL VOC2012. Для оценки на PASCAL VOC указана метрика mIoU 73,6 при 1,9 млн параметров. На вход подаются изображения с центральной обрезкой до 512×512 и пикселями в порядке BGR, нормализованными в диапазон [0, 1]. Репозиторий содержит варианты в форматах PyTorch, TensorFlow, TFLite и Core ML. Указана лицензия Apple Sample Code License.

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

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

Ограничения

Для инференса требуется соблюдать описанную предобработку: центральная обрезка до 512×512 и порядок каналов BGR. Метрика 73,6 mIoU приведена для PASCAL VOC и не гарантирует аналогичное качество на других наборах данных.

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

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

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

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

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

Открыть на Hugging Face

Forked from apple/deeplabv3-mobilevit-xx-small

MobileViT + DeepLabV3 (extra extra small-sized model)

MobileViT model pre-trained on PASCAL VOC at resolution 512x512. It was introduced in MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer by Sachin Mehta and Mohammad Rastegari, and first released in this repository. The license used is Apple sample code license.

Disclaimer: The team releasing MobileViT did not write a model card for this model so this model card has been written by the Hugging Face team.

Model description

MobileViT is a light-weight, low latency convolutional neural network that combines MobileNetV2-style layers with a new block that replaces local processing in convolutions with global processing using transformers. As with ViT (Vision Transformer), the image data is converted into flattened patches before it is processed by the transformer layers. Afterwards, the patches are "unflattened" back into feature maps. This allows the MobileViT-block to be placed anywhere inside a CNN. MobileViT does not require any positional embeddings.

The model in this repo adds a DeepLabV3 head to the MobileViT backbone for semantic segmentation.

Intended uses & limitations

You can use the raw model for semantic segmentation. See the model hub to look for fine-tuned versions on a task that interests you.

How to use

Here is how to use this model:

from transformers import MobileViTFeatureExtractor, MobileViTForSemanticSegmentation
from PIL import Image
import requests

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

feature_extractor = MobileViTFeatureExtractor.from_pretrained("apple/deeplabv3-mobilevit-xx-small")
model = MobileViTForSemanticSegmentation.from_pretrained("apple/deeplabv3-mobilevit-xx-small")

inputs = feature_extractor(images=image, return_tensors="pt")

outputs = model(**inputs)
logits = outputs.logits
predicted_mask = logits.argmax(1).squeeze(0)

Currently, both the feature extractor and model support PyTorch.

Training data

The MobileViT + DeepLabV3 model was pretrained on ImageNet-1k, a dataset consisting of 1 million images and 1,000 classes, and then fine-tuned on the PASCAL VOC2012 dataset.

Training procedure

Preprocessing

At inference time, images are center-cropped at 512x512. Pixels are normalized to the range [0, 1]. Images are expected to be in BGR pixel order, not RGB.

Pretraining

The MobileViT networks are trained from scratch for 300 epochs on ImageNet-1k on 8 NVIDIA GPUs with an effective batch size of 1024 and learning rate warmup for 3k steps, followed by cosine annealing. Also used were label smoothing cross-entropy loss and L2 weight decay. Training resolution varies from 160x160 to 320x320, using multi-scale sampling.

To obtain the DeepLabV3 model, MobileViT was fine-tuned on the PASCAL VOC dataset using 4 NVIDIA A100 GPUs.

Evaluation results

ModelPASCAL VOC mIOU# paramsURL
MobileViT-XXS73.61.9 Mhttps://huggingface.co/apple/deeplabv3-mobilevit-xx-small
MobileViT-XS77.12.9 Mhttps://huggingface.co/apple/deeplabv3-mobilevit-x-small
MobileViT-S79.16.4 Mhttps://huggingface.co/apple/deeplabv3-mobilevit-small

BibTeX entry and citation info

@inproceedings{vision-transformer,
title = {MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer},
author = {Sachin Mehta and Mohammad Rastegari},
year = {2022},
URL = {https://arxiv.org/abs/2110.02178}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей