Rectifies a heavily curled or perspective-distorted document Image with a segmentation mask plus the GeoTr transformer, which predicts a backward map that is upsampled and applied to emit a flattened Image for OCR.
Typical backends
Flatten a curled page before OCR: a file source feeds the image, this component rectifies it with the transformer unwarper, and a recognizer reads the cleaned text out as JSON.
Rectify documents from a live HTTP feed and publish the flattened image for visual inspection instead of OCR.
Caveats
- AccuracyThe transformer predicts a small backward map at a fixed working resolution and upsamples it, so very high input resolutions do not recover finer text detail; hands, torn edges, multiple folded panels, and non-document inputs remain common failure cases.
- I/O contractAn image smaller than two pixels on a side is returned unchanged; otherwise the output is a same-color-space rectified
Image. - LatencyEach frame runs a U2Net segmentation pass and the GeoTr transformer, so a GPU is strongly recommended; CPU execution works but is markedly slower and impractical for live throughput.
- LimitationThis is a dewarping-only restorer with no deshadow, deblur, or binarize modes; pair it with a dedicated cleanup stage if illumination correction is also required.