Tesseract Open Source OCR Engine (main repository)

Overview

Tesseract OCR

Build Status Build status Build status
Coverity Scan Build Status Code Quality: Cpp Total Alerts OSS-Fuzz
GitHub license Downloads

About

This package contains an OCR engine - libtesseract and a command line program - tesseract. Tesseract 4 adds a new neural net (LSTM) based OCR engine which is focused on line recognition, but also still supports the legacy Tesseract OCR engine of Tesseract 3 which works by recognizing character patterns. Compatibility with Tesseract 3 is enabled by using the Legacy OCR Engine mode (--oem 0). It also needs traineddata files which support the legacy engine, for example those from the tessdata repository.

The lead developer is Ray Smith. The maintainer is Zdenko Podobny. For a list of contributors see AUTHORS and GitHub's log of contributors.

Tesseract has unicode (UTF-8) support, and can recognize more than 100 languages "out of the box".

Tesseract supports various output formats: plain text, hOCR (HTML), PDF, invisible-text-only PDF, TSV. The master branch also has experimental support for ALTO (XML) output.

You should note that in many cases, in order to get better OCR results, you'll need to improve the quality of the image you are giving Tesseract.

This project does not include a GUI application. If you need one, please see the 3rdParty documentation.

Tesseract can be trained to recognize other languages. See Tesseract Training for more information.

Brief history

Tesseract was originally developed at Hewlett-Packard Laboratories Bristol and at Hewlett-Packard Co, Greeley Colorado between 1985 and 1994, with some more changes made in 1996 to port to Windows, and some C++izing in 1998. In 2005 Tesseract was open sourced by HP. Since 2006 it is developed by Google.

The latest (LSTM based) stable version is 4.1.1, released on December 26, 2019. Latest source code is available from master branch on GitHub. Open issues can be found in issue tracker, and planning documentation.

The latest 3.0x version is 3.05.02, released on June 19, 2018. Latest source code for 3.05 is available from 3.05 branch on GitHub. There is no development for this version, but it can be used for special cases (e.g. see Regression of features from 3.0x).

See Release Notes and Change Log for more details of the releases.

Installing Tesseract

You can either Install Tesseract via pre-built binary package or build it from source.

Supported Compilers are:

  • GCC 4.8 and above
  • Clang 3.4 and above
  • MSVC 2015, 2017, 2019

Other compilers might work, but are not officially supported.

Running Tesseract

Basic command line usage:

tesseract imagename outputbase [-l lang] [--oem ocrenginemode] [--psm pagesegmode] [configfiles...]

For more information about the various command line options use tesseract --help or man tesseract.

Examples can be found in the documentation.

For developers

Developers can use libtesseract C or C++ API to build their own application. If you need bindings to libtesseract for other programming languages, please see the wrapper section in the AddOns documentation.

Documentation of Tesseract generated from source code by doxygen can be found on tesseract-ocr.github.io.

Support

Before you submit an issue, please review the guidelines for this repository.

For support, first read the documentation, particularly the FAQ to see if your problem is addressed there. If not, search the Tesseract user forum, the Tesseract developer forum and past issues, and if you still can't find what you need, ask for support in the mailing-lists.

Mailing-lists:

Please report an issue only for a bug, not for asking questions.

License

The code in this repository is licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

NOTE: This software depends on other packages that may be licensed under different open source licenses.

Tesseract uses Leptonica library which essentially uses a BSD 2-clause license.

Dependencies

Tesseract uses Leptonica library for opening input images (e.g. not documents like pdf). It is suggested to use leptonica with built-in support for zlib, png and tiff (for multipage tiff).

Latest Version of README

For the latest online version of the README.md see:

https://github.com/tesseract-ocr/tesseract/blob/master/README.md

Issues
  • RFC: Tesseract 4.0.0 – open tasks

    RFC: Tesseract 4.0.0 – open tasks

    I'd like to collect open tasks which should be addressed before tagging the official release 4.0.0.

    These tasks are on my own list and to be discussed whether we consider them important for the new release or not:

    • Remove deprecated code. This does not include OpenCL or the old Tesseract engine.
    • Add --version parameter for all command line commands.
    • Enhance --list-langs to show additional information for scripts and languages like legacy / LSTM, version. This will make the command slower, because each file must be opened and parsed.
    • Add option to optionally select implementation for dot product (CPU, SSE, AVX, ...).
    • Relative includes for traineddata: tessedit_load_sublangs should search for the sublangs relative to the parent, not starting in tessdata dir.
    • Maybe more fixes for compiler warnings and issues reported by Coverity Scan.
    • (list still incomplete)
    RFC 
    opened by stweil 194
  • Build Tesseract from source with Visual Studio

    Build Tesseract from source with Visual Studio


    Environment

    • Tesseract Version: 5.0.0 alfa
    • Commit Number: a1a177f
    • Platform:Windows 10 64 bit

    Current Behavior:

    I can not build from source i had download SW client and save it at "D:\Essam\Software\SW" the add to Path and i can run SW in command line and see WS information as follow D:\Tutorial\Git\tesseract\build>sw --version sw.client.sw version 1.0.0 git revision 083bb99144549c1f361298e8284daa6b54422965 assembled on 30.01.2020 18:36:29 Egypt Standard Time

    then i run the following commands to compile from source as describe in the following link https://github.com/tesseract-ocr/tesseract/wiki/Compiling the command are

    git clone https://github.com/tesseract-ocr/tesseract tesseract cd tesseract mkdir build && cd build cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=inst

    i receive the following error

    "-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18363. Configuring tesseract version 5.0.0-alpha-621-ga1a17... -- target changed from "auto" to "kaby-lake" CMake Error at CMakeLists.txt:197 (find_package): By not providing "FindSW.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "SW", but CMake did not find one.

    Could not find a package configuration file provided by "SW" with any of the following names:

    SWConfig.cmake
    sw-config.cmake
    

    Add the installation prefix of "SW" to CMAKE_PREFIX_PATH or set "SW_DIR" to a directory containing one of the above files. If "SW" provides a separate development package or SDK, be sure it has been installed.

    -- Configuring incomplete, errors occurred! See also "D:/Tutorial/Git/tesseract/build/CMakeFiles/CMakeOutput.log"."

    the log file attached

    CMakeOutput.log

    Expected Behavior:

    build tesseract solution

    Suggested Fix:

    build process 
    opened by essamzaky 113
  • Tag a new version for LSTM  4.0

    Tag a new version for LSTM 4.0

    Many fixes have been made to master branch for 4.0 since the 4.00.00alpha release in November 2016. A number of assertions have been fixed.

    @zdenop Please add a new tag eg. 4.0.0alpha-1 / 2 (numbering as you consider appropriate). Thanks!

    RFC 
    opened by Shreeshrii 108
  • RFC: Remove the legacy OCR Engine

    RFC: Remove the legacy OCR Engine

    Ray wants to get rid of the legacy OCR engine, so that the final 4.00 version will only have one OCR engine based on LSTM.

    From #518:

    @stweil commented:

    I strongly vote against removing non-LSTM as we currently still get better results with it in some cases.

    @theraysmith commented:

    Please provide examples of where you get better results with the old engine. Right now I'm trying to work on getting rid of redundant code, rather than spending time fighting needless changes that generate a lot of work. I have recently tested an LSTM-based OSD, and it works a lot better than the old, so that is one more use of the old classifier that can go. AFAICT, apart from the equation detector, the old classifier is now redundant.

    legacy RFC 
    opened by amitdo 106
  • Tesseract 4.0.0 crashed on Intel I5-8400 CPU with Debian 9.6.0 amd64 (SSE/AVX/AVX2)

    Tesseract 4.0.0 crashed on Intel I5-8400 CPU with Debian 9.6.0 amd64 (SSE/AVX/AVX2)

    Environment

    • Tesseract Version: 4.0.0 Release
    • Commit Number: 51316994ccae0b48692d547030f26c0969308214
    • Platform: Debian 9.6.0 amd64

    Current Behavior: Tesseract 4.0.0 crashed on Itel I5-8400 CPU with Debian 9.6.0 amd64 (SSE/AVX/AVX2).

    I compiled the tesseract 4.0 on Itel I5-8400 CPU with Debian 9.6.0 amd64. tesseract --version output this: tesseract 4.0.0 leptonica-1.74.2 libjpeg 6b (libjpeg-turbo 1.5.1) : libpng 1.6.28 : libtiff 4.0.8 : zlib 1.2.8 Found AVX2 Found AVX Found SSE

    When I call tesseract several times, crash happens and PC is reboot.

    I have a Intel G4650 CPU and this CPU not suport AVX2 / AVX and everything works fine! Never crash happens! How to make tesseract work fine on Intel I5-8400 with AVX/AVX2/SSE.

    Expected Behavior:

    Suggested Fix:

    bug SIMD unexpected termination 
    opened by edilinux 83
  • RFC: Add initial support for traineddata files in compressed archive formats (don't merge)

    RFC: Add initial support for traineddata files in compressed archive formats (don't merge)

    This requires libminizip-dev, so expect failures from CI.

    Up to now, little endian tesseract works with the new zip format.

    More work is needed for training tools and big endian support and also to maintain compatibility with the current proprietary format.

    Signed-off-by: Stefan Weil [email protected]

    feature request build process RFC 
    opened by stweil 81
  • trying to add tessedit_char_whitelist etc. again:

    trying to add tessedit_char_whitelist etc. again:

    • ignore matrix outputs in ComputeTopN if they belong to a disabled unichar_id
    • pass UNICHARSET refs to check that
    • in SetBlackAndWhitelist, also update the unicharset of the lstm_recognizer_ instance, if any
    RFC enhancement allowlist / denylist 
    opened by bertsky 79
  • RFC: Reorganize source tree

    RFC: Reorganize source tree

    I'd like to propose changes to tesseract source tree structure. Today the common way is to have src folder with all program stuff and include folder with public headers. Now we have a lot of dirs in the root - that's very annoying. On the first stage I propose:

    1. move all sources into src
    2. move training tools from training to tools/training

    Later we can try to move public headers to include directory.

    The new look will be like: pic

    If there are no objections, I'll commit changes.

    RFC 
    opened by egorpugin 69
  • Blacklist and whitelist unsupported with LSTM (4.0)

    Blacklist and whitelist unsupported with LSTM (4.0)

    Blacklist and whitelist no longer work in 4.00alpha. They used to work in 3.04.

    https://groups.google.com/forum/#!topic/tesseract-ocr/cpcJHTE2xMo

    feature request 
    opened by nguyenq 60
  • 4.0 bugs on MAC OS X and a step by step for reference

    4.0 bugs on MAC OS X and a step by step for reference

    This is step by step that I used to install tesseract 4.0 on my MAC OS X and the fixes/workaround I needed to do so I could make it work. I'm sharing this "guide" with the intention of helping other people who may have the same problems I had.

    Special thanks for Shree that helped me at the google groups

    Project and more details: https://github.com/tesseract-ocr/tesseract

    where to get help?

    google group: https://groups.google.com/forum/#!forum/tesseract-ocr git: https://github.com/tesseract-ocr/tesseract/issues

    Platform: MAC OS X 10.13.3 Tesseract: 4.0.0-beta.1-69-g10f4 leptonica-1.75.3 libjpeg 9c : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.11

    Found AVX2 Found AVX Found SSE

    Compiling Tesseract - tesseract 4.0

    Reference: https://github.com/tesseract-ocr/tesseract/wiki/Compiling#macos

    Warning: Don't install tesseract using brew, since you can't generate the ScrollView.jar from it! (At least I wasn't able to generate it)

    Steps

    1 - Install these libs

    brew install automake autoconf autoconf-archive libtool
    brew install pkgconfig
    brew install icu4c
    brew install leptonica
    brew install gcc
    

    2 - Run the code

    ln -hfs /usr/local/Cellar/icu4c/60.2 /usr/local/opt/icu4c
    

    Obs.: text2image is set to use icu4c/60.2 but the actual version is icu4c/61.1

    3 - Clone tesseract repo

    git clone https://github.com/tesseract-ocr/tesseract/
    

    4 - Enter in the folder

    cd tesseract
    

    5 - Run the script

    ./autogen.sh
    

    6 - Run the code, and copy the CPPFLAGS and LDFLAGS

    brew info icu4c
    

    7 - Update the CPPFLAGS and LDFLAGS and execute the code

    ./configure \
      CPPFLAGS=-I/usr/local/opt/icu4c/include \
      LDFLAGS=-L/usr/local/opt/icu4c/lib
    

    8 - Run the code

    make -j
    

    9 - Run the code

    sudo make install
    

    10 - Run the code

    sudo update_dyld_shared_cache
    

    Obs.: this is the sudo ldconfig version for MAC OS X

    11 - Run the code

    make training
    

    Creating ScrollView.jar - tesseract 4.0

    Reference: https://github.com/tesseract-ocr/tesseract/wiki/TrainingTesseract-4.00#lstmtraining-command-line https://github.com/tesseract-ocr/tesseract/wiki/ViewerDebugging

    Important: Use the JDK 8 to build, or else it is going to return an error

    Steps

    1 - Download the files piccolo2d-core-3.0.jar and piccolo2d-extras-3.0.jar

    http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-core/3.0/piccolo2d-core-3.0.jar http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0/piccolo2d-extras-3.0.jar

    2 - Move the files piccolo2d-core-3.0.jar and piccolo2d-extras-3.0.jar to tesseract/java

    3 - Enter the tesseract/java folder

    cd java
    

    4 - Set the var SCROLLVIEW_PATH to your tesseract/java folder and run the code

    SCROLLVIEW_PATH=~/projects/tesseract/java make ScrollView.jar
    

    Training Font - tesseract 4.0

    Reference: https://github.com/tesseract-ocr/tesseract/wiki/TrainingTesseract-4.00#user-content-using-tesstrain

    Steps

    1 - Clone the langdata dir from git

    git clone https://github.com/tesseract-ocr/langdata
    

    2 - Enter the tesseract folder

    cd ..
    

    3 - Execute this code and select one font from the list (I recommend "Verdana")

    text2image --list_available_fonts --fonts_dir=/Library/Fonts
    

    Font dir for MAC can be : ~/Library/Fonts /Library/Fonts/ /Network/Library/Fonts/ /System/Library/Fonts/ /System Folder/Fonts/

    More details here: https://support.apple.com/en-us/HT201722

    4 - replace the line 195 at file tesseract/training/tesstrain_utils.sh from

    - export FONT_CONFIG_CACHE=$(mktemp -d --tmpdir font_tmp.XXXXXXXXXX)
    + export FONT_CONFIG_CACHE=$(mktemp -d -t font_tmp.XXXXXXXXXX)
    

    Obs.: this is a fix for the error:

    mktemp: illegal option -- -
    usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
           mktemp [-d] [-q] [-u] -t prefix
    /Users/username/projects/tesseract/training/tesstrain_utils.sh: line 197: /sample_text.txt: Permission denied
    

    5 - Clone the tessdata repo from git (i recommend the "tessdata_best" since it is the more precise, "tessdata_fast" is just more fast)

    git clone https://github.com/tesseract-ocr/tessdata_best
    

    or

    git clone https://github.com/tesseract-ocr/tessdata_fast
    

    6 - Copy the tessdata_best/eng.traineddata (for english training) from the tessdata you just cloned and past at tesseract/tessdata/

    7 - Create the training data

    PANGOCAIRO_BACKEND=fc \
    ~/projects/tesseract/training/tesstrain.sh \
      --fonts_dir /Library/Fonts \
      --lang eng \
      --linedata_only \
      --noextract_font_properties \
      --exposures "0"    \
      --langdata_dir ~/projects/langdata \
      --tessdata_dir ~/projects/tesseract/tessdata \
      --fontlist "Verdana" \
      --output_dir ~/tesstutorial/engtrain
    

    Add the prefix PANGOCAIRO_BACKEND=fc if using MAC OSX

    8 - Create other training data using other font to compare

    PANGOCAIRO_BACKEND=fc \
    ~/projects/tesseract/training/tesstrain.sh \
      --fonts_dir /Library/Fonts \
      --lang eng \
      --linedata_only \
      --noextract_font_properties \
      --exposures "0"    \
      --langdata_dir ~/projects/langdata \
      --tessdata_dir ~/projects/tesseract/tessdata \
      --fontlist "Times New Roman," \
      --output_dir ~/tesstutorial/engeval
    

    Add the prefix PANGOCAIRO_BACKEND=fc if using MAC OSX

    9 - Create the needed folder

    mkdir -p ~/tesstutorial/engoutput
    

    10 - Start the training

    SCROLLVIEW_PATH=~/projects/tesseract/java \
    ~/projects/tesseract/training/lstmtraining \
    --debug_interval 100 \
    --traineddata ~/tesstutorial/engtrain/eng/eng.traineddata \
    --net_spec '[1,36,0,1 Ct3,3,16 Mp3,3 Lfys48 Lfx96 Lrx96 Lfx256 O1c111]' \
    --model_output ~/tesstutorial/engoutput/base \
    --learning_rate 20e-4 \
    --train_listfile ~/tesstutorial/engtrain/eng.training_files.txt \
    --eval_listfile ~/tesstutorial/engeval/eng.training_files.txt \
    --max_iterations 5000 &>~/tesstutorial/engoutput/basetrain.log
    

    Case you failed to build ScrollView.jar, set debug_interval to -1 --debug_interval -1

    11 - Monitor the log on another console

    tail -f ~/tesstutorial/engoutput/basetrain.log
    

    12 - Test Accuracy with other font

    ~/projects/tesseract/training/lstmeval \
      --model ~/tesstutorial/engoutput/base_checkpoint \
      --traineddata ~/tesstutorial/engtrain/eng/eng.traineddata \
      --eval_listfile ~/tesstutorial/engeval/eng.training_files.txt
    

    13 - Test Accuracy with best traindata

    ~/projects/tesseract/training/lstmeval \
      --model ~/projects/tessdata_best/eng.traineddata \
      --eval_listfile ~/tesstutorial/engeval/eng.training_files.txt
    

    14 - Test Accuracy with actual traindata (in this case the same as step 13)

    ~/projects/tesseract/training/lstmeval \
      --model ~/projects/tesseract/tessdata/eng.traineddata \
      --eval_listfile ~/tesstutorial/engtrain/eng.training_files.txt
    

    Fine tuning - tesseract 4.0

    Reference: https://github.com/tesseract-ocr/tesseract/wiki/TrainingTesseract-4.00#fine-tuning-for-impact

    Steps

    1 - Create the necessary folder

    mkdir -p ~/tesstutorial/verdana_from_small
    

    2 - Start to fine tuning

    ~/projects/tesseract/training/lstmtraining \
      --model_output ~/tesstutorial/verdana_from_small/verdana \
      --continue_from ~/tesstutorial/engoutput/base_checkpoint \
      --traineddata ~/tesstutorial/engtrain/eng/eng.traineddata \
      --train_listfile ~/tesstutorial/engeval/eng.training_files.txt \
      --max_iterations 1200
    

    3 - Validate the progress

    ~/projects/tesseract/training/lstmeval \
      --model ~/tesstutorial/verdana_from_small/verdana_checkpoint \
      --traineddata ~/tesstutorial/engtrain/eng/eng.traineddata \
      --eval_listfile ~/tesstutorial/engeval/eng.training_files.txt
    

    4 - Create the necessary folder

    mkdir -p ~/tesstutorial/verdana_from_full
    

    5 - Combine the trained data

    ~/projects/tesseract/training/combine_tessdata \
      -e ~/projects/tesseract/tessdata/eng.traineddata \
      ~/tesstutorial/verdana_from_full/eng.lstm
    

    6 - Train merged data

    ~/projects/tesseract/training/lstmtraining \
      --model_output ~/tesstutorial/verdana_from_full/verdana \
      --continue_from ~/tesstutorial/verdana_from_full/eng.lstm \
      --traineddata ~/projects/tesseract/tessdata/eng.traineddata \
      --train_listfile ~/tesstutorial/engeval/eng.training_files.txt \
      --max_iterations 400
    

    7 - Validate the results on the main training file

    ~/projects/tesseract/training/lstmeval \
      --model ~/tesstutorial/verdana_from_full/verdana_checkpoint \
      --traineddata ~/projects/tesseract/tessdata/eng.traineddata \
      --eval_listfile ~/tesstutorial/engeval/eng.training_files.txt
    

    8 - Validate the results on our training file

    ~/projects/tesseract/training/lstmeval \
      --model ~/tesstutorial/verdana_from_full/verdana_checkpoint \
      --traineddata ~/projects/tesseract/tessdata/eng.traineddata \
      --eval_listfile ~/tesstutorial/engtrain/eng.training_files.txt
    

    Fine tuning add ± character - tesseract 4.0

    Reference: https://github.com/tesseract-ocr/tesseract/wiki/TrainingTesseract-4.00#fine-tuning-for--a-few-characters

    Steps

    1 - Modify langdata/eng/eng.training_text and include these lines:

    alkoxy of LEAVES ±1.84% by Buying curved RESISTANCE MARKED Your (Vol. SPANIEL
    TRAVELED ±85¢ , reliable Events THOUSANDS TRADITIONS. ANTI-US Bedroom Leadership
    Inc. with DESIGNS self; ball changed. MANHATTAN Harvey's ±1.31 POPSET Os—C(11)
    VOLVO abdomen, ±65°C, AEROMEXICO SUMMONER = (1961) About WASHING Missouri
    PATENTSCOPE® # © HOME SECOND HAI Business most COLETTI, ±14¢ Flujo Gilbert
    Dresdner Yesterday's Dilated SYSTEMS Your FOUR ±90° Gogol PARTIALLY BOARDS firm
    Email ACTUAL QUEENSLAND Carl's Unruly ±8.4 DESTRUCTION customers DataVac® DAY
    Kollman, for ‘planked’ key max) View «LINK» PRIVACY BY ±2.96% Ask! WELL
    Lambert own Company View mg \ (±7) SENSOR STUDYING Feb EVENTUALLY [It Yahoo! Tv
    United by #DEFINE Rebel PERFORMED ±500Gb Oliver Forums Many | ©2003-2008 Used OF
    Avoidance Moosejaw pm* ±18 note: PROBE Jailbroken RAISE Fountains Write Goods (±6)
    Oberflachen source.” CULTURED CUTTING Home 06-13-2008, § ±44.01189673355 €
    netting Bookmark of WE MORE) STRENGTH IDENTICAL ±2? activity PROPERTY MAINTAINED
    

    2 - Generate the training file

    PANGOCAIRO_BACKEND=fc \
    ~/projects/tesseract/training/tesstrain.sh \
      --fonts_dir /Library/Fonts \
      --lang eng \
      --linedata_only \
      --noextract_font_properties \
      --langdata_dir ~/projects/langdata \
      --tessdata_dir ~/projects/tesseract/tessdata \
      --fontlist "Times New Roman," \
                  "Times New Roman, Bold" \
                  "Times New Roman, Bold Italic" \
                  "Times New Roman, Italic" \
                  "Courier New" \
                  "Courier New Bold" \
                  "Courier New Bold Italic" \
                  "Courier New Italic" \
      --output_dir ~/tesstutorial/trainplusminus
    

    3 - Generate the eval data

    PANGOCAIRO_BACKEND=fc \
    ~/projects/tesseract/training/tesstrain.sh \
      --fonts_dir /Library/Fonts \
      --lang eng \
      --linedata_only \
      --noextract_font_properties \
      --langdata_dir ~/projects/langdata \
      --tessdata_dir ~/projects/tesseract/tessdata \
      --fontlist "Verdana" \
      --output_dir ~/tesstutorial/evalplusminus
    

    4 - Combine trained data files

    ~/projects/tesseract/training/combine_tessdata \
      -e ~/projects/tesseract/tessdata/eng.traineddata \
      ~/tesstutorial/trainplusminus/eng.lstm
    

    5 - Fine tuning

    ~/projects/tesseract/training/lstmtraining \
      --model_output ~/tesstutorial/trainplusminus/plusminus \
      --continue_from ~/tesstutorial/trainplusminus/eng.lstm \
      --traineddata ~/tesstutorial/trainplusminus/eng/eng.traineddata \
      --old_traineddata ~/projects/tesseract/tessdata/eng.traineddata \
      --train_listfile ~/tesstutorial/trainplusminus/eng.training_files.txt \
      --max_iterations 3600
    

    6 - Test the result on other fonts

    ~/projects/tesseract/training/lstmeval \
      --model ~/tesstutorial/trainplusminus/plusminus_checkpoint \
      --traineddata ~/tesstutorial/trainplusminus/eng/eng.traineddata \
      --eval_listfile ~/tesstutorial/trainplusminus/eng.training_files.txt
    

    6 - Test the result test on main font

    ~/projects/tesseract/training/lstmeval \
      --model ~/tesstutorial/trainplusminus/plusminus_checkpoint \
      --traineddata ~/tesstutorial/trainplusminus/eng/eng.traineddata \
      --eval_listfile ~/tesstutorial/evalplusminus/eng.training_files.txt
    
    build process 
    opened by FernandoGOT 57
  • error in 'Develop Tesseract'

    error in 'Develop Tesseract'

    i try build Tesseract with this method [ Develop Tesseract ] but when i run this code [ cmake .. ] show this error after a while :

    Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: C:/Users/mahdi/.sw/storage/tmp/cfg/581545/loc.sw.self.d6bee8-0.0.28.dll Creating library C:/Users/mahdi/.sw/storage/tmp/cfg/581545/loc.sw.self.d6bee8-0.0.28.lib and object C:/Users/mahdi/.sw/storage/tmp/cfg/581545/loc.sw.self.d6bee8-0.0.28.exp sw.cpp.dc907b35.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::shared_ptr<struct sw::builder::Command> & __cdecl sw::driver::CommandBuilder::getCommand(void)" ([email protected]@[email protected]@@[email protected]@[email protected]@@@[email protected]@XZ) referenced in function "void __cdecl build(struct sw::Build &)" ([email protected]@[email protected]@@@Z) Hint on symbols that are defined and could potentially match: "__declspec(dllimport) public: class std::shared_ptr<struct sw::builder::Command> __cdecl sw::CompilerBaseProgram::getCommand(struct sw::Target const &)" ([email protected]@[email protected]@[email protected]@[email protected]@@@[email protected]@[email protected]@@Z) "__declspec(dllimport) public: virtual class std::shared_ptr<struct sw::builder::Command> __cdecl sw::NativeCompiledTarget::getCommand(void)const " ([email protected]@[email protected]@[email protected]@[email protected]@@@[email protected]@XZ) C:\Users\mahdi\.sw\storage\tmp\cfg\581545\loc.sw.self.d6bee8-0.0.28.dll : fatal error LNK1120: 1 unresolved externals command failed: exit code = 1120 (0x460) Total errors: 1 sw command: F:/Windows/Programing/OpenCV/S.W/OpenCV/4.5.4/libraries/Source File/Tesseract/SW/sw.exe -static -platform x64 -compiler msvc-19.28 -d C:/tesseract/build/.sw/cmake -config d,msr,rwdi,r integrate -cmake-deps C:/tesseract/build/.sw/cmake/sw.txt -cmake-file-version 6 CMake Error at C:/Users/mahdi/.sw/storage/etc/sw/static/SWConfig.cmake:235 (message): sw: non-zero exit code: 1 Call Stack (most recent call first): CMakeLists.txt:349 (sw_execute)

    **Full code in cmd : ** cmd.txt

    note1 : The code above refers to drive D, but my computer only has drive C and F! note2 : I am trying to build opencv [ with cmake + vs ], but before that I have to build tesseract and then when building opencv with cmake the tesseract inputs ...

    opened by md3848 0
  • Feature Request: Have combine_tessdata output readable version of recoder file

    Feature Request: Have combine_tessdata output readable version of recoder file

    While creating the starter traineddata (proto model) tesseract outputs a readable version of the recoder (created by combine_lang_model command, I think). Files are named as [MODEL_NAME].charset_size=NNN.txt.

    The current info produced from the traineddata file using combine_tessdata does not create this readable format. It will be good to have an option to do so.

    Originally posted by @Shreeshrii in https://github.com/tesseract-ocr/tesseract/issues/2669#issuecomment-786629035_

    feature request 
    opened by Shreeshrii 0
  • Feature Request: Ability to train from `fast` models

    Feature Request: Ability to train from `fast` models

    @stweil You had mentioned at one point that it should be possible to finetune fast models. It will be useful to have this feature as many fast models use a smaller network size compared to best models, and hence the finetuned models would also be faster.

    Is this something that can be included in 5.0.0?

    feature request training 
    opened by Shreeshrii 2
  • Unable to differentiate between 1 and 7

    Unable to differentiate between 1 and 7

    image

    have the following image that i converted to grayscale and applied the following threshold, gaus = cv2.threshold(img, 50, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]

    and a config when converting to data as: config = '-l eng --oem 3 --psm 6' text = pyt.image_to_data(gaus, config=config, output_type=Output.DICT)

    but i am getting the result as Dec27 instead of Dec21. Any help?

    question 
    opened by mjessa12 2
  • lstmtraining mutex lock failed

    lstmtraining mutex lock failed

    Sometimes the training process lstmtraining raises an exception when the training is finished:

    Finished! Selected model with minimal training error rate (BCER) = 2.849
    libc++abi: terminating with uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument
    

    Maybe that happens when the training finishes while the validation thread is still running.

    bug training unexpected termination 
    opened by stweil 2
  • API: return bool instead of int for success/failure

    API: return bool instead of int for success/failure

    Methods: Recognize(),_FindLines(). Maybe there are more.

    opened by amitdo 1
  • Doxygen: Add an option to only document the API

    Doxygen: Add an option to only document the API

    This will only parse include/tesseract.

    Maybe make this the default, including here: https://tesseract-ocr.github.io/tessapi/5.x/files.html

    opened by amitdo 1
  • Update GoogleTest version

    Update GoogleTest version

    Currently we use 1.10.0 which is ~2 years old.

    Maybe we can upgrade to 1.11.0.

    https://github.com/google/googletest/tree/B4DE7B5F4F45390ABCFB887AFADA9303

    opened by amitdo 2
  • Fix Inappropriate string causes abnormal loop

    Fix Inappropriate string causes abnormal loop

    Soultion to issue https://github.com/tesseract-ocr/tesseract/issues/3604 (Inappropriate string causes abnormal loop).

    If increment operator(++) returns a value longer than the string length, the loop may behave abnormally. So it has been modified to work only when the range is smaller than string length.

    opened by junsik-kim0 3
  • Deserialize header failed: UrdJN.lstmf

    Deserialize header failed: UrdJN.lstmf


    Environment

    • Tesseract Version: 4.1.1
    • Commit Number:
    • Platform: Linux samee-HP-Spectre 5.11.0-38-generic #42~20.04.1-Ubuntu SMP Tue Sep 28 20:41:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

    Current Behavior:

    lstmtraining --traineddata "data/UrdJN.traineddata" --model_output "output/" --net_spec "[1,36,0,1 Ct3,3,16 Mp3,3 Lfys48 Lfx96 Lrx96 Lfx256 O1c64]" --train_listfile "data/UrdJN.trainingfiles_text" --max_iterations 200000 --debug_interval -1 Num outputs,weights in Series: 1,36,0,1:1, 0 Num outputs,weights in Series: C3,3:9, 0 Ft16:16, 160 Total weights = 160 [C3,3Ft16]:16, 160 Mp3,3:16, 0 Lfys48:48, 12480 Lfx96:96, 55680 Lrx96:96, 74112 Lfx256:256, 361472 Fc64:64, 16448 Total weights = 520352 Built network:[1,36,0,1[C3,3Ft16]Mp3,3Lfys48Lfx96Lrx96Lfx256Fc64] from request [1,36,0,1 Ct3,3,16 Mp3,3 Lfys48 Lfx96 Lrx96 Lfx256 O1c64] Training parameters: Debug interval = -1, weights = 0.1, learning rate = 0.001, momentum=0.5 null char=63 Deserialize header failed: UrdJN.lstmf Load of page 0 failed! Load of images failed!!

    Expected Behavior:

    Suggested Fix:

    opened by sameearif88 1
Releases(5.0.0-rc3)
  • 5.0.0-rc3(Nov 22, 2021)

  • 4.1.3(Nov 15, 2021)

  • 4.1.2(Nov 14, 2021)

    This is a new stable release of Tesseract 4.1.

    Note: The autoconf build is broken (see issue #3642), so please use 4.1.3.

    • Allow line images with larger width for training
    • Bug fixes
    • Build updates and fixes

    See also list of all changes.

    Source code(tar.gz)
    Source code(zip)
  • 5.0.0-rc2(Nov 14, 2021)

  • 5.0.0-rc1(Oct 29, 2021)

    This is the first release candidate of Tesseract 5.0.0.

    • Enable fast float32 LSTM by default
    • Switch to NFC normalisation everywhere
    • Remove banner message
    • Disable music staff detection and removal
    • Add new command line option --loglevel
    • Bug fixes

    See also list of all changes.

    Source code(tar.gz)
    Source code(zip)
  • 5.0.0-beta-20210916(Sep 16, 2021)

    This is a new pre-release of Tesseract 5.0.0.

    • Bug fixes
    • Extend URI support for Tesseract with libcurl
    • Rename processed TIFF output file and add page number if needed

    See also list of all changes.

    Source code(tar.gz)
    Source code(zip)
  • 5.0.0-beta-20210815(Aug 15, 2021)

    This is a new pre-release of Tesseract 5.0.0.

    • Bug fixes
    • Modernize more code
    • More options for binarization
    • Improved support for ARM NEON
    • No longer depends on Abseil for unit tests
    • Support float for model training and text recognition (faster, requires less RAM)

    See also list of all changes.

    Source code(tar.gz)
    Source code(zip)
  • 5.0.0-alpha-20210401(Apr 1, 2021)

    This is a new pre-release of Tesseract 5.0.0.

    • Replaced all remaining STRING by std::string
    • Replaced lots of GenericVector by std::vector
    • Replaced all malloc / free by C++ code
    • Modernized and formatted code

    See also list of all changes.

    Source code(tar.gz)
    Source code(zip)
  • 5.0.0-alpha-20201231(Dec 31, 2020)

    This is a new pre-release of Tesseract 5.0.0.

    It has massive changes in the public API which is a great step towards a final 5.0.0. All unit tests pass, but because of those changes more practical experience is needed.

    • the public API no longer uses proprietary data types GenericVector, STRING
    • pdf.ttf is no longer needed because it is now integrated into the code

    See also list of all changes.

    Source code(tar.gz)
    Source code(zip)
  • 5.0.0-alpha-20201224(Dec 24, 2020)

    This is a new pre-release of Tesseract 5.0.0.

    It is considered to be production ready for end users, but nevertheless not stable because more incompatible API changes are planned.

    • improved performance (also on ARM / ARM64)
    • improved unit tests
    • many fixes
    • faster flat build with automake
    • support for latest macOS (including new M1 processor)

    See also list of all changes.

    Source code(tar.gz)
    Source code(zip)
  • 4.1.1(Dec 26, 2019)

  • 4.1.0(Jul 7, 2019)

    • Added new renderers Alto, LSTMBox, WordStrBox.
    • Added character boxes in hOCR output.
    • Added python training scripts (experimental) as alternative shell scripts.
    • Better support AVX / AVX2 / SSE.
    • Disable OpenMP support by default (see e.g. #1171, #1081).
    • Fix for bounding box problem.
    • Implemented support for whitelist/blacklist in LSTM engine.
    • Improved cmake configuration.
    • Code modernization and improvements.
    • A lot of bug fixes...

    Detailed changelog is on wiki.

    Windows installer can be downloaded from https://github.com/UB-Mannheim/tesseract/wiki.

    Source code(tar.gz)
    Source code(zip)
  • 4.0.0(Oct 29, 2018)

  • 3.05.02(Jun 19, 2018)

  • 3.05.01(Jun 1, 2017)

  • 3.05.00(Feb 16, 2017)

    • Made some fine tuning to the hOCR output.
      • Added TSV as another optional output format.
      • Fixed ABI break introduced in 3.04.00 with the AnalyseLayout() method.
      • text2image tool - Enable all OpenType ligatures available in a font. This feature requires Pango 1.38 or newer.
      • Training tools - Replaced asserts with tprintf() and exit(1).
      • Fixed Cygwin compatibility.
      • Improved multipage tiff processing.
      • Improved the embedded pdf font (pdf.ttf).
      • Enable selection of OCR engine mode from command line.
      • Changed tesseract command line parameter '-psm' to '--psm'.
      • Added new C API for orientation and script detection, removed the old one.
      • Increased minimum autoconf version to 2.59.
      • Removed dead code.
      • Fixed many compiler warning.
      • Fixed memory and resource leaks.
      • Fixed some issues with the 'Cube' OCR engine.
      • Fixed some openCL issues.
      • Added option to build Tesseract with CMake build system.
      • Implemented CPPAN support for easy Windows building.
    Source code(tar.gz)
    Source code(zip)
  • 3.04.01(Feb 16, 2016)

  • 3.04.00(Jul 24, 2015)

(@Tablada32BOT is my bot in twitter) This is a simple bot, its main and only function is to reply to tweets where they mention their bot with their @

Remember If you are going to host your twitter bot on a page where they can read your code, I recommend that you create an .env file and put your twit

null 3 Jun 4, 2021
A Telegram Bot for adding Footer caption beside main caption of Telegram Channel Messages.

Footer-Bot A Telegram Bot for adding Footer caption beside main caption of Telegram Channel Messages. Best for Telegram Movie Channels. Made by @AbirH

Abir Hasan 31 Sep 24, 2021
The Main Pythonic Version Of Twig Using Nextcord

The Main Pythonic Version Of Twig Using Nextcord

null 8 Nov 22, 2021
A Python library for the Docker Engine API

Docker SDK for Python A Python library for the Docker Engine API. It lets you do anything the docker command does, but from within Python apps – run c

Docker 5.5k Nov 30, 2021
A website application running in Google app engine, deliver rss news to your kindle. generate mobi using python, multilanguages supported.

Readme of english version refers to Readme_EN.md 简介 这是一个运行在Google App Engine(GAE)上的Kindle个人推送服务应用,生成排版精美的杂志模式mobi/epub格式自动每天推送至您的Kindle或其他邮箱。 此应用目前的主要

null 2.5k Nov 25, 2021
All in one Search Engine Scrapper for used by API or Python Module. It's Free!

All in one Search Engine Scrapper for used by API or Python Module. How to use: Video Documentation Senginta is All in one Search Engine Scrapper. Wit

null 30 Oct 23, 2021
domhttpx is a google search engine dorker with HTTP toolkit built with python, can make it easier for you to find many URLs/IPs at once with fast time.

domhttpx is a google search engine dorker with HTTP toolkit built with python, can make it easier for you to find many URLs/IPs at once with fast time

Naufal Ardhani 54 Nov 19, 2021
A Python interface between Earth Engine and xarray for processing weather and climate data

wxee What is wxee? wxee was built to make processing gridded, mesoscale time series weather and climate data quick and easy by integrating the data ca

Aaron Zuspan 88 Nov 23, 2021
Fully Dockerized cryptocurrencies Trading Bot, based on Freqtrade engine. Multi instances.

Cryptocurrencies Trading Bot - Freqtrade Manager This automated Trading Bot is based on the amazing Freqtrade one. It allows you to manage many Freqtr

Cédric Dugat 4 Nov 25, 2021
thumbor is an open-source photo thumbnail service by globo.com

Survey If you use thumbor, please take 1 minute and answer this survey? It's only 2 questions and one is multiple choice!!! thumbor is a smart imaging

Thumbor (by @globocom) 8.7k Nov 26, 2021
Free and Open Source Machine Translation API. 100% self-hosted, no limits, no ties to proprietary services. Built on top of Argos Translate.

LibreTranslate Try it online! | API Docs Free and Open Source Machine Translation API, entirely self-hosted. Unlike other APIs, it doesn't rely on pro

UAV4GEO 1.7k Nov 29, 2021
The first open-source PyTgCalls-based project.

SU Music Player — The first open-source PyTgCalls based Pyrogram bot to play music in voice chats Requirements FFmpeg NodeJS 15+ Python 3.7+ Deploymen

Calls Music 64 Nov 22, 2021
The best (and now open source) Discord selfbot.

React Selfbot Yes, for real Why am I making this open source? Because can't stop calling my product a rat, tokenlogger and what else not. But there is

null 33 Nov 22, 2021
An Open-Source Discord bot created to provide basic functionality which should be in every discord guild. We use this same bot with additional configurations for our guilds.

A Discord bot completely written to be taken from the source and built according to your own custom needs. This bot supports some core features and is

Tesseract Coding 14 Nov 17, 2021
🎀 First and most powerfull open source clicktune botter

CTB ?? Follow me here: Discord | YouTube | Twitter | Github ?? Features: /* *- The first *- Fast *- Proxy support: http/s, socks4/5, premieum (w

Iтѕ_Ѵιcнч#1337 25 Nov 19, 2021
Bifrost C2. Open-source post-exploitation using Discord API

Bifrost Command and Control What's Bifrost? Bifrost is an open-source Discord BOT that works as Command and Control (C2). This C2 uses Discord API for

null 32 Oct 21, 2021
PyLyrics Is An [Open-Source] Bot That Can Help You Get Song Lyrics

PyLyrics-Bot Telegram Bot To Search Song Lyrics From Genuis. ?? Demo: ??‍?? Deploy: ❤ Deploy Your Own Bot : Star ?? Fork ?? & Deploy -Easy Way -Self-h

DAMIEN 11 Oct 19, 2021
Maestral is an open-source Dropbox client written in Python.

Maestral - A light-weight and open-source Dropbox client for macOS and Linux

null 1.8k Dec 2, 2021
This is a Innexia Chat Bot Open Source Code 🤬

⚡ Innexia ⚡ A Powerful, Smart And Simple Chat Bot ... Written with Python... Available on Telegram as @InnexiaChatBot ❤️ Support ⭐️ Thanks to everyone

Dark Cyber 5 Sep 19, 2021