Scripts for VLM use with hOCR outputs
These scripts are referenced in this Google Colab notebook. The basic use can be seen in the top comments on each script. Our approach is to use Eynollah to segment newspaper images into PAGE-XML, which is then used to produce paragraph-level images via the eyPage.py script. Those images can be run against HunyuanOCR via the hunOcrRun.py script (hunCpuRun.py for CPU-only). The resulting text files are converted to hOCR with the coords2hOCR.py script. Note that Code Carbon is used help track overhead. The final goal is a hybrid environment where Tesseract is used for as much as the recognition process as possible (due to its smaller footprint), and a VLM/LLM layer is applied selectively via vLLM and streaming. vllmHunOcrStream.py is an example of using streaming. Finally, hocrAccEst.py is a simple example of using hOCR's confidence values for estimating the accuracy of a page.