ONNX 模型库
返回模型

说明文档

模型卡片:detr-doc-table-detection

模型详情

detr-doc-table-detection 是一个基于 facebook/detr-resnet-50 训练的模型,用于检测文档中的有边框表格无边框表格

用途

直接使用

该模型可用于目标检测任务。

超出范围的使用

该模型不应被用于故意为人们创建敌对或排斥的环境。

偏见、风险和局限性

大量研究已探索了语言模型中的偏见和公平性问题(参见 Sheng et al. (2021)Bender et al. (2021))。模型生成的预测可能包含针对受保护类别、身份特征以及敏感、社会和职业群体的令人不安的有害刻板印象。

建议

应让用户(直接用户和下游用户)了解该模型的风险、偏见和局限性。需要更多信息以提供进一步建议。

训练详情

训练数据

该模型在 ICDAR2019 Table Dataset 数据集上训练。

环境影响

碳排放可以使用 Machine Learning Impact 计算器(参见 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 与 Ezo Ozoani 和 Hugging Face 团队合作

模型卡片联系

需要更多信息

如何开始使用模型

使用以下代码开始使用模型。

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)

# 将输出(边界框和类别逻辑回归)转换为 COCO API
# 只保留置信度 > 0.9 的检测结果
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"检测到 {model.config.id2label[label.item()]},置信度 "
            f"{round(score.item(), 3)},位置 {box}"
    )

TahaDouaji/detr-doc-table-detection

作者 TahaDouaji

object-detection transformers
↓ 194.2K ♥ 63

创建时间: 2022-03-11 15:55:14+00:00

更新时间: 2025-11-10 05:52:21+00:00

在 Hugging Face 上查看

文件 (9)

.gitattributes
README.md
config.json
model.safetensors
onnx/config.json
onnx/model.onnx ONNX
onnx/preprocessor_config.json
preprocessor_config.json
pytorch_model.bin