Run this model with HF Jobs
Run microsoft/table-transformer-detection on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/microsoft/table-transformer-detection. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/microsoft/table-transformer-detection on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use microsoft/table-transformer-detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use microsoft/table-transformer-detection with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("object-detection", model="microsoft/table-transformer-detection")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForObjectDetection processor = AutoImageProcessor.from_pretrained("microsoft/table-transformer-detection") model = AutoModelForObjectDetection.from_pretrained("microsoft/table-transformer-detection", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Preprocessing for better results
Hi,
Can we do any preprocessing to obtain better detection results? In my case, I got full-page tables with alternating color rows (i.e. background for the first row is white, the second row is light yellow, the third is white again, and so on.
The table transformer detector is not able to detect these tables. It works beautifully on regular tables that are homogenous in terms of background and are not full-page.
I've tried padding the corners of my images, but that doesn't work.
Convert the image to grayscale, add some binary + otsu thresholding and if needs be use some dilations and it should be a lot better
you may share pinned versions + a <20-line repro, that usually separates env skew from a real regression.
Related reading: Preprocess image for better barcode read results; OpenCV preprocess image for better thresholding results.
If those checks don't match what you're seeing, paste the exact versions + traceback lines.
βA