Open masc-it opened 1 year ago
Hi @masc-it!
I get a feeling you expect imgpath
and outpath
to be a normal path name (perhaps even file name). But OCR-D uses METS-XML as container to manage documents (comprised of many files referenced as local paths or URLs, but organised in fileGrps). Hence this wrapper. The Readme contains links to what METS is and what an OCR-D processor must do.
If you just want to process some images, you can install OCR-D and do ocrd-import path/to/directory
to get a fresh METS, which can then be used by ocrd-detectron2-segment. Beware though that due to the postprocessing, this tool also requires to run a binarization processor prior.
I'll publish a full CI working example shortly.
See make test
in https://github.com/bertsky/ocrd_detectron2/blob/master/Makefile or https://github.com/bertsky/ocrd_detectron2/blob/master/.github/workflows/python-app.yml (test results downloadable as artifact).
This runs a complete command line example on
In there, I used ocrd-skimage-binarize for binarization – not because it's the best or fastest method, but because it is pure Python and needs no extra model downloads.
Perhaps for those who don't want OCR-D interfaces, but do like to have a single tool for multiple models, and perhaps even my postprocessing, I can write a standalone API and CLI that does not depend on METS-XML and PAGE-XML.
Hi I am trying to run this library but no luck till now.
I've followed the readme and I got deps properly installed. I am trying to run the model on a image but I get an error:
Can you give me some guidance? An example of actual, working usage would be appreciated too. nice job btw