🚀 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}"
)
✨ 主要特性
📚 詳細文檔
模型詳情
使用方式
直接使用
該模型可用於目標檢測任務。
非預期使用
該模型不應被用於故意為人們創造敵對或排斥性的環境。
偏差、風險和侷限性
大量研究已經探討了語言模型的偏差和公平性問題(例如,參見 Sheng et al. (2021) 和 Bender et al. (2021))。該模型生成的預測可能包含針對受保護類別、身份特徵以及敏感、社會和職業群體的令人不安和有害的刻板印象。
建議
用戶(包括直接用戶和下游用戶)應該瞭解該模型的風險、偏差和侷限性。如需進一步建議,待補充更多信息。
訓練詳情
訓練數據
該模型在 ICDAR2019 表格數據集上進行訓練。
環境影響
可以使用 Lacoste et al. (2019) 中提出的 機器學習影響計算器 來估算碳排放。
引用
BibTeX:
@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 許可證。