🚀 detr-doc-table-detection モデルカード
detr-doc-table-detectionは、ドキュメント内の境界付きと境界なしの両方の表を検出するために訓練されたモデルです。このモデルは、facebook/detr-resnet-50をベースに構築されています。
🚀 クイックスタート
以下のコードを使用して、このモデルを始めることができます。
from transformers import DetrImageProcessor, DetrForObjectDetection
import torch
from PIL import Image
import requests
image = Image.open("IMAGE_PATH")
processor = DetrImageProcessor.from_pretrained("TahaDouaji/detr-doc-table-detection")
model = DetrForObjectDetection.from_pretrained("TahaDouaji/detr-doc-table-detection")
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.9)[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}"
)
✨ 主な機能
detr-doc-table-detectionは、ドキュメント内の境界付きと境界なしの両方の表を検出することができる物体検出モデルです。
📦 インストール
READMEにインストール手順は記載されていません。
💻 使用例
基本的な使用法
from transformers import DetrImageProcessor, DetrForObjectDetection
import torch
from PIL import Image
import requests
image = Image.open("IMAGE_PATH")
processor = DetrImageProcessor.from_pretrained("TahaDouaji/detr-doc-table-detection")
model = DetrForObjectDetection.from_pretrained("TahaDouaji/detr-doc-table-detection")
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.9)[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}"
)
📚 ドキュメント
モデルの詳細
detr-doc-table-detectionは、ドキュメント内の表を検出するために訓練されたモデルで、facebook/detr-resnet-50をベースにしています。
用途
直接利用
このモデルは、物体検出のタスクに使用できます。
範囲外の利用
このモデルは、人々に敵意や疎外感を抱かせるような環境を意図的に作り出すために使用してはいけません。
バイアス、リスク、制限
多くの研究が、言語モデルのバイアスと公平性の問題を調査しています(例えば、Sheng et al. (2021) と Bender et al. (2021) を参照)。このモデルによって生成された予測には、保護されたクラス、アイデンティティの特性、および敏感な社会的・職業的グループにまたがる有害なステレオタイプが含まれる可能性があります。
⚠️ 重要提示
ユーザー(直接ユーザーと下流ユーザーの両方)は、このモデルのリスク、バイアス、および制限について認識すべきです。さらなる推奨事項については、詳細情報が必要です。
訓練の詳細
訓練データ
このモデルは、ICDAR2019 Table Datasetを使用して訓練されました。
環境への影響
炭素排出量は、Lacoste et al. (2019)で提示されたMachine Learning Impact calculatorを使用して推定できます。
引用
@article{DBLP:journals/corr/abs-2005-12872,
author = {Nicolas Carion and
Francisco Massa and
Gabriel Synnaeve and
Nicolas Usunier and
Alexander Kirillov and
Sergey Zagoruyko},
title = {End-to-End Object Detection with Transformers},
journal = {CoRR},
volume = {abs/2005.12872},
year = {2020},
url = {https://arxiv.org/abs/2005.12872},
archivePrefix = {arXiv},
eprint = {2005.12872},
timestamp = {Thu, 28 May 2020 17:38:09 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-2005-12872.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
モデルカード作成者
Taha Douaji が Ezi Ozoani と Hugging Face チームと共同で作成しました。
モデルカードの連絡先
詳細情報が必要です。
📄 ライセンス
このモデルは、Apache-2.0ライセンスの下で提供されています。