def load_normalizer(fname): fname = ocrolib.findfile(fname) model = ocrolib.load_component(fname) if "lineParameters" in dir(model): return LineestNormalizer(model,params=default_params) if "normalize" in dir(model): return model raise Exception("model seems to be neither a normalizer nor a line estimator")
def load_normalizer(fname): if fname=="center": fname = "=ocrolib.lineest.CenterNormalizer()" if fname[0] not in "=@": fname = ocrolib.findfile(fname) model = ocrolib.load_component(fname) if "lineParameters" in dir(model): return LineestNormalizer(model,params=default_params) if "normalize" in dir(model): return model raise BadInput("model seems to be neither a normalizer nor a line estimator")
def load_normalizer(fname): if fname == "center": fname = "=ocrolib.lineest.CenterNormalizer()" if fname[0] not in "=@": fname = ocrolib.findfile(fname) model = ocrolib.load_component(fname) if "lineParameters" in dir(model): return LineestNormalizer(model, params=default_params) if "normalize" in dir(model): return model raise Exception( "model seems to be neither a normalizer nor a line estimator")
def __init__(self, *args): unittest.TestCase.__init__(self, *args) self.model = ocrolib.load_component(self.model_file) self.linerec = self.LineRecognizer(cmodel=self.model)