Python无法在Windows上编译Lanms -EAST

时间:2019-05-29 14:25:25

标签: python opencv ocr

我将图片中的文本变成一个矩形。为此,我使用的是EAST:高效准确的场景文本检测器 我下面的例子 https://github.com/kurapan/EAST

我在下面的代码中运行

import subprocess
import os
import numpy as np

BASE_DIR = os.path.dirname(os.path.realpath(__file__))

if subprocess.call(['make', '-C', BASE_DIR]) != 0:  # return value
    raise RuntimeError('Cannot compile lanms: {}'.format(BASE_DIR))


def merge_quadrangle_n9(polys, thres=0.3, precision=10000):
    from .adaptor import merge_quadrangle_n9 as nms_impl
    if len(polys) == 0:
        return np.array([], dtype='float32')
    p = polys.copy()
    p[:,:8] *= precision
    ret = np.array(nms_impl(p, thres), dtype='float32')
    ret[:,:8] /= precision
    return ret

但是,我遇到了这个错误

Using TensorFlow backend.
Traceback (most recent call last):
  File "C:\Users\LENOVA\Desktop\east\EAST-master\eval.py", line 11, in <module>
    from lanms import *
  File "C:\Users\LENOVA\Desktop\east\EAST-master\lanms\__init__.py", line 7, in <module>
    if subprocess.call(['make', '-C', BASE_DIR]) != 0:  # return value
  File "C:\Users\LENOVA\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 267, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Users\LENOVA\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "C:\Users\LENOVA\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 990, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

1 个答案:

答案 0 :(得分:0)

我尝试在以下两行中发表评论:

如果subprocess.call(['make','-C',BASE_DIR])!= 0:#返回值     引发RuntimeError('无法编译lanms:{}'。format(BASE_DIR))

它正在为我工​​作。对于上述错误。