An extensible viewer for OCR-D mets.xml files
sudo make deps-ubuntu
pip install browse-ocrd
browse-ocrd ./path/to/mets.xml # or open interactively
- Browse fileGrps and pages, arranging views next to each other for comparison
- Show original or derived images (
AlternativeImage
on any level of the structural hierarchy) - Show multiple images at once for different pages (horizontally) or different segments (vertically), zooming freely
- Show raw PAGE-XML with syntax highlighting, open with PageViewer
- Show concatenated PAGE-XML text annotation
- Show rendered HTML comparison from dinglehopper evaluations
At startup the following directories a searched for a config file named ocrd-browser.conf
# directories and their default values under Ubuntu 20.04
GLib.get_system_config_dirs() # '/etc/xdg/xdg-ubuntu/ocrd-browser.conf', '/etc/xdg/ocrd-browser.conf'
GLib.get_user_config_dir() # '/home/jk/.config/ocrd-browser.conf'
os.getcwd() # './ocrd-browser.conf'
The ocrd-browser.conf
file is an ini-file with the following keys:
[FileGroups]
# Preferred fileGrp names for thumbnail display in the Page Browser
# Comma seperated list of regular expressions
preferredImages = OCR-D-IMG, OCR-D-IMG.*, ORIGINAL
# Each Tool has a section header [Tool XYZ]
# At the moment the only defined tool is "PageViewer"
[Tool PageViewer]
# (ba)sh commandline to execute with placeholders
commandline = /usr/bin/java -jar /home/jk/bin/JPageViewer/JPageViewer.jar --resolve-dir {workspace.directory} {file.path.absolute}
The commandline
string will be used as a python format string with the keyword arguments:
workspace
: The currentocrd.Workspace
, all properties get shell escaped (byshlex.quote
) automatically.file
: The currentocrd_models.OcrdFile
, all properties get shell escaped (byshlex.quote
) automatically, also there is an additional propertypath
with the propertiesabsolute
andrelative
, so{file.path.absolute}
will be replaced by the shell quoted absolute path of the file.
Note: You can get PRImA's PageViewer at Github.