ocrd_cis/aio/aio.py
def runtesserocr(wsdir, configdir, fgrpdict):
    """ Run tesseract with a model and return the new output-file-grp"""
    print('runtesserocr({wsdir}, {cnf}, {fgrp}'.format(
        wsdir=wsdir, cnf=configdir, fgrp=fgrpdict))
    model = get_ocrd_model(configdir)
    for fgrp in fgrpdict:

        input_file_group = 'OCR-D-GT-{fgrp}'.format(fgrp=fgrp)
        output_file_group = 'OCR-D-TESSER-{model}-{fgrp}'.format(
            model=model, fgrp=fgrp)
        fgrpdict[fgrp].append(output_file_group)

        tesserocrcmd = '''
        ocrd-tesserocr-recognize \
        --input-file-grp {ifg} \
        --output-file-grp {ofg} \
        --mets {mets}/mets.xml \
        --parameter {parameter}
        '''.format(mets=wsdir, parameter=configdir,
                   ifg=input_file_group, ofg=output_file_group)

        _, wsdirs, _ = os.walk(wsdir).__next__()
        if output_file_group not in wsdirs:
            subprocess_cmd(tesserocrcmd)

    return fgrpdict
 Run tesseract with a model and return the new output-file-grp
Run tesseract with a model and return the new output-file-grp
Run tesseract with a model and return the new output - file - grp
def runtesserocr(wsdir, configdir, fgrpdict):
    print('runtesserocr({wsdir}, {cnf}, {fgrp}'.format(
        wsdir=wsdir, cnf=configdir, fgrp=fgrpdict))
    model = get_ocrd_model(configdir)
    for fgrp in fgrpdict:
        input_file_group = 'OCR-D-GT-{fgrp}'.format(fgrp=fgrp)
        output_file_group = 'OCR-D-TESSER-{model}-{fgrp}'.format(
            model=model, fgrp=fgrp)
        fgrpdict[fgrp].append(output_file_group)
        tesserocrcmd = '''
        ocrd-tesserocr-recognize \
        --input-file-grp {ifg} \
        --output-file-grp {ofg} \
        --mets {mets}/mets.xml \
        --parameter {parameter}
        '''.format(mets=wsdir, parameter=configdir,
                   ifg=input_file_group, ofg=output_file_group)
        _, wsdirs, _ = os.walk(wsdir).__next__()
        if output_file_group not in wsdirs:
            subprocess_cmd(tesserocrcmd)
    return fgrpdict
def runtesserocr ( wsdir , configdir , fgrpdict ) : print ( 'runtesserocr({wsdir}, {cnf}, {fgrp}' . format ( wsdir = wsdir , cnf = configdir , fgrp = fgrpdict ) ) model = get_ocrd_model ( configdir ) for fgrp in fgrpdict : input_file_group = 'OCR-D-GT-{fgrp}' . format ( fgrp = fgrp ) output_file_group = 'OCR-D-TESSER-{model}-{fgrp}' . format ( model = model , fgrp = fgrp ) fgrpdict [ fgrp ] . append ( output_file_group ) tesserocrcmd = '''
        ocrd-tesserocr-recognize \
        --input-file-grp {ifg} \
        --output-file-grp {ofg} \
        --mets {mets}/mets.xml \
        --parameter {parameter}
        ''' . format ( mets = wsdir , parameter = configdir , ifg = input_file_group , ofg = output_file_group ) _ , wsdirs , _ = os . walk ( wsdir ) . __next__ ( ) if output_file_group not in wsdirs : subprocess_cmd ( tesserocrcmd ) return fgrpdict
Run tesseract with a model and return the new output-file-grp
Run tesseract with a model and return the new output - file - grp
""" Run tesseract with a model and return the new output-file-grp"""
wsdir
configdir
fgrpdict