The command line API is a tool to run OpenBR from the command line. The command line is the easiest and fastest way to run OpenBR!
The following is a detailed description of the command line API. The command line API is really just a set of wrappers to call the [C API](c_api.md). All of the flags in this API have a corresponding C API call. To help display the examples the following shorthand definitions will be used:
Shortcut | Definition
--- | ---
<arg> | <> Represent an input argument
\{arg\} | \{\} Represent an output argument
[arg] | [] Represent an optional argument
(arg0 | ... | argN) | (... | ...) Represent a choice.
## Algorithms
Almost every command line process needs to specify an algorithm to work properly. Algorithms in OpenBR are described in detail [here](../tutorials.md#algorithms-in-openbr). To specify algorithms to the command line use the -algorithm flag like so:
-algorithm "AlgorithmString"
Make sure you use the quotes if your algorithm is longer than one plugin because special characters in OpenBR are also special characters (with very different meanings!) in Bash.
## Core Commands
### -train {: #train }
Train a model
* **arguments:**
-train ... [{model}]
* **wraps:** [br_train_n](c_api/functions.md#br_train_n)
### -enroll {: #enroll }
Enroll a [Gallery](cpp_api/gallery/gallery.md) through an algorithm
* **arguments:**
-enroll ... {output_gallery}
* **wraps:** [br_enroll](c_api/functions.md#br_enroll) or [br_enroll_n](c_api/functions.md#br_enroll_n) depending on the input size
### -compare {: #compare }
Compare query [Templates](cpp_api/template/template.md) against a target [Gallery](cpp_api/gallery/gallery.md)
* **arguments:**
-compare [{output}]
* **wraps:** [br_compare](c_api/functions.md#br_compare)
### -pairwiseCompare {: #pairwisecompare }
DOCUMENT ME
* **arguments:**
-pairwiseCompare [{output}]
* **wraps:** [br_pairwise_compare](c_api/functions.md#br_pairwise_compare)
### -eval {: #eval }
Evaluate a similarity matrix
* **arguments:**
-eval [] [{csv}] [{matches}]
* **wraps:** [br_eval](c_api/functions.md#br_eval)
### -inplaceEval {: #inplaceeval }
DOCUMENT ME
* **arguments:**
-inplaceEval [{output}]
* **wraps:** [br_inplace_eval](c_api/functions.md#br_inplace_eval)
### -plot {: #inplaceeval}
Plot the results of an evaluation
* **arguments:**
-plot ... {destination}
* **wraps:** [br_plot](c_api/functions.md#br_plot)
## Other Commands
### -fuse {: #fuse }
Perform score level fusion on similarity matrices.
* **arguments:**
-fuse ... (None|MinMax|ZScore|WScore) (Min|Max|Sum[W1:W2:...:Wn]|Replace|Difference|None) {simmat}
* **wraps:** [br_fuse](c_api/functions.md#br_fuse)
### -cluster {: #cluster }
Clusters one or more similarity matrices into a list of subjects
* **arguments:**
-cluster ... {csv}
* **wraps:** [br_cluster](c_api/functions.md#br_cluster)
### -makeMask {: #makemask }
Constructs a mask from target and query inputs
* **arguments:**
-makeMask {mask}
* **wraps:** [br_make_mask](c_api/functions.md#br_make_mask)
### -makePairwiseMask {: #makepairwisemask }
Constructs a mask from target and query inputs considering the target and input sets to be definite pairwise comparisons.
* **arguments:**
-makePairwiseMask {mask}
* **wraps:** [br_make_pairwise_mask](c_api/functions.md#br_make_pairwise_mask)
### -combineMasks {: #combinemask }
Combines several equal-sized mask matrices. A comparison may not be simultaneously indentified as both a genuine and an imposter by different input masks.
* **arguments:**
-combineMasks ... {mask} (And|Or)
* **wraps:** [br_combine_masks](c_api/functions.md#br_combine_masks)
### -cat {: #cat }
Concatenates a list of galleries into 1 gallery
* **arguments:**
-cat ... {gallery}
* **wraps:** [br_cat](c_api/functions.md#br_cat)
### -convert {: #convert }
Convert a file to a different type. Files can only be converted to types within the same group. For example formats can only be converted to other formats.
* **arguments:**
-convert (Format|Gallery|Output) {output_file}
* **wraps:** [br_convert](c_api/functions.md#br_convert)
### -evalClassification {: #evalclassification }
Evaluates and prints classification accuracy to terminal
* **arguments:**
-evalClassification
* **wraps:** [br_eval_classification](c_api/functions.md#br_eval_classification)
### -evalClustering {: #evalclustering }
Evaluates and prints clustering accuracy to the terminal
* **arguments:**
-evalClustering
* **wraps:** [br_eval_clustering](c_api/functions.md#br_eval_clustering)
### -evalDetection {: #evaldetection }
Evaluates and prints detection accuracy to terminal
* **arguments:**
-evalDetection [{csv}] [{normalize}] [{minSize}] [{maxSize}]
* **wraps:** [br_eval_detection](c_api/functions.md#br_eval_detection)
### -evalLandmarking {: #evallandmarking }
Evaluates and prints landmarking accuracy to terminal
* **arguments:**
-evalLandmarking [{csv} [ ] [sample_index] [total_examples]]
* **wraps:** [br_eval_landmarking](c_api/functions.md#br_eval_landmarking)
### -evalRegression {: #evalregression }
Evaluates regression accuracy to disk
* **arguments:**
-evalRegression
* **wraps:** [br_eval_regression](c_api/functions.md#br_eval_regression)
### -assertEval {: #asserteval }
Evaluates the similarity matrix using the mask matrix. Function aborts if TAR @ FAR = 0.001 does not meet an expected performance value.
* **arguments:**
-assertEval
* **wraps:** [br_assert_eval](c_api/functions.md#br_assert_eval)
### -plotDetection {: #plotdetection }
Renders detection performance figures for a set of .csv files created by [-evalDetection](#evaldetection).
* **arguments:**
-plotDetection ... {destination}
* **wraps:** [br_plot_detection](c_api/functions.md#br_plot_detection)
### -plotLandmarking {: #plotlandmarking }
Renders landmarking performance figures for a set of .csv files created by [-evalLandmarking](#evallandmarking)
* **arguments:**
-plotLandmarking ... {destination}
* **wraps:** [br_plot_landmarking](c_api/functions.md#br_plot_landmarking)
### -plotMetadata {: #plotmetadata }
Renders metadata figures for a set of .csv files with specified columns
* **arguments:**
-plotMetadata ...
* **wraps:** [br_plot_metadata](c_api/functions.md#br_plot_metadata)
### -project {: #project }
A naive alternative to [-enroll](#enroll)
* **arguments:**
-project {output_gallery}
* **wraps:** [br_project](c_api/functions.md#br_project)
### -getHeader {: #getheader }
Retrieve the target and query inputs in the [BEE matrix](../tutorials.md#the-evaluation-harness) header
* **arguments:**
-getHeader
* **wraps:** [br_get_header](c_api/functions.md#br_get_header)
### -setHeader {: #setheader }
Update the target and query inputs in the [BEE matrix](../tutorials.md#the-evaluation-harness) header
* **arguments:**
-setHeader {}
* **wraps:** [br_set_header](c_api/functions.md#br_set_header)
### -<key> <value> {: #setproperty }
Appends a provided value to the [global metadata](cpp_api/context/context.md) using a provided key
* **arguments:**
-
* **wraps:** [br_set_property](c_api/functions.md#br_set_property)
## Miscellaneous
### -help {: #help }
Print command line API documentation to the terminal
* **arguments:**
-help
* **wraps:** N/A
### -gui {: #gui }
If this flag is set OpenBR will enable GUI windows to be launched. It must be the first flag set.
* **arguments:**
br -gui
* **wraps:** N/A
### -objects {: #objects }
Returns names and parameters for the requested objects. Each object is newline separated. Arguments are separated from the object name with a tab. This function uses [QRegExp][QRegExp] syntax
* **arguments:**
-objects [abstraction [implementation]]
* **wraps:** [br_objects](c_api/functions.md#br_objects)
### -about {: #about }
Get a string with the name, version, and copyright of the project. This string is suitable for printing or terminal
* **arguments:**
-about
* **wraps:** [br_about](c_api/functions.md#br_about)
### -version {: #version }
Get the current OpenBR version
* **arguments:**
-version
* **wraps:** [br_version](c_api/functions.md#br_version)
### -slave {: #slave }
For internal use via [ProcessWrapperTransform](../plugin_docs/core.md#processwrappertransform)
* **arguments:**
-slave
* **wraps:** [br_slave_process](c_api/functions.md#br_slave_process)
### -daemon {: #daemon }
DOCUMENT ME
* **arguments:**
-daemon
* **wraps:** N/A
### -exit
Exit the application
* **arguments:**
-exit
* **wraps:** N/A
[QRegExp]: http://doc.qt.io/qt-5/QRegExp.html "QRegExp"