microsoft / table-transformer

Table Transformer (TATR) is a deep learning model for extracting tables from unstructured documents (PDFs and images). This is also the official repository for the PubTables-1M dataset and GriTS evaluation metric.
MIT License
2.22k stars 247 forks source link

How do I perform Batch Inference for TSR? #177

Open aashishpokharel opened 5 months ago

aashishpokharel commented 5 months ago

I have a pdf and have converted it to the images. Now I want to pass it through the TETR for Table Structure Recognition. Is there a way to run Inference with batch size > 1 for TSR? Can it be done using the inference.py or I need to run in the eval mode?

NielsRogge commented 4 months ago

Hi,

Batched inference is supported by default in the Transformers library as shown here. Just pass multiple images to the image processor, and multiple target sizes to the post_process_object_detection method.