小编The*_*man的帖子

如何将Tesseract导入Angular2(TypeScript)

我正在尝试将Tesseract导入Angular2(TypeScript).我可以看到它保存到node_modules文件夹中,但在使用时

import { Tesseract } from '@types/tesseract.js';

它说:

[ts]模块'"c:/Users/black/Projects/projectCLI/tess/node_modules/@types/tesseract.js/index"'没有导出成员'Tesseract'.

在index.d.ts文件中有一个名为Tesseract的命名空间.

有没有其他方法来导入这个或我们是否以错误的方式看待这个?

我曾经npm install --save-dev @types/tesseract.js安装过打字稿Tesseract.

如果有任何使用tesseract的演示教程,请将它们链接到这里吗?

在此先感谢您的帮助.

javascript ocr tesseract angular

5
推荐指数
1
解决办法
3520
查看次数

Python - plt.tight_layout() TypeError:“模块”对象不可调用

我正在尝试运行以下代码

import matplotlib as plt

def plot_filters(layer, x, y):

    filters = layer.get_weights()
    fig = plt.figure.Figure()

    for j in range(len(filters)):
        ax = fig.add_subplot(y, x, j+1)
        ax.matshow(filters[j][0], cmap = plt.cm.binary)
        plt.xticks(np.array([]))
        plt.yticks(np.array([]))

    plt.tight_layout()
    return plt

plot_filters(model.layers[0], 8, 4)
Run Code Online (Sandbox Code Playgroud)

当运行这个时,我收到'module' object is not callable并且它正在引用该plt.tight_layout()行。不知道如何称呼这个。它存在于 matplotlib 包中。

任何帮助将不胜感激!

谢谢

python matplotlib

1
推荐指数
1
解决办法
1805
查看次数

在 DataFrame 中应用 os.path.join 方法

我有一个df包含三列列的 DataFrame :['Name', 'WD', 'File']. 与 in 中的每个名称相关联的文件'Name'在 column 中作为其工作目录给出,在 column 中给出'WD'了文件名'File'

我的 df

我想使用方法连接'WD'列和'File'os.path.join(),以便'File'列显示完整路径。

我尝试了以下脚本,它工作正常,但我想知道是否有更好的方法而不使用 for 循环:

for i in df.index:
    df['File'][i]=os.path.join(df['WD'][i],df['File'][i])
Run Code Online (Sandbox Code Playgroud)

python pandas os.path

1
推荐指数
1
解决办法
938
查看次数

标签 统计

python ×2

angular ×1

javascript ×1

matplotlib ×1

ocr ×1

os.path ×1

pandas ×1

tesseract ×1