How to train Tesseract on multiple files at once?

2019-08-14 02:32发布

When I first trained Tesseract the tutorial I used showed a way to run the commands on each relevant file, but I can no longer find that.

How could I run this command for each file:

tesseract [lang].[fontname].exp[num].tif [lang].[fontname].exp[num] batch.nochop makebox

1条回答
爷、活的狠高调
2楼-- · 2019-08-14 03:03

For a quick and dirty loop, you can try:

for i in *.tif ; do tesseract $i $i.txt; done;

You can also do it with a find -iname ____ path to select from a subset of files.

If you want to really "parse" filenames, you may want to use a scripting language, or get your bash-foo out.

查看更多
登录 后发表回答