mirror of
https://github.com/mikegerber/ocrd_calamari.git
synced 2025-06-08 19:29:53 +02:00
🚧 Set TensorFlow minimum log level
This commit is contained in:
parent
4df04ac6d7
commit
3b02da8da2
2 changed files with 4 additions and 1 deletions
|
@ -2,3 +2,4 @@ import json
|
||||||
from pkg_resources import resource_string
|
from pkg_resources import resource_string
|
||||||
|
|
||||||
OCRD_TOOL = json.loads(resource_string(__name__, 'ocrd-tool.json').decode('utf8'))
|
OCRD_TOOL = json.loads(resource_string(__name__, 'ocrd-tool.json').decode('utf8'))
|
||||||
|
TF_CPP_MIN_LOG_LEVEL = '3' # '3' == ERROR
|
||||||
|
|
|
@ -14,7 +14,7 @@ from ocrd_models.ocrd_page import to_xml
|
||||||
from ocrd_models.ocrd_page_generateds import TextEquivType
|
from ocrd_models.ocrd_page_generateds import TextEquivType
|
||||||
from ocrd_utils import getLogger, concat_padded, polygon_from_points, MIMETYPE_PAGE
|
from ocrd_utils import getLogger, concat_padded, polygon_from_points, MIMETYPE_PAGE
|
||||||
|
|
||||||
from ocrd_calamari.config import OCRD_TOOL
|
from ocrd_calamari.config import OCRD_TOOL, TF_CPP_MIN_LOG_LEVEL
|
||||||
|
|
||||||
log = getLogger('processor.CalamariOcr')
|
log = getLogger('processor.CalamariOcr')
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ class CalamariOcr(Processor):
|
||||||
super(CalamariOcr, self).__init__(*args, **kwargs)
|
super(CalamariOcr, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
def _init_calamari(self):
|
def _init_calamari(self):
|
||||||
|
os.environ['TF_CPP_MIN_LOG_LEVEL'] = TF_CPP_MIN_LOG_LEVEL
|
||||||
|
|
||||||
checkpoints = glob('/home/mike/devel/experiments/train-calamari-gt4histocr/models/*.ckpt.json') # XXX
|
checkpoints = glob('/home/mike/devel/experiments/train-calamari-gt4histocr/models/*.ckpt.json') # XXX
|
||||||
self.predictor = MultiPredictor(checkpoints=checkpoints)
|
self.predictor = MultiPredictor(checkpoints=checkpoints)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue