Instructions to use TahaDouaji/detr-doc-table-detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TahaDouaji/detr-doc-table-detection with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("object-detection", model="TahaDouaji/detr-doc-table-detection")# Load model directly from transformers import AutoImageProcessor, AutoModelForObjectDetection processor = AutoImageProcessor.from_pretrained("TahaDouaji/detr-doc-table-detection") model = AutoModelForObjectDetection.from_pretrained("TahaDouaji/detr-doc-table-detection", device_map="auto") - Notebooks
- Google Colab
- Kaggle
meaning of the box coordinates
#6
by hvenance - opened
do you know exactly what these coordinates mean? And more importantly, how can they be converted to pdf coordinates ?
need help with the same
The output BBox coordinates are in Image Coordinate Space, if you need to convert to PDF Coordinate space you'll need to do the following:
original_width = int(width / dpi_multiple)
original_height = int(height / dpi_multiple)
x1 = box[0]
y1 = results["original_height"] - box[1]
x2 = box[2]
y2 = results["original_height"] - box[3]
*Notes: I increased the image DPI thus needed to account for DPI multiple.