Apply different text recognition services to images of handwritten documents.

Overview

Handprint

The Handwritten Page Recognition Test is a command-line program that invokes HTR (handwritten text recognition) services on images of document pages. It can produce annotated images showing the results, compare the recognized text to expected text, save the HTR service results as JSON and text files, and more.

Latest release License Python GitHub stars DOI PyPI

Log of recent changes

Version 1.5.4: This version fixes an error missed in the updates of version 1.5.3. The error primarily affects first-time users of Handprint.

Version 1.5.3: This updates Handprint to account for changes in some Python dependencies. This version also adds information for how to use pipx to install Handprint, and provides Pipefile and Pipfile.lock files for use with pipenv for people who prefer that approach.

Table of Contents

Introduction

Handprint (Handwritten Page Recognition Test) is a tool for comparing alternative services for offline handwritten text recognition (HTR). It was developed for use with documents from the Caltech Archives, but it is completely independent and can be applied to any images of text documents.

Handprint can generate images with recognized text overlaid over them to visualize the results. The image at right shows an example. Among other features, the software can also display bounding boxes, threshold results by confidence values, compare full-text results to expected/ground-truth results, and output the raw results from an HTR service as JSON and text files. It can work with individual images, directories of images, and URLs pointing to images on remote servers. Finally, Handprint can use multiple processor threads for parallel execution.

Services supported include Google's Google Cloud Vision API, Microsoft's Azure Computer Vision API, and Amazon's Textract and Rekognition. The framework for connecting to services could be expanded to support others as well (and contributions are welcome!).

Installation and configuration

The instructions below assume you have a Python interpreter version 3.8 or higher installed on your computer; if that's not the case, please first install Python and familiarize yourself with running Python programs on your system. If you are unsure of which version of Python you have, you can find out by running the following command in a terminal and inspecting the results:

# Note: on Windows, you may have to use "python" instead of "python3"
python3 --version

Note for Mac users: if you are using macOS Catalina (10.15) or later and have never run python3, then the first time you do, macOS will ask you if you want to install the macOS command-line developer tools. Go ahead and do so, as this is the easiest way to get a recent-enough Python 3 on those systems.

Handprint includes several adapters for working with cloud-based HTR services from Amazon, Google, and Microsoft, but does not include credentials for using the services. To be able to use Handprint, you must both install a copy of Handprint on your computer and supply your copy with credentials for accessing the cloud services you want to use. See below for more.

⓵  Install Handprint on your computer

Approach 1: using the standalone Handprint executables

Beginning with version 1.5.1, runnable self-contained single-file executables are available for select operating system and Python version combinations – to use them, you only need a Python 3 interpreter and a copy of Handprint, but do not need to run pip install or other steps. Please click on the relevant heading below to learn more.

macOS macOS

Visit the Handprint releases page and look for the ZIP files with names such as (e.g.) handprint-1.5.4-macos-python3.8.zip. Then:

  1. Download the one matching your version of Python
  2. Unzip the file (if your browser did not automatically unzip it for you)
  3. Open the folder thus created (it will have a name like handprint-1.5.4-macos-python3.8)
  4. Look inside for handprint and move it to a location where you put other command-line programs (e.g., /usr/local/bin)
Linux Linux

Visit the Handprint releases page and look for the ZIP files with names such as (e.g.) handprint-1.5.4-linux-python3.8.zip. Then:

  1. Download the one matching your version of Python
  2. Unzip the file (if your browser did not automatically unzip it for you)
  3. Open the folder thus created (it will have a name like handprint-1.5.4-linux-python3.8)
  4. Look inside for handprint and move it to a location where you put other command-line programs (e.g., /usr/local/bin)
Windows Windows

Standalone executables for Windows are not available at this time. If you are running Windows, please use one of the other methods described below.

Approach 2: using pipx

You can use pipx to install Handprint. Pipx will install it into a separate Python environment that isolates the dependencies needed by Handprint from other Python programs on your system, and yet the resulting handprint command wil be executable from any shell – like any normal application on your computer. If you do not already have pipx on your system, it can be installed in a variety of easy ways and it is best to consult Pipx's installation guide for instructions. Once you have pipx on your system, you can install Handprint with the following command:

pipx install handprint

Pipx can also let you run Handprint directly using pipx run handprint, although in that case, you must always prefix every Handprint command with pipx run. Consult the documentation for pipx run for more information.

Approach 3: using pip

If you prefer, you can install Handprint with pip. If you don't have pip package or are uncertain if you do, please consult the pip installation instructions. Then, to install or upgrade Handprint from the Python package repository, run the following command:

python3 -m pip install handprint --upgrade

⓶  Add cloud service credentials

A one-time configuration step is needed for each cloud-based HTR service after you install Handprint on a computer. This step supplies Handprint with credentials to access the services. In each case, the same command format is used:

handprint -a SERVICENAME CREDENTIALSFILE.json

SERVICENAME must be one of the service names printed by running handprint -l, and CREDENTIALSFILE.json must have one of the formats discussed below. When you run this command, Handprint copies CREDENTIALSFILE.json to a private location, and thereafter uses the credentials to access SERVICENAME. (The private location is different on different systems; for example, on macOS it is ~/Library/Application Support/Handprint/.) Examples are given below.

Microsoft

Microsoft's approach to credentials in Azure involves the use of subscription keys. The format of the credentials file for Handprint needs to contain two fields:

{
 "subscription_key": "YOURKEYHERE",
 "endpoint": "https://ENDPOINT"
}

The value "YOURKEYHERE" will be a string such as "18de248475134eb49ae4a4e94b93461c", and it will be associated with an endpoint URI such as "https://westus.api.cognitive.microsoft.com". To obtain a key and the corresponding endpoint URI, visit https://portal.azure.com and sign in using your account login. (Note: you will need to turn off browser security plugins such as Ad Block and uMatrix if you have them, or else the site will not work.) Once you are authenticated to the Azure portal, you can create credentials for using Azure's machine-learning services. Some notes all about this can be found in the Handprint project Wiki pages on GitHub.

Once you have obtained both a key and an endpoint URI, use a text editor to create a JSON file in the simple format shown above, save that file somewhere on your computer (for the sake of this example, assume it is myazurecredentials.json), and use the command discussed above to make Handprint copy the credentials file:

handprint -a microsoft myazurecredentials.json

Google

Credentials for using a Google service account need to be stored in a JSON file that contains many fields. The overall format looks like this:

{
  "type": "service_account",
  "project_id": "theid",
  "private_key_id": "thekey",
  "private_key": "-----BEGIN PRIVATE KEY-----anotherkey-----END PRIVATE KEY-----\n",
  "client_email": "emailaddress",
  "client_id": "id",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "someurl"
}

Getting one of these is summarized in the Google Cloud docs for Creating a service account, but more explicit instructions can be found in the Handprint project Wiki pages on GitHub. Once you have downloaded a Google credentials file from Google, save the file somewhere on your computer (for the sake of this example, assume it is mygooglecredentials.json), and use the command discussed above to make Handprint copy the credentials file:

handprint -a google mygooglecredentials.json

Amazon

Amazon credentials for AWS take the form of two alphanumeric strings: a key id string and a secret access key string. In addition, the service needs to be invoked with a region identifier. For the purposes of Handprint, these should be stored in a JSON file with the following format:

{
    "aws_access_key_id": "YOUR_KEY_ID_HERE",
    "aws_secret_access_key": "YOUR_ACCESS_KEY_HERE",
    "region_name": "YOUR_REGION_NAME_HERE"
}

Getting this information is, thankfully, a relatively simple process for Amazon's services. Instructions can be found in the Handprint project Wiki pages on GitHub. Once you have obtained the two alphanumeric keys and a region identifier string, use a text editor to create a JSON file in the simple format shown above, save that file somewhere on your computer (for the sake of this example, assume it is myamazoncredentials.json), and use two commands to make Handprint copy the credentials file for the two different Amazon services currently supported by Handprint:

handprint -a amazon-textract myamazoncredentials.json
handprint -a amazon-rekognition myamazoncredentials.json

Usage

Handprint comes with a single command-line interface program called handprint. Here is a screen cast to give a sense for what it's like to run Handprint. Click on the following image:

Screencast of simple Handprint demo

The handprint command-line program should end up installed in a location where software is normally installed on your computer, if the installation steps described in the previous section proceed successfully. Running Handprint from a terminal shell then should be as simple as running any other shell command on your system:

handprint -h

If that fails for some reason, you should be able to run Handprint from anywhere using the normal approach for running Python modules:

python3 -m handprint -h

The -h option (/h on Windows) will make handprint display some help information and exit immediately. To make Handprint do more, you can supply other arguments that instruct Handprint to process image files (or alternatively, URLs pointing to image files at a network location) and run text recognition algorithms on them, as explained below.

Input files and URLs

After credentials are installed, running Handprint without the -a option will invoke one or more services on files, directories of files, or URLs pointing to files. Here is an example of running Handprint on a directory containing images:

handprint tests/data/caltech-archives/glaser/

Image paths or URLs can be supplied to Handprint in any of the following ways:

  • One or more directory paths or one or more image file paths on the local disk, which will be interpreted as images (either individually or in directories) to be processed
  • One or more URLs, which will be interpreted as network locations of image files to be processed
  • If given the -f option (/f on Windows), a file containing either image paths or image URLs to be processed

Handprint assumes a path is a URL if it meets the test of is_url(...) from the Python Validator Collection. For every input given as a URL, Handprint will first download the image found at the URL to a directory indicated by the option -o (/o on Windows), or the current directory if option -o is not used.

No matter whether files or URLs, each input item should be a single image of a document page in which text should be recognized. Handprint reads a number of common formats: JP2, JPEG, PDF, PNG, GIF, BMP, and TIFF. However, for simplicity and maximum compatibility with all cloud services, Handprint always converts all input files to PNG if they are not already in that format, no matter if a given service can accept other formats. Handprint also reduces the size of input images to the smallest size accepted by any of the services invoked if an image exceeds that size. (For example, when sending a file to services A and B at the same time, if service A accepts files up to 10 MB in size and service B accepts files up to 4 MB, Handprint will resize the file to 4 MB before sending it to both A and B, even if A could accept a higher-resolution image.) Finally, if the input contains more than one page (e.g., in a PDF file), Handprint will only use the first page of the input and ignore the remaining pages.

Be aware that downsizing images can change the text recognition results returned by some services compared to the results obtained using the original full-size input image. If your images are larger when converted to PNG than the smallest size accepted by one of the destination services (currently 4 MB, for Microsoft), then you may wish to compare the results of using multiple services at once versus one at a time (i.e., one destination at a time in separate invocations of Handprint).

Finally, note that providing URLs on the command line can be problematic due to how terminal shells interpret certain characters, and so when supplying URLs, it's usually better to store the URLs in a file in combination with the -f option (/f on Windows).

Selecting destination services

You can use the -l option (/l on Windows) to make it display a list of the services currently supported by Handprint:

# handprint -l
Known services: amazon-rekognition, amazon-textract, google, microsoft

By default, Handprint will send images to all of the known services, creating annotated images to represent the results of each individual service. To invoke only specific services, use the -s option (/s on Windows) followed by a service name or a list of names separated by commas (e.g., google,microsoft). For example, the following command will invoke Microsoft's text recognition service on a page from Clara Barton's unpublished draft book "The Life of My Childhood", available in Handprint's source directory:

handprint -s microsoft tests/data/public-domain/images/clara-barton-life-of-my-childhood-p90.jpg

Here is the result of that command:

Example of running Microsoft's service on a page from Clara Barton's unpublished draft book, The Life of My Childhood.

Visual display of recognition results

After gathering the results of each service for a given input, Handprint will create a single compound image consisting of the results for each service arranged in a N×N grid. This overview image is intended to make it easier to compare the results of multiple services against each other. The grid image will have the suffix .handprint-all.png. Here is a sample output image to illustrate:

Example annotated results output image

The 2×2 image above was produced by running the following command from the Handprint tests/data/caltech-archives/glaser directory:

handprint --text-size 20  "DAG_5_1_6 1952-1957 Notebook VI p2.jpg"

To move the position of the text annotations overlaid over the input image, you can use the option -m (or /m on Windows). This takes two numbers separated by a comma in the form x,y. Positive numbers move the text rightward and upward, respectively, relative to the default position. The default position of each text annotation in the annotated output is such that the left edge of the word starts at the location of the upper left corner of the bounding box returned by the service; this has the effect of putting the annotation near, but above, the location of the (actual) word in the input image by default. For example, if the word in the image is strawberry, the bounding box returned by the service will enclose strawberry, and the upper left corner of that bounding box will be somewhere above the letter s. Then, the default position of the text annotation will put the left edge of the word "strawberry" at that point above the letter s. Using the move-text option allows you to move the annotation if desired. A value such as 0,-5 will move it downward five pixels.

To change the color of the text annotations overlaid over the input image, you can use the option -x (or /x on Windows). You can use hex color codes such as "#ff0000" (make sure to enclose the value with quotes, or the shell will interpret the pound sign as a comment character), or X11/CSS4 color names with no spaces such as purple or darkgreen.

To change the size of the text annotations overlaid over the input image, you can use the option -z (or /z on Windows). The value is in units of points. The default size is 12.

Finally, the individual results, as well as individual annotated images corresponding to the results from each service, will not be retained unless the -e extended results option (/e on Windows) is invoked (described in more detail below). The production of the overview grid image can be skipped by using the -G option (/G on Windows).

Annotation types

Handprint produces copies of the input images overlaid with the recognition results received from the different services. By default, it shows only the recognized text. The option -d (/d on Windows) can be used to tell Handprint to display other results. The recognized values are as follows:

  • text: display the text recognized in the image (default)
  • bb: display all bounding boxes returned by the service
  • bb-word: display the bounding boxes for words (in red)
  • bb-line: display the bounding boxes for lines (in blue)
  • bb-para: display the bounding boxes for paragraphs (in green)

Separate multiple values with a comma. The option bb is a shorthand for the value bb-word,bb-line,bb-para. As an example, the following command will show both the recognized text and the bounding boxes around words:

handprint -d text,bb-word  -s google  tests/data/public-domain/images/H96566k.jpg

And here is the output from that command:

Example of bounding boxes

Note that as of June 2021, the main services (Amazon, Google, Microsoft) do not all provide the same bounding box information in their results. The following table summarizes what is available:

Service Word
bounding boxes
Line
bounding boxes
Paragraph
bounding boxes
Amazon Y Y -
Google Y - Y
Microsoft Y Y -

If a service does not provide a particular kind of bounding box, Handprint will not display that kind of bounding box in the annotated output for that service.

Thresholding by confidence

All of the services return confidence scores for items recognized in the input. By default, Handprint will show all results no matter how low the confidence score. The option -n (/n on Windows) can be used to threshold the results based on the confidence value for each item (text or bounding boxes). The value provided as the argument to the option must be a floating point number between 0 and 1.0. For example, the following command will make Handprint only show text that is rated with least 99.5% confidence:

handprint -n 0.995  somefile.png

Note that the confidence values returned by the different services are not normalized against each other. What one service considers to be 80% confidence may not be what another service considers 80% confidence. Handprint performs the thresholding against the raw scores returned by each service individually.

Comparison to ground truth text

Handprint offers the ability to compare the output of HTR services to expected output (i.e., ground truth) using the option -c (or /c on Windows). This facility requires that the user provides text files that contain the expected text for each input image. The ground-truth text files must have the following characteristics:

  • The file containing the expected results should be named .gt.txt, with a base name identical to the image file. For example, an image file named somefile.jpg should have a corresponding text file somefile.gt.txt. (This is a convention used by some other tools such as ocropy.)
  • The ground-truth text file should be located in the same directory as the input image file.
  • The text should be line oriented, with each line representing a line of text in the image.
  • The text should be plain text only. No Unicode or binary encodings. (This limitation comes from the HTR services, which – as of this writing – return results in plain text format.)

Handprint will write the comparison results to a tab-delimited file named after the input image and service but with the extension .tsv. For example, for an input image somefile.jpg and results received from Google, the comparison results will be written to somefile.handprint-google.tsv. The use of a tab-delimited format rather than comma-delimited format avoids the need to quote commas and other characters in the text. The output file will have one row for each line of text in the input, plus an additional row at the end for total number of errors found. Each row will have the following columns:

  1. number of errors on that line of text (computed as Levenshtein distance),
  2. the character error rate (CER) for the line (see below)
  3. the expected text on that line
  4. the text received from the service for that line

The character error rate (CER) is computed as

100 × (i + s + d)/n

where i is the number of inserted characters, s the number of substituted characters, and d the number of deleted characters needed to transform the the text received into the expected text, and n is the number of characters in the expected text line. This approach to normalizing the CER value is conventional but note that it can lead to values greater than 100%.

By default, scoring is done by Handprint on an exact basis; character case is not changed, punctuation is not removed, and stop words are not removed. However, multiple contiguous spaces are converted to one space, and leading spaces are removed from text lines.

If given the option -r (/r on Windows), Handprint will relax the comparison algorithm further, as follows: it will convert all text to lower case, and it will ignore certain sentence punctuation characters, namely ,, ., :, and ;. The rationale for these particular choices comes from experience with actual texts and HTR services. For example, a difference sometimes seen between HTR services is how they handle seemingly large spaces between a word and a subsequent comma or period: sometimes the HTR service will add a space before the comma or period, but inspection of the input document will reveal sloppiness in the author's handwriting and neither the addition nor the omission of a space is provably right or wrong. To avoid biasing the results one way or another, it is better to omit the punctuation. On the other hand, this may not always be desirable, and thus needs to be a user-controlled option.

Handprint attempts to cope with possibly-missing text in the HTR results by matching up likely corresponding lines in the expected and received results. It does this by comparing each line of ground-truth text to each line of the HTR results using longest common subsequence similarity as implemented by the LCSSEQ function in the textdistance package. If the lines do not pass a threshold score, Handprint looks at subsequent lines of the HTR results and tries to reestablish correspondence to ground truth. If nothing else in the HTR results appear close enough to the expected ground-truth line, the line is assumed to be missing from the HTR results and scored appropriately.

The following is an example of a tab-separated file produced using -c. This example shows a case where two lines were missing entirely from the HTR results; for those lines, the number of errors equals the length of the ground-truth text lines and the CER is 100%.

Extended results

If the option -e (/e on Windows) is used, Handprint saves not only the overview image containing all the results, but also, individual annotated images for each service's results, the raw data (converted to a JSON file by Handprint), and the text extracted by the service. These additional outputs will be written in files named after the original files with the addition of a string that indicates the service used. For example, a file named somefile.jpg will produce

somefile.handprint-amazon-textract.png
somefile.handprint-amazon-textract.json
somefile.handprint-amazon-textract.txt
somefile.handprint-google.png
somefile.handprint-google.json
somefile.handprint-google.txt
...

A complication arises with using URLs in combination with the -e option: how should Handprint name the files that it writes? Some CMS systems store content using opaque schemes that provide no clear names in the URLs, making it impossible for a software tool such as Handprint to guess what file name would make sense to use for local storage. Worse, some systems create extremely long URLs, making it impractical to use the URL itself as the file name. For example, the following is a real URL pointing to an image in Caltech Archives:

https://hale.archives.caltech.edu/adore-djatoka//resolver?rft_id=https%3A%2F%2Fhale.archives.caltech.edu%2Fislandora%2Fobject%2Fhale%253A85240%2Fdatastream%2FJP2%2Fview%3Ftoken%3D7997253eb6195d89b2615e8fa60708a97204a4cdefe527a5ab593395ac7d4327&url_ver=Z39.88-2004&svc_id=info%3Alanl-repo%2Fsvc%2FgetRegion&svc_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajpeg2000&svc.format=image%2Fjpeg&svc.level=4&svc.rotate=0

To deal with this situation, Handprint manufactures its own file names when a URL is encountered. The scheme is simple: by default, Handprint will use a base name of document-N, where N is an integer. The integers start from 1 for every run of Handprint, and the integers count the URLs found either on the command line or in the file indicated by the -f option. The image found at a given URL is stored in a file named document-N.E where E is the format extension (e.g., document-1.jpg, document-1.png, etc.). The URL itself is stored in another file named document-1.url. Thus, the files produced by Handprint will look like this when the -e option is used (assuming, for this example, that the files at the source URLs are in JPEG format):

document-1.jpg
document-1.url
document-1.handprint-google.png
document-1.handprint-google.json
document-1.handprint-google.txt
document-1.handprint-microsoft.png
document-1.handprint-microsoft.json
document-1.handprint-microsoft.txt
...
document-2.jpg
document-2.url
document-2.handprint-google.png
document-2.handprint-google.json
document-2.handprint-google.txt
document-2.handprint-microsoft.png
document-2.handprint-microsoft.json
document-2.handprint-microsoft.txt
...
document-3.jpg
document-3.url
document-3.handprint-google.png
document-3.handprint-google.json
document-3.handprint-google.txt
document-3.handprint-microsoft.png
document-3.handprint-microsoft.json
document-3.handprint-microsoft.txt
...

The base name document can be changed using the -b option (/b on Windows). For example, running Handprint with the option -b einstein will cause the outputs to be named einstein-1.jpg, einstein-1.url, etc.

Other options

The option -j (/j on Windows) tells Handprint to look for and reuse preexisting results for each input instead of contacting the services. This makes it look for JSON files produced in a previous run with the -e option,

somefile.handprint-amazon-rekognition.json
somefile.handprint-amazon-textract.json
somefile.handprint-google.json
somefile.handprint-microsoft.json

and use those instead of getting results from the services. This can be useful to save repeated invocations of the services if all you want is to draw the results differently or perform some testing/debugging on the same inputs.

Handprint will send files to the different services in parallel, using a number of process threads equal to 1/2 of the number of cores on the computer it is running on. (E.g., if your computer has 4 cores, it will by default use at most 2 threads.) The -t option (/t on Windows) can be used to change this number.

If given the -q option (/q on Windows), Handprint will not print its usual informational messages while it is working. It will only print messages for warnings or errors. By default messages printed by Handprint are also color-coded. If given the option -Z (/Z on Windows), Handprint will not color the text of messages it prints. (This latter option is useful when running Handprint within subshells inside other environments such as Emacs.)

If given the -@ argument (/@ on Windows), this program will output a detailed trace of what it is doing. The debug trace will be sent to the given destination, which can be - to indicate console output, or a file path to send the output to a file. On non-Windows platforms, Handprint will also install a signal handler that responds to signal SIGUSR1; if the signal is sent to the running process, it will drop Handprint into the pdb debugger. Note: It's best to use -t 1 when attempting to use a debugger because otherwise subthreads will continue running even if the main thread is interrupted.

If given the -V option (/V on Windows), this program will print the version and other information, and exit without doing anything else.

Command line options summary

The following table summarizes all the command line options available. (Note: on Windows computers, / must be used as the prefix character instead of the - dash character):

Short     Long form Meaning Default
-aA --add-credsA Add credentials for service A and exit
-bB --base-nameB Write outputs to files named B-n Use base names of image files
-C --no-color Don't color-code info messages Color-code terminal output
-c --compare Compare to ground truth; see -r too
-dD --displayD Display annotation types D Display text annotations
-e --extended Produce extended results Produce only summary image
-fF --from-fileF Read file names or URLs from file F Use args on the command line
-G --no-grid Don't create summary image Create an N×N grid image
-h --help Display help, then exit
-j --reuse-json Reuse prior JSON results if found Ignore any existing results
-l --list Display known services and exit
-mx,y --text-movex,y Move each text annotation by x,y 0,0
-nN --confidenceN Use confidence score threshold N 0
-oO --outputO Write all outputs to directory O Write to images' directories
-q --quiet Don't write messages while working Be chatty while working
-r --relaxed Use looser criteria for --compare
-sS --serviceS Use recognition service S; see -l Use all services
-tT --threadsT Use T number of threads Use (#cores)/2 threads
-V --version Write program version info and exit
-xX --text-colorX Use color X for text annotations Red
-zZ --text-sizeZ Use font size Z for text annotations Use font size 12
-@OUT --debugOUT Write detailed execution info to OUT Normal mode

⚑   If URLs are given, then the outputs will be written by default to names of the form document-n, where n is an integer. Examples: document-1.jpg, document-1.handprint-google.txt, etc. This is because images located in network content management systems may not have any clear names in their URLs.
★   The possible values of D are: text, bb, bb-word, bb-line, bb-para. Multiple values must be separated with commas. The value bb is a shorthand for bb-word,bb-line,bb-para. The default is text.
⬥   To write to the console, use the character - as the value of OUT; otherwise, OUT must be the name of a file where the output should be written.

Return values

This program exits with a return code of 0 if no problems are encountered. It returns a nonzero value otherwise. The following table lists the possible return values:

Code Meaning
0 success – program completed normally
1 the user interrupted the program's execution
2 encountered a bad or missing value for an option
3 no network detected – cannot proceed
4 file error – encountered a problem with a file
5 server error – encountered a problem with a server
6 an exception or fatal error occurred

Additional notes

The debug logging functionality is implemented using Sidetrack and all calls to the debug code are conditionalized on the Python symbol __debug__. It is carefully written so that you can cause the calls to be optimized out completely if your run Python with optimization turned on (e.g., using the -O command-line option).

Known issues and limitations

Here are some known limitations in the current version of Handprint:

  • If the input has multiple pages, only the first page/image is used; the rest (if any) are ignored.
  • The Amazon Rekognition API will return at most 50 words in an image.
  • The Microsoft Azure API will only detect a maximum of 300 lines of text per page.
  • Some services have different file size restrictions depending on the format of the file, but Handprint always uses the same limit for all files for a given service. This is a code simplification.

Getting help

If you find an issue, please submit it in the GitHub issue tracker for this repository.

Contributing

I would be happy to receive your help and participation with enhancing Handprint! Please visit the guidelines for contributing for some tips on getting started.

License

Software produced by the Caltech Library is Copyright © 2021 California Institute of Technology. This software is freely distributed under a BSD/MIT type license. Please see the LICENSE file for more information.

Authors and history

Mike Hucka designed and implemented Handprint beginning in mid-2018.

Acknowledgments

The vector artwork of a hand used as a logo for Handprint was created by Kevin from the Noun Project. It is licensed under the Creative Commons CC-BY 3.0 license.

Handprint benefitted from feedback from several people, notably from Tommy Keswick, Mariella Soprano, Peter Collopy and Stephen Davison.

Handprint makes use of numerous open-source packages, without which it would have been effectively impossible to develop Handprint with the resources we had. I want to acknowledge this debt. In alphabetical order, the packages are:

Finally, I am grateful for computing & institutional resources made available by the California Institute of Technology.

Comments
  • 'handprint/methods' does not exist

    'handprint/methods' does not exist

    While installing on Windows getting error: D:\OCR\handprint-0.10.0\handprint-0.10.0>py -m pip install . --upgrade Processing d:\ocr\handprint-0.10.0\handprint-0.10.0 ERROR: Complete output from command python setup.py egg_info: ERROR: running egg_info creating pip-egg-info\handprint.egg-info writing pip-egg-info\handprint.egg-info\PKG-INFO writing dependency_links to pip-egg-info\handprint.egg-info\dependency_links.txt writing requirements to pip-egg-info\handprint.egg-info\requires.txt writing top-level names to pip-egg-info\handprint.egg-info\top_level.txt writing manifest file 'pip-egg-info\handprint.egg-info\SOURCES.txt' error: package directory 'handprint/methods' does not exist ---------------------------------------- ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\user\AppData\Local\Temp\pip-req-build-kebkz6bp
    WARNING: You are using pip version 19.1.1, however version 19.2.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

    opened by syed-9909 3
  • Segmentation fault on macOS Mojave

    Segmentation fault on macOS Mojave

    (env) tommasos-mbp:TestHandwriting tommaso$ handprint -s amazon-textract test-1.png ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Welcome to Handprint, the Handwritten page recognition test! ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ Will apply 1 service (amazon-textract) to 1 image. Will use up to 2 process threads. Starting on test-1.png Sending to amazon-textract and waiting for response ... Got result from amazon-textract. Creating annotated image for amazon-textract. /Users/tommaso/Documents/Code/CSEM_repos/TestHandwriting/env/lib/python3.7/site-packages/handprint/images.py:218: UserWarning: Starting a Matplotlib GUI outside of the main thread will likely fail. fig, axes = plt.subplots(nrows = 1, ncols = 1, figsize = (20, 20)) 2020-08-05 15:02:36.591 Python[2255:77879] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null) 2020-08-05 15:02:36.623 Python[2255:77879] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!' *** First throw call stack: ( 0 CoreFoundation 0x00007fff381f8a7d __exceptionPreprocess + 256 1 libobjc.A.dylib 0x00007fff628caa17 objc_exception_throw + 48 2 CoreFoundation 0x00007fff382125d9 -[NSException raise] + 9 3 AppKit 0x00007fff357b85ca -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 317 4 AppKit 0x00007fff357b59f7 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1479 5 AppKit 0x00007fff357b542a -[NSWindow initWithContentRect:styleMask:backing:defer:] + 45 6 _macosx.cpython-37m-darwin.so 0x0000000116d7cc40 -[Window initWithContentRect:styleMask:backing:defer:withManager:] + 80 7 _macosx.cpython-37m-darwin.so 0x0000000116d808b4 FigureManager_init + 292 8 Python 0x000000010bf1df30 wrap_init + 12 9 Python 0x000000010bee589d wrapperdescr_call + 337 10 Python 0x000000010bedfc46 _PyObject_FastCallKeywords + 358 11 Python 0x000000010bf75322 call_function + 730 12 Python 0x000000010bf6e297 _PyEval_EvalFrameDefault + 6767 13 Python 0x000000010bee01a4 function_code_fastcall + 106 14 Python 0x000000010bee0b17 _PyObject_Call_Prepend + 131 15 Python 0x000000010bf1de9e slot_tp_init + 80 16 Python 0x000000010bf1abca type_call + 172 17 Python 0x000000010bedfc46 _PyObject_FastCallKeywords + 358 18 Python 0x000000010bf75322 call_function + 730 19 Python 0x000000010bf6e297 _PyEval_EvalFrameDefault + 6767 20 Python 0x000000010bee01a4 function_code_fastcall + 106 21 Python 0x000000010bf75329 call_function + 737 22 Python 0x000000010bf6e297 _PyEval_EvalFrameDefault + 6767 23 Python 0x000000010bf75b1d _PyEval_EvalCodeWithName + 1698 24 Python 0x000000010bedfa10 _PyFunction_FastCallDict + 444 25 Python 0x000000010bee0b17 _PyObject_Call_Prepend + 131 26 Python 0x000000010bedfedd PyObject_Call + 136 27 Python 0x000000010bf6e57b _PyEval_EvalFrameDefault + 7507 28 Python 0x000000010bf75b1d _PyEval_EvalCodeWithName + 1698 29 Python 0x000000010bedfa10 _PyFunction_FastCallDict + 444 30 Python 0x000000010bf6e57b _PyEval_EvalFrameDefault + 7507 31 Python 0x000000010bf75b1d _PyEval_EvalCodeWithName + 1698 32 Python 0x000000010bedfa10 _PyFunction_FastCallDict + 444 33 Python 0x000000010bf6e57b _PyEval_EvalFrameDefault + 7507 34 Python 0x000000010bf75b1d _PyEval_EvalCodeWithName + 1698 35 Python 0x000000010bedfa10 _PyFunction_FastCallDict + 444 36 Python 0x000000010bf6e57b _PyEval_EvalFrameDefault + 7507 37 Python 0x000000010bf75b1d _PyEval_EvalCodeWithName + 1698 38 Python 0x000000010bedfd98 _PyFunction_FastCallKeywords + 212 39 Python 0x000000010bf75329 call_function + 737 40 Python 0x000000010bf6e3da _PyEval_EvalFrameDefault + 7090 41 Python 0x000000010bf75b1d _PyEval_EvalCodeWithName + 1698 42 Python 0x000000010bedfd98 _PyFunction_FastCallKeywords + 212 43 Python 0x000000010bf75329 call_function + 737 44 Python 0x000000010bf6e332 _PyEval_EvalFrameDefault + 6922 45 Python 0x000000010bee01a4 function_code_fastcall + 106 46 Python 0x000000010bee0b17 _PyObject_Call_Prepend + 131 47 Python 0x000000010bedfedd PyObject_Call + 136 48 Python 0x000000010bf6e57b _PyEval_EvalFrameDefault + 7507 49 Python 0x000000010bee01a4 function_code_fastcall + 106 50 Python 0x000000010bf75329 call_function + 737 51 Python 0x000000010bf6e27e _PyEval_EvalFrameDefault + 6742 52 Python 0x000000010bee01a4 function_code_fastcall + 106 53 Python 0x000000010bf6e57b _PyEval_EvalFrameDefault + 7507 54 Python 0x000000010bee01a4 function_code_fastcall + 106 55 Python 0x000000010bf75329 call_function + 737 56 Python 0x000000010bf6e27e _PyEval_EvalFrameDefault + 6742 57 Python 0x000000010bee01a4 function_code_fastcall + 106 58 Python 0x000000010bf75329 call_function + 737 59 Python 0x000000010bf6e27e _PyEval_EvalFrameDefault + 6742 60 Python 0x000000010bee01a4 function_code_fastcall + 106 61 Python 0x000000010bee0b17 _PyObject_Call_Prepend + 131 62 Python 0x000000010bedfedd PyObject_Call + 136 63 Python 0x000000010bfdbd01 t_bootstrap + 71 64 Python 0x000000010bfa30be pythread_wrapper + 25 65 libsystem_pthread.dylib 0x00007fff6428c2eb _pthread_body + 126 66 libsystem_pthread.dylib 0x00007fff6428f249 _pthread_start + 66 67 libsystem_pthread.dylib 0x00007fff6428b40d thread_start + 13 ) libc++abi.dylib: terminating with uncaught exception of type NSException Abort trap: 6

    opened by TommasoBendinelli 2
  • python -m pip issue

    python -m pip issue

    Dear Mike: Thanks for such a great piece of software. I discovered it a few weeks ago, and I am using it to dump (tentatively, roughly) microfilms from familysearch.org to text, that have not yet been indexed (maybe never). Thanks to the program of you can save months of turning the page trying to read old writing trying to find a last name. I do not know if it corresponds, but I comment that the 1st time when trying to install, as the documentation indicates:

    python3 -m pip install [email protected]:caltechlibrary/handprint.git --user --upgrade

    I got the following error. "ERROR: Invalid requirement: '[email protected]:caltechlibrary/handprint.git' Hint: It looks like a path. File '[email protected]:caltechlibrary/handprint.git' does not exist."

    In my case it does work: python -m pip install -e git+https://github.com/caltechlibrary/handprint.git@master#egg=handprint --user --upgrade

    , with: git version 2.25.1 Python 3.8.1 pip 19.3.1

    Again thank you very much! Cheers!

    Task: docs 📜 
    opened by braytac 2
  • Error in 1.5.3 installing service credentials for the first time

    Error in 1.5.3 installing service credentials for the first time

    Due to having missed updating a call to log in the credentials module, first-time users will hit an error trying to install credentials for a service:

    ...
     File "/home/parallels/.shiv/handprint_8aaa095b0627e5378d25107a0bc0bd8839387521aad95eafce5ffa5a0e6e18bb/site-packages/handprint/credentials/base.py", line 50, in save_credentials
        if __debug__: log('creating credentials dir: {}.', Credentials.creds_dir)
    TypeError: log() takes 1 positional argument but 2 were given
    
    Bug 🐛 Priority ★★★ 
    opened by mhucka 1
  • shiv-produced binaries should remove old installations

    shiv-produced binaries should remove old installations

    The shiv-generated self-contained runnable Python binaries install Python libraries into the user's ~/.shiv directory. These are tied to the release of a given Handprint executable. Currently, nothing removes them after they are first installed (unless the user knows about it and removes them manually). It is possible to include a preamble where code can be added to do some cleanup, and the shiv documentation includes an example of how.

    Future releases of Handprint should do this to avoid bloating users' ~/.shiv.

    Enhancement ✨ Priority ★★ 
    opened by mhucka 1
  • Amazon text output in extended results is not split into lines

    Amazon text output in extended results is not split into lines

    The extended output .txt file for Amazon isn't split into lines like is done for the output of the other services. This is just a flat-out bug in my code.

    Bug 🐛 
    opened by mhucka 1
  • Empty .txt file for Google when using extended results

    Empty .txt file for Google when using extended results

    The text output .txt file from Google is empty when using -e to get extended results. This seems to be a change (possibly due to changes in Google's API?).

    Thanks to Cody Carvel for reporting the problem via email.

    Bug 🐛 
    opened by mhucka 1
  • Switch to using CommonPy for utilities

    Switch to using CommonPy for utilities

    A lot of the utilities included directly here have been split off into CommonPy, but this code still contains the original versions. It's probably time to switch to using CommonPy instead of keeping separate versions here.

    Enhancement ✨ 
    opened by mhucka 1
  • Bump urllib3 from 1.25.4 to 1.26.5

    Bump urllib3 from 1.25.4 to 1.26.5

    Bumps urllib3 from 1.25.4 to 1.26.5.

    Release notes

    Sourced from urllib3's releases.

    1.26.5

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Fixed deprecation warnings emitted in Python 3.10.
    • Updated vendored six library to 1.16.0.
    • Improved performance of URL parser when splitting the authority component.

    If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors

    1.26.4

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Changed behavior of the default SSLContext when connecting to HTTPS proxy during HTTPS requests. The default SSLContext now sets check_hostname=True.

    If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors

    1.26.3

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Fixed bytes and string comparison issue with headers (Pull #2141)

    • Changed ProxySchemeUnknown error message to be more actionable if the user supplies a proxy URL without a scheme (Pull #2107)

    If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors

    1.26.2

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Fixed an issue where wrap_socket and CERT_REQUIRED wouldn't be imported properly on Python 2.7.8 and earlier (Pull #2052)

    1.26.1

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Fixed an issue where two User-Agent headers would be sent if a User-Agent header key is passed as bytes (Pull #2047)

    1.26.0

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Added support for HTTPS proxies contacting HTTPS servers (Pull #1923, Pull #1806)

    • Deprecated negotiating TLSv1 and TLSv1.1 by default. Users that still wish to use TLS earlier than 1.2 without a deprecation warning should opt-in explicitly by setting ssl_version=ssl.PROTOCOL_TLSv1_1 (Pull #2002) Starting in urllib3 v2.0: Connections that receive a DeprecationWarning will fail

    • Deprecated Retry options Retry.DEFAULT_METHOD_WHITELIST, Retry.DEFAULT_REDIRECT_HEADERS_BLACKLIST and Retry(method_whitelist=...) in favor of Retry.DEFAULT_ALLOWED_METHODS, Retry.DEFAULT_REMOVE_HEADERS_ON_REDIRECT, and Retry(allowed_methods=...) (Pull #2000) Starting in urllib3 v2.0: Deprecated options will be removed

    ... (truncated)

    Changelog

    Sourced from urllib3's changelog.

    1.26.5 (2021-05-26)

    • Fixed deprecation warnings emitted in Python 3.10.
    • Updated vendored six library to 1.16.0.
    • Improved performance of URL parser when splitting the authority component.

    1.26.4 (2021-03-15)

    • Changed behavior of the default SSLContext when connecting to HTTPS proxy during HTTPS requests. The default SSLContext now sets check_hostname=True.

    1.26.3 (2021-01-26)

    • Fixed bytes and string comparison issue with headers (Pull #2141)

    • Changed ProxySchemeUnknown error message to be more actionable if the user supplies a proxy URL without a scheme. (Pull #2107)

    1.26.2 (2020-11-12)

    • Fixed an issue where wrap_socket and CERT_REQUIRED wouldn't be imported properly on Python 2.7.8 and earlier (Pull #2052)

    1.26.1 (2020-11-11)

    • Fixed an issue where two User-Agent headers would be sent if a User-Agent header key is passed as bytes (Pull #2047)

    1.26.0 (2020-11-10)

    • NOTE: urllib3 v2.0 will drop support for Python 2. Read more in the v2.0 Roadmap <https://urllib3.readthedocs.io/en/latest/v2-roadmap.html>_.

    • Added support for HTTPS proxies contacting HTTPS servers (Pull #1923, Pull #1806)

    • Deprecated negotiating TLSv1 and TLSv1.1 by default. Users that still wish to use TLS earlier than 1.2 without a deprecation warning

    ... (truncated)

    Commits
    • d161647 Release 1.26.5
    • 2d4a3fe Improve performance of sub-authority splitting in URL
    • 2698537 Update vendored six to 1.16.0
    • 07bed79 Fix deprecation warnings for Python 3.10 ssl module
    • d725a9b Add Python 3.10 to GitHub Actions
    • 339ad34 Use pytest==6.2.4 on Python 3.10+
    • f271c9c Apply latest Black formatting
    • 1884878 [1.26] Properly proxy EOF on the SSLTransport test suite
    • a891304 Release 1.26.4
    • 8d65ea1 Merge pull request from GHSA-5phf-pp7p-vc2r
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Microsoft service should not be hardwired to use West coast endpoint

    Microsoft service should not be hardwired to use West coast endpoint

    Line 77 in microsoft.py is hardwired to use westus.api.cognitive.microsoft.com, which doesn't work for everyone. This needs to be made configurable.

    (Thanks to Matt Cook at Harvard for reporting this.)

    Bug 🐛 
    opened by mhucka 1
  • Option -G with -e does not produce images

    Option -G with -e does not produce images

    Option -e should leave an image for the results of a given service, named X.handprint-SERVICE.png for SERVICE, but if -G is given as well, then it does not produce the image. This is a clear bug in the logic.

    (Thanks to Matt Cook at Harvard for reporting this.)

    Bug 🐛 
    opened by mhucka 1
  • Bump wheel from 0.36.2 to 0.38.1

    Bump wheel from 0.36.2 to 0.38.1

    Bumps wheel from 0.36.2 to 0.38.1.

    Changelog

    Sourced from wheel's changelog.

    Release Notes

    UNRELEASED

    • Updated vendored packaging to 22.0

    0.38.4 (2022-11-09)

    • Fixed PKG-INFO conversion in bdist_wheel mangling UTF-8 header values in METADATA (PR by Anderson Bravalheri)

    0.38.3 (2022-11-08)

    • Fixed install failure when used with --no-binary, reported on Ubuntu 20.04, by removing setup_requires from setup.cfg

    0.38.2 (2022-11-05)

    • Fixed regression introduced in v0.38.1 which broke parsing of wheel file names with multiple platform tags

    0.38.1 (2022-11-04)

    • Removed install dependency on setuptools
    • The future-proof fix in 0.36.0 for converting PyPy's SOABI into a abi tag was faulty. Fixed so that future changes in the SOABI will not change the tag.

    0.38.0 (2022-10-21)

    • Dropped support for Python < 3.7
    • Updated vendored packaging to 21.3
    • Replaced all uses of distutils with setuptools
    • The handling of license_files (including glob patterns and default values) is now delegated to setuptools>=57.0.0 (#466). The package dependencies were updated to reflect this change.
    • Fixed potential DoS attack via the WHEEL_INFO_RE regular expression
    • Fixed ValueError: ZIP does not support timestamps before 1980 when using SOURCE_DATE_EPOCH=0 or when on-disk timestamps are earlier than 1980-01-01. Such timestamps are now changed to the minimum value before packaging.

    0.37.1 (2021-12-22)

    • Fixed wheel pack duplicating the WHEEL contents when the build number has changed (#415)
    • Fixed parsing of file names containing commas in RECORD (PR by Hood Chatham)

    0.37.0 (2021-08-09)

    • Added official Python 3.10 support
    • Updated vendored packaging library to v20.9

    ... (truncated)

    Commits
    • 6f1608d Created a new release
    • cf8f5ef Moved news item from PR #484 to its proper place
    • 9ec2016 Removed install dependency on setuptools (#483)
    • 747e1f6 Fixed PyPy SOABI parsing (#484)
    • 7627548 [pre-commit.ci] pre-commit autoupdate (#480)
    • 7b9e8e1 Test on Python 3.11 final
    • a04dfef Updated the pypi-publish action
    • 94bb62c Fixed docs not building due to code style changes
    • d635664 Updated the codecov action to the latest version
    • fcb94cd Updated version to match the release
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump certifi from 2021.10.8 to 2022.12.7

    Bump certifi from 2021.10.8 to 2022.12.7

    Bumps certifi from 2021.10.8 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump pillow from 9.0.1 to 9.3.0

    Bump pillow from 9.0.1 to 9.3.0

    Bumps pillow from 9.0.1 to 9.3.0.

    Release notes

    Sourced from pillow's releases.

    9.3.0

    https://pillow.readthedocs.io/en/stable/releasenotes/9.3.0.html

    Changes

    ... (truncated)

    Changelog

    Sourced from pillow's changelog.

    9.3.0 (2022-10-29)

    • Limit SAMPLESPERPIXEL to avoid runtime DOS #6700 [wiredfool]

    • Initialize libtiff buffer when saving #6699 [radarhere]

    • Inline fname2char to fix memory leak #6329 [nulano]

    • Fix memory leaks related to text features #6330 [nulano]

    • Use double quotes for version check on old CPython on Windows #6695 [hugovk]

    • Remove backup implementation of Round for Windows platforms #6693 [cgohlke]

    • Fixed set_variation_by_name offset #6445 [radarhere]

    • Fix malloc in _imagingft.c:font_setvaraxes #6690 [cgohlke]

    • Release Python GIL when converting images using matrix operations #6418 [hmaarrfk]

    • Added ExifTags enums #6630 [radarhere]

    • Do not modify previous frame when calculating delta in PNG #6683 [radarhere]

    • Added support for reading BMP images with RLE4 compression #6674 [npjg, radarhere]

    • Decode JPEG compressed BLP1 data in original mode #6678 [radarhere]

    • Added GPS TIFF tag info #6661 [radarhere]

    • Added conversion between RGB/RGBA/RGBX and LAB #6647 [radarhere]

    • Do not attempt normalization if mode is already normal #6644 [radarhere]

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Unable to run: RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf

    Unable to run: RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf

    Hi! I want to try handprint but I'm unable to get it to run. The command I'm trying to run is

    handprint -s google ./
    
    • Binary version (1.6.0 from the releases page): reports Python too old even tough my python version should be up to date:
    python3 --version              
    Python 3.10.8
    
    • pipx version: gives the error above:
    RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf
    An error occurred (ImportError): numpy.core.multiarray failed to import
    
    • pip version, installed via pip install --no-cache-dir --upgrade handprint gives the same error.

    Something I'm doing wrong?

    Env

    OS: Arch Linux (Manjaro) Python: Python 3.10.8

    Python 3.10.8 (main, Nov  1 2022, 14:18:21) [GCC 12.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import numpy
    >>> numpy.version.version
    '1.22.2'
    >>> 
    
    opened by tuxflo 1
  • Bump protobuf from 3.19.4 to 3.19.5

    Bump protobuf from 3.19.4 to 3.19.5

    Bumps protobuf from 3.19.4 to 3.19.5.

    Release notes

    Sourced from protobuf's releases.

    Protocol Buffers v3.19.5

    C++

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • JOSS review — readme should include statement of need & audience

    JOSS review — readme should include statement of need & audience

    per JOSS review checklist, the documentation in your readme should include:

    A statement of need: Do the authors clearly state what problems the software is designed to solve and who the target audience is?

    You can probably adapt the second paragraph from the statement of need in your JOSS paper.

    Also, in both places I think you should clarify audience — you say in the paper that people can use handprint without writing any code, but it seems like people will still need to be fairly technical to get this set up and configured.

    Enhancement ✨ 
    opened by rlskoeser 0
Releases(v1.6.0)
  • v1.6.0(Jun 25, 2022)

    Changes in this release:

    • Beginning with this release, the license for Handprint is now an unmodified BSD 3-clause, instead of the previous Caltech-specific modified version of the license.
    • Some versions of dependencies in requirements.txt have been updated.
    Source code(tar.gz)
    Source code(zip)
    handprint1.6.0-linux-python3.10.zip(68.84 MB)
    handprint1.6.0-linux-python3.8.zip(67.95 MB)
    handprint1.6.0-linux-python3.9.zip(68.21 MB)
    handprint1.6.0-macos-python3.10.zip(61.22 MB)
    handprint1.6.0-macos-python3.8.zip(60.89 MB)
    handprint1.6.0-macos-python3.9.zip(61.18 MB)
  • v1.5.6(Mar 15, 2022)

    Changes in this release:

    • The internal network module is gone; instead, this uses the equivalent functions from CommonPy's network_utils module.
    • Makefile has a fix for updating CITATION.cff.
    • Some dependency versions have been updated in requirements.txt.
    • There is a new requirements-dev.txt file for installing dependencies needed to run test cases using pytest.
    • There are new test cases.

    Self-contained binary distributions

    This release includes standalone, runnable binaries for macOS and Linux. The experimental binaries are built using shiv. They only need a copy of Python 3.8, 3.9 or 3.10 on your system to run – they don't require installation of additional Python packages using (e.g.) pip. To use them:

    1. Download the Handprint zip file corresponding to the version of Python you have installed on your computer

    2. Unzip the resulting file (if your web browser did not automatically unzip it)

    3. Move the file handprint to a location where your terminal shell looks for programs. A popular location is /usr/local/bin.

    Thereafter, you should be able to type handprint in your shell and it should run. (If it does not, please report the problem using the issue tracker.) Note that the first time you run it, Handprint will take longer than usual to start because it does a one-time configuration step, but on subsequent runs, startup times should be shorter.

    Source code(tar.gz)
    Source code(zip)
    handprint1.5.6-linux-python3.10.zip(100.71 MB)
    handprint1.5.6-linux-python3.8.zip(68.11 MB)
    handprint1.5.6-linux-python3.9.zip(68.37 MB)
    handprint1.5.6-macos-python3.10.zip(61.10 MB)
    handprint1.5.6-macos-python3.8.zip(60.92 MB)
    handprint1.5.6-macos-python3.9.zip(60.90 MB)
  • v1.5.5(Jan 5, 2022)

    Changes in this release:

    • Update dependency versions specified by requirements.txt and Pipfile, to address a security issue in Pillow, update to CommonPy, and some other version updates.
    • Fix to a bug in the image resizing code involving calls to debug log functions.
    • Updates to copyright years in files.
    • Addition of a CITATION.cff file to the repository on GitHub

    Self-contained binary distributions

    This release includes standalone, runnable binaries for macOS and Linux. The experimental binaries are built using shiv. They only need a copy of Python 3.8 or 3.9 on your system to run – they don't require installation of additional Python packages using (e.g.) pip. To use them:

    1. Download the zip file for either the Python 3.8 or the 3.9 version, depending on the version of Python you have installed on your computer

    2. Unzip the resulting file (if your web browser did not automatically unzip it)

    3. Move the file handprint to a location where your terminal shell looks for programs. A popular location is /usr/local/bin.

    Thereafter, you should be able to type handprint in your shell and it should run. (If it does not, please report the problem using the issue tracker.) Note that the first time you run it, Handprint will take longer than usual to start because it does a one-time configuration step, but on subsequent runs, startup times should be shorter.

    Source code(tar.gz)
    Source code(zip)
    handprint1.5.5-linux-python3.8.zip(62.06 MB)
    handprint1.5.5-linux-python3.9.zip(63.37 MB)
    handprint1.5.5-macos-python3.8.zip(57.30 MB)
    handprint1.5.5-macos-python3.9.zip(57.27 MB)
  • v1.5.4(Aug 18, 2021)

    All changes in this release

    This release fixes a crash (issue #30) that occurs when someone tries to install credentials files.

    Self-contained binary distributions

    This release includes standalone, runnable binaries for macOS and Linux. The experimental binaries are built using shiv. They only need a copy of Python 3.8 or 3.9 on your system to run – they don't require installation of additional Python packages using (e.g.) pip. To use them:

    1. Download the zip file for either the Python 3.8 or the 3.9 version, depending on the version of Python you have installed on your computer

    2. Unzip the resulting file (if your web browser did not automatically unzip it)

    3. Move the file handprint to a location where your terminal shell looks for programs. A popular location is /usr/local/bin.

    Thereafter, you should be able to type handprint in your shell and it should run. (If it does not, please report the problem using the issue tracker.) Note that the first time you run it, Handprint will take longer than usual to start because it does a one-time configuration step, but on subsequent runs, startup times should be shorter.

    Source code(tar.gz)
    Source code(zip)
    handprint1.5.4-linux-python3.8.zip(62.37 MB)
    handprint1.5.4-linux-python3.9.zip(62.25 MB)
    handprint1.5.4-macos-python3.8.zip(56.71 MB)
    handprint1.5.4-macos-python3.9.zip(56.72 MB)
  • v1.5.3(Aug 18, 2021)

    There are no functional changes in this release; the changes all concern code dependencies and installation instructions.

    All changes in this release

    • The requirements in requirements.txt now pin the versions of Python packages needed.
    • Pipfile and Pipefile.lock files are now provided for use with pipenv.
    • Imports of sidetrack now refer to the latest API.
    • The installation instructions in the README file now include information about using pipx.

    Self-contained binary distributions

    This release includes standalone, runnable binaries for macOS and Linux. The experimental binaries are built using shiv. They only need a copy of Python 3.8 or 3.9 on your system to run – they don't require installation of additional Python packages using (e.g.) pip. To use them:

    1. Download the zip file for either the Python 3.8 or the 3.9 version, depending on the version of Python you have installed on your computer

    2. Unzip the resulting file (if your web browser did not automatically unzip it)

    3. Move the file handprint to a location where your terminal shell looks for programs. A popular location is /usr/local/bin.

    Thereafter, you should be able to type handprint in your shell and it should run. (If it does not, please report the problem using the issue tracker.) Note that the first time you run it, Handprint will take longer than usual to start because it does a one-time configuration step, but on subsequent runs, startup times should be shorter.

    Source code(tar.gz)
    Source code(zip)
    handprint1.5.3-linux-python3.8.zip(62.37 MB)
    handprint1.5.3-linux-python3.9.zip(62.25 MB)
    handprint1.5.3-macos-python3.8.zip(56.71 MB)
    handprint1.5.3-macos-python3.9.zip(56.72 MB)
  • v1.5.1(Jun 29, 2021)

    There are no functional changes in this release compared to version 1.5.0; all of the code changes are internal, to speed up Handprint startup times and further clean up some code dependencies. Separately, new experimental, self-contained binary versions of Handprint are available for macOS.

    All changes in this release

    • To speed up initial application startup time, import statements have been moved from (usually) the tops of files, to where the packages are actually used in the code. Profiling using the Python -X importtime option helped identify expensive packages to make this efficiency gain possible.
    • The user interface code in ui.py has been replaced with importing Bun.
    • The version of commonpy needed is now 1.3.9.
    • The dependency on dateparser has been removed because Handprint doesn't depend on that package. (It's a transitive dependency coming from something else, but by itself, it doesn't belong in Handprint's requirements.)

    Self-contained binary distributions

    This release includes standalone, runnable binaries for macOS. The experimental binaries are built using shiv. They only need a copy of Python 3.8 or 3.9 on your system to run – they don't require installation of additional Python packages using (e.g.) pip. They should work on macOS 10.13–11.1. To use them:

    1. Download the zip file for either the Python 3.8 or the 3.9 version, depending on the version of Python you have installed on your computer

    2. Unzip the resulting file (if your web browser did not automatically unzip it)

    3. Move the file handprint to a location where your terminal shell looks for programs. A popular location is /usr/local/bin.

    Thereafter, you should be able to type handprint in your shell and it should run. (If it does not, please report the problem using the issue tracker.) Note that the first time you run it, Handprint will take longer than usual to start because it does a one-time configuration step, but on subsequent runs, startup times should be shorter.

    Source code(tar.gz)
    Source code(zip)
    handprint1.5.1-macos-python3.8.zip(57.40 MB)
    handprint1.5.1-macos-python3.9.zip(57.45 MB)
  • v1.5.0(Jun 22, 2021)

    This version contains many additions and some important bugs in the extended output (i.e., using the -e flag) for Google and Amazon. If you use Handprint, you should definitely update to this version.

    All changes in this release:

    • The default branch on GitHub has been changed from master to main. If you have clones or forks of this repo, please see GitHub's instructions for updating a local clone after a branch name change.
    • The styling of text annotations has changed: the text boxes overlaid on images no longer have borders, so that they are easier to read, especially when bounding boxes are displayed using the -d option (see below).
    • A new command-line option, -d (short for --display), lets users choose to display the bounding boxes of text, lines, and paragraphs (if the service supports these), in addition to or instead of the recognized text.
    • A new command-line option, -n (short for --confidence), allows users to apply a threshold to the confidence values returned for individual results, such that only results having confidence scores above a given value are shown in the output.
    • A new command-line option, -j, (short for --reuse-json) tells Handprint to look for the extended results produced by a previous run using -e, and use that instead of contacting a service again.
    • A new command-line option, -m, (short for --text-move) lets users adjust the position of the text annotations overlaid on input images. This takes two numbers separated by a comma in the form x,y. Positive numbers move the text rightward and upward compared to the default position.
    • A new command-line option, -x, (short for --text-color) allows users to change the color of the text annotations overlaid on input images.
    • A new command-line option, -z, (short for --text-size) lets users change the font size of the text annotations overlaid on input images.
    • The extended data (via option -e) from Google now includes the confidence scores enabled using the option enable_text_detection_confidence_score in the Google Vision API.
    • Handprint no longer leaves resized versions of input images when the -e option is being used. Previously, images of the form somefile.handprint.png were left around for somefile.png so that subsequent runs were saved the time of resizing the image (if resizing was needed). However, this meant that subsequent runs would reuse the image even if the chosen destination services were different than in the run that produced the resized image, which meant that the subsequent runs might be using an unnecessarily small version of the image. To eliminate this risk, Handprint now deletes the resized image, even though this means repeated runs on the same image may require repeated resizing operations.
    • Fixed issue #27: the Google JSON output was not proper JSON.
    • Fixed issue #26: the extended output for Amazon services was one long line instead of being split into lines as is done for the other services. This now works.
    • Fixed issue #25: the extended output for Google in Handprint version 1.4.0 produced an empty text file. It now produces text.
    • Fixed issue #24: use CommonPy functions instead of keeping separate versions of the same functions. Internally, a number of common utility functions originally written in part for Handprint have been moved to a separate new Python package, Commonpy, and the Handprint code has been refactored to use the package instead of its own copies of the functions.
    • Fixed issue #23: updated service adapters to use the latest API versions of the services (specifically for the Microsoft API).
    • Fixed issue #21: fixed Dependabot security warning for the urllib3 package.
    • Fixed issue #3: Microsoft API sometimes returned HTTP code 400; I rewrote the Handprint adapter code to handle errors more carefully and bubble up any unhandled errors so that users can see what they are.
    • Fixed problems in the implementation of the base class for handwritten recognition services.
    • Most dependencies in requirements.txt have been updated to the latest versions, and some new dependencies have been added.
    • Various minor internal code cleanups have been made.
    • The copyright year has been updated.
    Source code(tar.gz)
    Source code(zip)
  • v1.4.0(Nov 14, 2020)

    This release does not change the user interface or functionality, but this is more than a patch release because it changes the minimum required versions of many Python packages and uses newer Google API libraries.

    • Fixed compatibility between Handprint and more recent versions of the Google API libraries. The previous versions of the Google API are no longer supported by Handprint.
    • Fixed a bug in the main routine causing an error when trying to print exceptions.
    • Fixed a bug in catching errors in the Microsoft interface.
    • Update requirements.txt to remove no-longer used packages and update minimum version numbers.
    • Update README.md to acknowledge the Python dependencies actually being used now.

    The file CHANGES contains a more complete change log, and includes information about previous releases.

    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(Nov 11, 2020)

    This release brings a number of changes:

    • It now requires Python version 3.6 at minimum
    • The Microsoft service interface now uses Azure API v3.0
    • The Microsoft credentials scheme now allows you to change the endpoint URI
    • The Google service interface now only gets the document text results instead of all possible results
    • The possible program exit codes have changed slightly, and
    • Interruption via ^C should work better now.

    Some bugs have been fixed and internals have been (hopefully) improved.

    The file CHANGES contains a more complete change log, and includes information about previous releases.

    Source code(tar.gz)
    Source code(zip)
  • v1.2.2(Feb 20, 2020)

    This release fixes the Microsoft output in annotated images to be word-based, rather than line-based, to make it the same as for the other services. The copyright year in source files has also been updated.

    The file CHANGES contains a more complete change log that includes information about previous releases.

    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Jan 7, 2020)

    • Two bugs related to running with multiple threads (the default) are hopefully fixed in this version:
      • Sometimes the annotated image generated from a given service would have the results from another service also written over it. This was inconsistent and intermittent, and the exact cause is still unclear, but this version of Handprint implements a workaround that hopefully stops this from happening.
      • The Amazon service interface would sometimes fail with an error related to endpoint_resolver. This was due to the previous code not following recommendations about using a different connection session object in each separate thread. This is now fixed.
    • This version changes the way output files are named. The new scheme always includes the string handprint in the file name for easier recognition and to help reduce the chances of file name collisions. The scheme uses the naming pattern somefile.handprint.png for the rescaled input image, somefile.handprint-service.ext for the various service output results, and somefile.handprint-all.png for the summary grid image. (Issue #10.)
    • PDF files are now accepted as input. (Issue #11.) Note, however, that Handprint will only extract the first image in the PDF file.
    • The order in which resizing and rescaling is done has been swapped: if a file is too large, Handprint will first rescale it, and then if it is still too big (in byte size), it will resize the file. This appears to result in images that have higher resolution than the previous approach, which did the steps in the opposite order.
    • The URLs in the file of example URLs, tests/urls/caltech-archives-urls.txt, have become invalid. They have been replaced with other URLs that are valid (as of right now, anyway).
    • A few more bugs have been fixed.

    The file CHANGES contains a more complete change log that includes information about previous releases.

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Dec 24, 2019)

    This release adds support for comparing extracted text to expected (ground truth) text. To use it, users need to provide text files that contain the expected text for each input image; Handprint then produces tab-separated files listing the errors (compared to ground truth) in the results received from HTR services. Please see the relevant section in the top-level README file or the application help (via -h) for more details.

    Other changes:

    • The debug option -@ now accepts an argument for where to send the debug output trace; the behavior change of -@ is not backward compatible.
    • The installation instructions are (hopefully) improved and simplified.
    • There are internal architectural and organizational changes.
    • There are some bug fixes.
    • Most test images have been moved to a separate repository on GitHub.

    The file CHANGES contains a more complete change log, and includes information about previous releases.

    Source code(tar.gz)
    Source code(zip)
  • v1.0.3(Dec 11, 2019)

  • v1.0.2(Dec 11, 2019)

  • v1.0.1(Aug 21, 2019)

    This version fixes a bug writing files downloaded from URLs and adds instructions for installing from PyPI.

    General information: Handprint is a Python program to apply different handwritten text recognition services to images of handwritten text pages, and produce an annotated image (and optionally more) showing the text recognized. More information can be found at the project home page. The file CHANGES contains a more complete change log that includes information about previous releases.

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Aug 21, 2019)

    This is the first sufficiently complete and robust version of Handprint that can finally be called a version 1.0. There are very many changes compared to version 0.10.0, including a new way to provide credential files, new default output (in which results from different services are placed side-by-side in a single large image), new command-line arguments, parallel execution, and more.

    The file CHANGES contains a more complete change log that includes information about previous releases.

    Source code(tar.gz)
    Source code(zip)
  • 0.10.0(Jul 23, 2019)

    This release primarily adds support for Amazon's Rekognition and Textract services. It also updates some internal code and fixes some small bugs, and adds a code of conduct and contributor guidelines to the repository.

    Source code(tar.gz)
    Source code(zip)
  • 0.8.1(Nov 13, 2018)

    Detect and handle when the Google API returns a badly-formed bounding box. Also skip files previously generated by the annotation feature of Handprint.

    Source code(tar.gz)
    Source code(zip)
  • 0.8.0(Nov 9, 2018)

    The latest version of Handprint will create copies of the images in files named with the method extension (e.g., document-1.microsoft.jpg) and write overlays of the text and bounding boxes extracted by the methods. This makes it possible to see the text extracted directly over the source image. Generating these annotated images takes a little bit of time and if they are not necessary for your purposes, you can turn off annotation with the -A option (/A on Windows).

    Source code(tar.gz)
    Source code(zip)
  • 0.7.5(Nov 8, 2018)

    The user-visible change in this release is that chunks of text in the Microsoft Azure output (i.e., what is written to the .microsoft.txt files), are now separated using newlines, rather than spaces, to make the results more comparable to what Google produces.

    Source code(tar.gz)
    Source code(zip)
  • 0.7.3(Nov 7, 2018)

    This version improves efficiency by iterating over files/URLs first and then over methods, so that files do not get repeatedly downloaded each time a different method is used. It also works around some network compatibility problems on differnet environments, and finally, adds a number of small fixes to messages printed. Previous recent versions improved the handling of rate limits by cloud services, and catched more error conditions gracefully.

    Source code(tar.gz)
    Source code(zip)
Owner
Caltech Library
We manage the physical and digital holdings of the California Institute of Technology, provide services and training, and develop open-source software.
Caltech Library
Handwritten Text Recognition (HTR) system implemented with TensorFlow (TF) and trained on the IAM off-line HTR dataset. This Neural Network (NN) model recognizes the text contained in the images of segmented words.

Handwritten-Text-Recognition Handwritten Text Recognition (HTR) system implemented with TensorFlow (TF) and trained on the IAM off-line HTR dataset. T

null 27 Jan 8, 2023
Handwritten Text Recognition (HTR) using TensorFlow 2.x

Handwritten Text Recognition (HTR) system implemented using TensorFlow 2.x and trained on the Bentham/IAM/Rimes/Saint Gall/Washington offline HTR data

Arthur Flôr 160 Dec 21, 2022
Handwritten Text Recognition (HTR) system implemented with TensorFlow.

Handwritten Text Recognition with TensorFlow Update 2021: more robust model, faster dataloader, word beam search decoder also available for Windows Up

Harald Scheidl 1.5k Jan 7, 2023
OCR software for recognition of handwritten text

Handwriting OCR The project tries to create software for recognition of a handwritten text from photos (also for Czech language). It uses computer vis

Břetislav Hájek 562 Jan 3, 2023
This can be use to convert text in a file to handwritten text.

TextToHandwriting This can be used to convert text to handwriting. Clone this project or download the code. Run TextToImage.py give the filename of th

Ashutosh Mahapatra 2 Feb 6, 2022
Handwritten Number Recognition using CNN and Character Segmentation

Handwritten-Number-Recognition-With-Image-Segmentation Info About this repository This Repository is aimed at reading handwritten images of numbers an

Sparsha Saha 17 Aug 25, 2022
Total Text Dataset. It consists of 1555 images with more than 3 different text orientations: Horizontal, Multi-Oriented, and Curved, one of a kind.

Total-Text-Dataset (Official site) Updated on April 29, 2020 (Detection leaderboard is updated - highlighted E2E methods. Thank you shine-lcy.) Update

Chee Seng Chan 671 Dec 27, 2022
Detect handwritten words in a text-line (classic image processing method).

Word segmentation Implementation of scale space technique for word segmentation as proposed by R. Manmatha and N. Srimal. Even though the paper is fro

Harald Scheidl 190 Jan 3, 2023
Use Convolutional Recurrent Neural Network to recognize the Handwritten line text image without pre segmentation into words or characters. Use CTC loss Function to train.

Handwritten Line Text Recognition using Deep Learning with Tensorflow Description Use Convolutional Recurrent Neural Network to recognize the Handwrit

sushant097 224 Jan 7, 2023
Deskew is a command line tool for deskewing scanned text documents. It uses Hough transform to detect "text lines" in the image. As an output, you get an image rotated so that the lines are horizontal.

Deskew by Marek Mauder https://galfar.vevb.net/deskew https://github.com/galfar/deskew v1.30 2019-06-07 Overview Deskew is a command line tool for des

Marek Mauder 127 Dec 3, 2022
Code for generating synthetic text images as described in "Synthetic Data for Text Localisation in Natural Images", Ankush Gupta, Andrea Vedaldi, Andrew Zisserman, CVPR 2016.

SynthText Code for generating synthetic text images as described in "Synthetic Data for Text Localisation in Natural Images", Ankush Gupta, Andrea Ved

Ankush Gupta 1.8k Dec 28, 2022
An application of high resolution GANs to dewarp images of perturbed documents

Docuwarp This project is focused on dewarping document images through the usage of pix2pixHD, a GAN that is useful for general image to image translat

Thomas Huang 97 Dec 25, 2022
Provides OCR (Optical Character Recognition) services through web applications

OCR4all As suggested by the name one of the main goals of OCR4all is to allow basically any given user to independently perform OCR on a wide variety

null 174 Dec 31, 2022
This is used to convert a string to an Image with Handwritten Characters.

Text-to-Handwriting-using-python This is used to convert a string to an Image with Handwritten Characters. text_to_handwriting(string: str, save_to: s

Akashdeep Mahata 3 Aug 15, 2022
A tool for extracting text from scanned documents (via OCR), with user-defined post-processing.

The project is based on older versions of tesseract and other tools, and is now superseded by another project which allows for more granular control o

Maxim 32 Jul 24, 2022
A curated list of resources for text detection/recognition (optical character recognition ) with deep learning methods.

awesome-deep-text-detection-recognition A curated list of awesome deep learning based papers on text detection and recognition. Text Detection Papers

null 2.4k Jan 8, 2023
Text recognition (optical character recognition) with deep learning methods.

What Is Wrong With Scene Text Recognition Model Comparisons? Dataset and Model Analysis | paper | training and evaluation data | failure cases and cle

Clova AI Research 3.2k Jan 4, 2023