Spartan
An open-source PDF table detection and structure recognition tool based on classical computer vision (morphological operations and LSD line segment detection). It supports both bordered and borderless tables, runs on CPU, and is released under the MIT License.
Timeline (last 90 days)
Spartan is an open-source project that implements table detection and structure recognition using only classic computer vision techniques (morphological operations and LSD line segment detection).
For bordered tables, Spartan uses morphological opening with long horizontal/vertical kernels to separate table lines.
For borderless tables, Spartan detects them via text alignment (left, center, right), drawing pseudo-boundaries when enough rows and columns are aligned.
In the structure recognition stage, Spartan uses LSD to detect line segments, clusters and merges them into a grid, and recovers cells spanning rows/columns via missing line segments (using a union-find algorithm).
For digital PDFs, Spartan obtains characters directly from the PDF text layer and maps them onto the cell grid, avoiding OCR errors.
Spartan's OCR (Tesseract or a plug-in engine) is used only for scanned pages.
Spartan's post-processing includes nested header detection, classification of key-value tables versus regular tables, and cross-page table merging (by matching column widths and headers).
Spartan's entire pipeline runs on CPU, at roughly 0.3–1.5 seconds per page on a laptop.
Spartan uses the MIT license.
Spartan currently lacks formal benchmark evaluation (e.g., using GriTS or TEDS on ICDAR 2013/PubTables-1M/FinTabNet), which is its biggest shortcoming.
4 more timeline events
All Facts (14)
Spartan is an open-source project that implements table detection and structure recognition using only classic computer vision techniques (morphological operations and LSD line segment detection).
50%UnverifiedFor bordered tables, Spartan uses morphological opening with long horizontal/vertical kernels to separate table lines.
50%UnverifiedFor borderless tables, Spartan detects them via text alignment (left, center, right), drawing pseudo-boundaries when enough rows and columns are aligned.
50%UnverifiedIn the structure recognition stage, Spartan uses LSD to detect line segments, clusters and merges them into a grid, and recovers cells spanning rows/columns via missing line segments (using a union-find algorithm).
50%UnverifiedFor digital PDFs, Spartan obtains characters directly from the PDF text layer and maps them onto the cell grid, avoiding OCR errors.
50%UnverifiedSpartan's OCR (Tesseract or a plug-in engine) is used only for scanned pages.
50%UnverifiedSpartan's post-processing includes nested header detection, classification of key-value tables versus regular tables, and cross-page table merging (by matching column widths and headers).
50%UnverifiedSpartan's entire pipeline runs on CPU, at roughly 0.3–1.5 seconds per page on a laptop.
50%UnverifiedSpartan uses the MIT license.
50%UnverifiedSpartan currently lacks formal benchmark evaluation (e.g., using GriTS or TEDS on ICDAR 2013/PubTables-1M/FinTabNet), which is its biggest shortcoming.
50%UnverifiedSpartan handles skewed scans poorly; line segment detection tolerates only about 2 pixels of drift, and there is no deskewing correction yet.
50%UnverifiedSpartan may misjudge table headers as key-value pairs in small borderless blocks.
50%UnverifiedIn borderless cells, wrapped text in Spartan is sometimes split into extra rows.
50%UnverifiedSpartan is installed via pip install spartan-tables, and the repository is at https://github.com/shlok-n/spartan.
50%