license: other
tags:
- 视觉
- 图像分割
datasets:
- pascal-voc
widget:
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/cat-2.jpg
example_title: 猫咪
搭载DeepLabV3+的MobileNetV2
本模型是在PASCAL VOC数据集上以513x513分辨率预训练的MobileNet V2模型。该模型由Mark Sandler、Andrew Howard、Menglong Zhu、Andrey Zhmoginov和Liang-Chieh Chen在论文MobileNetV2: Inverted Residuals and Linear Bottlenecks中提出,并首次发布于此代码库。
免责声明:发布MobileNet V2的团队未为此模型编写模型卡片,故本卡片由Hugging Face团队代写。
模型描述
根据原始README:
MobileNets是小型、低延迟、低功耗的模型,可通过参数调整满足多种应用场景的资源限制。它们可用于分类、检测、嵌入和分割任务,类似于Inception等流行的大规模模型。MobileNets能在移动设备上高效运行[...] MobileNets在延迟、模型大小和准确率之间取得了良好平衡,性能优于文献中常见的模型。
本仓库中的模型为MobileNetV2主干网络添加了DeepLabV3+头部,用于语义分割任务。
预期用途与限制
您可以直接使用该原始模型进行语义分割。可访问模型中心查找您感兴趣任务的微调版本。
使用方法
使用方式如下:
from transformers import MobileNetV2FeatureExtractor, MobileNetV2ForSemanticSegmentation
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 = MobileNetV2FeatureExtractor.from_pretrained("Matthijs/deeplabv3_mobilenet_v2_1.0_513")
model = MobileNetV2ForSemanticSegmentation.from_pretrained("Matthijs/deeplabv3_mobilenet_v2_1.0_513")
inputs = feature_extractor(images=image, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
predicted_mask = logits.argmax(1).squeeze(0)
当前特征提取器和模型均支持PyTorch框架。
BibTeX引用信息
@inproceedings{deeplabv3plus2018,
title={Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation},
author={Liang-Chieh Chen and Yukun Zhu and George Papandreou and Florian Schroff and Hartwig Adam},
booktitle={ECCV},
year={2018}
}