🚀 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 许可证。