🚀 ResNet - 50バックボーンを持つ可変形DETRモデル、シングルスケール+膨張
可変形検出トランスフォーマー(Deformable DETR)のシングルスケール + 膨張モデルは、COCO 2017物体検出データセット(注釈付き画像11.8万枚)でエンドツーエンドで学習されています。このモデルは、Zhuらによって論文Deformable DETR: Deformable Transformers for End - to - End Object Detectionで提案され、最初に[このリポジトリ](https://github.com/fundamentalvision/Deformable - DETR)で公開されました。
声明:可変形DETRを公開したチームはこのモデルのモデルカードを作成していません。このモデルカードはHugging Faceチームによって作成されました。
🚀 クイックスタート
可変形DETRモデルは、物体検出タスクに直接使用できます。すべての利用可能な可変形DETRモデルは、[モデルセンター](https://huggingface.co/models?search=sensetime/deformable - detr)で見つけることができます。
✨ 主な機能
- エンドツーエンド学習:COCO 2017物体検出データセットでエンドツーエンドで学習されており、複雑な後処理ステップは必要ありません。
- トランスフォーマーアーキテクチャ:エンコーダ - デコーダのトランスフォーマーアーキテクチャを採用し、畳み込みバックボーンネットワークと組み合わせることで、物体検出性能を向上させます。
- オブジェクトクエリメカニズム:画像内の物体を検出するためにオブジェクトクエリを使用し、各オブジェクトクエリは画像内の特定の物体に対応します。
📚 ドキュメント
モデルの説明
DETRモデルは、畳み込みバックボーンを持つエンコーダ - デコーダトランスフォーマーです。物体検出を行うために、デコーダの出力に2つのヘッドが追加されています:クラスラベル用の線形層とバウンディングボックス用の多層パーセプトロン(MLP)です。このモデルは、画像内の物体を検出するためにいわゆるオブジェクトクエリを使用し、COCOデータセットの場合、オブジェクトクエリの数は100に設定されています。
モデルは「二分マッチング損失」を使用して学習されます:N = 100個のオブジェクトクエリの予測クラスとバウンディングボックスを正解ラベルと比較し、正解ラベルは同じ長さNにパディングされます(したがって、画像に4つの物体しか含まれない場合、96個のラベルのクラスは「物体なし」、バウンディングボックスは「バウンディングボックスなし」になります)。ハンガリアンマッチングアルゴリズムを使用して、N個のクエリとN個のラベルの間に最適な1対1のマッピングを作成します。次に、標準的な交差エントロピー(クラス用)とL1損失と広義IoU損失の線形結合(バウンディングボックス用)を使用して、モデルのパラメータを最適化します。

想定される用途と制限
このオリジナルモデルは、物体検出に使用できます。
使用例
基本的な使用法
from transformers import AutoImageProcessor, DeformableDetrForObjectDetection
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)
processor = AutoImageProcessor.from_pretrained("SenseTime/deformable-detr-single-scale-dc5")
model = DeformableDetrForObjectDetection.from_pretrained("SenseTime/deformable-detr-single-scale-dc5")
inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
target_sizes = torch.tensor([image.size[::-1]])
results = processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.7)[0]
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
box = [round(i, 2) for i in box.tolist()]
print(
f"Detected {model.config.id2label[label.item()]} with confidence "
f"{round(score.item(), 3)} at location {box}"
)
現在、特徴抽出器とモデルはどちらもPyTorchをサポートしています。
学習データ
可変形DETRモデルは、COCO 2017物体検出データセットで学習されており、このデータセットには学習用と検証用の注釈付き画像がそれぞれ11.8万枚と5000枚含まれています。
BibTeX引用と引用情報
@misc{https://doi.org/10.48550/arxiv.2010.04159,
doi = {10.48550/ARXIV.2010.04159},
url = {https://arxiv.org/abs/2010.04159},
author = {Zhu, Xizhou and Su, Weijie and Lu, Lewei and Li, Bin and Wang, Xiaogang and Dai, Jifeng},
keywords = {Computer Vision and Pattern Recognition (cs.CV), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {Deformable DETR: Deformable Transformers for End-to-End Object Detection},
publisher = {arXiv},
year = {2020},
copyright = {arXiv.org perpetual, non-exclusive license}
}
📄 ライセンス
このプロジェクトは、Apache - 2.0ライセンスの下で提供されています。