mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-27 04:24:45 +00:00
fix(TesseractOcrCliModel): Send the stderr to devnull to avoid poluting the console with messages from tesseract cmd
Signed-off-by: Nikos Livathinos <nli@zurich.ibm.com>
This commit is contained in:
parent
9e0a6ffd41
commit
4a0c9be576
@ -1,7 +1,7 @@
|
|||||||
import io
|
import io
|
||||||
import logging
|
import logging
|
||||||
import tempfile
|
import tempfile
|
||||||
from subprocess import PIPE, Popen
|
from subprocess import DEVNULL, PIPE, Popen
|
||||||
from typing import Iterable, Tuple
|
from typing import Iterable, Tuple
|
||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
@ -81,7 +81,7 @@ class TesseractOcrCliModel(BaseOcrModel):
|
|||||||
cmd += [ifilename, "stdout", "tsv"]
|
cmd += [ifilename, "stdout", "tsv"]
|
||||||
_log.info("command: {}".format(" ".join(cmd)))
|
_log.info("command: {}".format(" ".join(cmd)))
|
||||||
|
|
||||||
proc = Popen(cmd, stdout=PIPE)
|
proc = Popen(cmd, stdout=PIPE, stderr=DEVNULL)
|
||||||
output, _ = proc.communicate()
|
output, _ = proc.communicate()
|
||||||
|
|
||||||
# _log.info(output)
|
# _log.info(output)
|
||||||
|
Loading…
Reference in New Issue
Block a user