Skip to main content

An extensible viewer for OCR-D workspaces

Project description

OCR-D Browser

An extensible viewer for OCR-D mets.xml files

Screenshot

OCRD Browser with two image and one xml view

Installation on Ubuntu 18.04

sudo make deps-ubuntu
pip install browse-ocrd

Usage

browse-ocrd ./path/to/mets.xml # or open interactively

Features

  • 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

Configuration

Configuration file locations

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'

Configuration file syntax

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 current ocrd.Workspace, all properties get shell escaped (by shlex.quote) automatically.
  • file : The current ocrd_models.OcrdFile, all properties get shell escaped (by shlex.quote) automatically, also there is an additional property path with the properties absolute and relative, 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

browse-ocrd-0.4.2.tar.gz (63.4 kB view details)

Uploaded Source

Built Distribution

browse_ocrd-0.4.2-py3-none-any.whl (80.8 kB view details)

Uploaded Python 3

File details

Details for the file browse-ocrd-0.4.2.tar.gz.

File metadata

  • Download URL: browse-ocrd-0.4.2.tar.gz
  • Upload date:
  • Size: 63.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for browse-ocrd-0.4.2.tar.gz
Algorithm Hash digest
SHA256 a0555e4a823fd4d408bb179371bcb7a236c56f44859bb0f78e28af77308878fa
MD5 4425188175a2314c8250b270809dc489
BLAKE2b-256 3c76b0c7b1d7da68423e9767feaa8ed7f39242919c80bcfe1ae9d33ec13b844e

See more details on using hashes here.

File details

Details for the file browse_ocrd-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: browse_ocrd-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 80.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for browse_ocrd-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b3ed5cdefce3803469843f8f5e2abaf2b644d5221791df54beff1b184abb1bf
MD5 3ca1a38bb91409075458eedef718fded
BLAKE2b-256 7e641e99509b81689b91b9d01693589f620d90e63ab03f543efb6948f2e5a57b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page