我正在将 tesseract 与 python 一起使用。它几乎可以识别我所有带有 2 个或更多数字或字符的图像。但是 tesseract 不能识别只有一个数字的图像。我尝试使用命令行,它给了我“空页”作为响应。
我不想用“只有数字”来训练 tesseract,因为我也在识别字符。
问题是什么?
在 tesseract 无法识别的图像下方。
代码:
#getPng(pathImg, '3') -> creates the path to the figure.
pytesseract.image_to_string( Image.open(getPng(pathImg, '3'))
Run Code Online (Sandbox Code Playgroud) 我有一个在 centos 机器上运行的 python 程序。我使用 virtualenv (source activate) 来激活特定的 python,然后使用以下命令:
gunicorn -t 10000 -b 0.0.0.0:1234 start:app &
Run Code Online (Sandbox Code Playgroud)
效果很好。但是当我关闭 bash 时,我的程序就不再工作了。当我打开一个新的bash(通过PUTTY)并输入
ps -C gunicorn
Run Code Online (Sandbox Code Playgroud)
我看到gunicorn进程正在运行。如果我将所有这些放在 local.rc 上(与服务器一起初始化),一切都会正常工作。
我有两个问题。第一个是:
我可以在gunicorn上放置一个“永远”(就像我们在node.js上放置的那样),或者从bash中分离gunicorn和virtualenv,以便始终独立于关闭bash运行吗?
我怎么解决这个问题?