🚀 Deformable DETRモデル(Detic法を用いてLVIS上で学習)
このモデルは、LVIS(1203クラスを含む)上で学習されたDeformable DEtection TRansformer (DETR) です。このモデルは、Zhouらによる論文 Detecting Twenty-thousand Classes using Image-level Supervision で導入され、最初は このリポジトリ で公開されました。
このモデルは、元のリポジトリで公開された "Detic_DeformDETR_R50_4x" チェックポイントに対応しています。
免責事項: Deticを公開したチームはこのモデルのモデルカードを作成していないため、このモデルカードはHugging Faceチームによって作成されました。
🚀 クイックスタート
このモデルは、物体検出に使用できます。利用可能なすべてのDeformable DETRモデルを探すには、モデルハブ を参照してください。
✨ 主な機能
- エンコーダ - デコーダ型のトランスフォーマーモデルで、畳み込みバックボーンを持つ。
- 物体検出のために、デコーダ出力の上に2つのヘッド(クラスラベル用の線形層とバウンディングボックス用のMLP)が追加されている。
- 画像内の物体を検出するために物体クエリを使用する。
📚 ドキュメント
モデルの説明
DETRモデルは、畳み込みバックボーンを持つエンコーダ - デコーダ型のトランスフォーマーです。物体検出を行うために、デコーダ出力の上に2つのヘッドが追加されています。1つはクラスラベル用の線形層、もう1つはバウンディングボックス用のMLP(多層パーセプトロン)です。このモデルは、画像内の物体を検出するためにいわゆる物体クエリを使用します。各物体クエリは、画像内の特定の物体を探します。COCOの場合、物体クエリの数は100に設定されています。
モデルは "二部マッチング損失" を使用して学習されます。つまり、N = 100の各物体クエリの予測クラスとバウンディングボックスを、同じ長さNにパディングされた正解アノテーションと比較します(つまり、画像に4つの物体しか含まれていない場合、96個のアノテーションはクラスとして "物体なし"、バウンディングボックスとして "バウンディングボックスなし" となります)。ハンガリアンマッチングアルゴリズムを使用して、N個のクエリとN個のアノテーションの間に最適な1対1のマッピングを作成します。次に、標準的な交差エントロピー(クラス用)とL1損失と一般化IoU損失の線形結合(バウンディングボックス用)を使用して、モデルのパラメータを最適化します。

想定される用途と制限
このモデルは物体検出に使用できます。利用可能なすべてのDeformable DETRモデルを探すには、モデルハブ を参照してください。
評価結果
このモデルは、LVIS上で32.5のボックスmAPと26.2のmAP(レアクラス)を達成しています。
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}
}
💻 使用例
基本的な使用法
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("facebook/deformable-detr-detic")
model = DeformableDetrForObjectDetection.from_pretrained("facebook/deformable-detr-detic")
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}"
)
📄 ライセンス
このモデルはApache-2.0ライセンスの下で提供されています。
属性 |
详情 |
モデルタイプ |
Deformable DETRモデル(Detic法を用いてLVIS上で学習) |
学習データ |
LVIS、COCO |