Handprint command summary

Command-line options

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

-a A

--add-creds A

Add credentials for service A and exit

-b B

--base-name B

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

-d D

--display D

Display annotation types D

Display text annotations

-e

--extended

Produce extended results

Produce only summary image

-f F

--from-file F

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

-m x,y

--text-move x,y

Move each text annotation by x,y

0,0

-n N

--confidence N

Use confidence score threshold N

0

-o O

--output O

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

-s S

--service S

Use recognition service S; see -l

Use all services

-t T

--threads T

Use T number of threads

Use (#cores)/2 threads

-V

--version

Write program version info and exit

-x X

--text-color X

Use color X for text annotations

Red

-z Z

--text-size Z

Use font size Z for text annotations

Use font size 12

-@ OUT

--debug OUT

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).