This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Improved Python Wrapper for the OpenBR Command-line Tool.

Project Description


An alternative Python wrapper for OpenBR which uses the Command Line Tool.

Simple Usage:

import pyopenbr
result ="FaceRecognition", compare="image1.jpg")



The parameters and the algorithms are exactly the same as the OpenBR Command-Line tool. The official documentation can be found at:


These are valid syntax examples for doing the same thing:

# [1st Option] --> RECOMMENDED
result ="output.csv", algorithm="FaceRecognition", compare="image1.jpg")

# [2nd Option - Splitting the parameter-option pairs]
result ="output.csv", "-algorithm FaceRecognition", "-compare image1.jpg")

# [3rd Option - Copying the Command Line Tool's parameters as a second argument of the `run` function]
result ="output.csv", "-algorithm FaceRecognition -compare image1.jpg")


  • The output parameter is optional.
  • The argument names for the 1st option are not hard-coded. This means that any argument is translated to the format whic the OpenBR tool uses.
  • The command always returns the content of the output of the OpenBR tool. (even if it is an unreadable format - e.g. raw format)
  • If the output parameter is omitted, or it ends in .csv, then the returned value will be a Dictionary with the result of the OpenBR tool.

Example - Face Recognition:

# You can read the official tutorial with the Command Line tool here:
# and see the similarities in the usage.
import pyopenbr

# Train the model with images in the `train` directory and store it in ``:"", "-enrollAll -enroll train/", algorithm="FaceRecognition")

# Run a test of the trained model:
result ="FaceRecognition", compare=" testImage.jpg")

Options to Configure:

You can configure two things in the module:

  • Disable error printing in the Terminal: pyopenbr.disableErrors()
  • Provide your Path for the OpenBR Command-Line tool: pyopenbr.setExecutable(path). By default, the module will try to find the executable in your system.


You need to have OpenBR installed on your system. For installation instructions please visit:


The module is compatible with Windows, Mac OS X and *nix Systems. It has been tested under Mac OS X El Capitan. Both Python 2.7 and Python 3 are supported.


Using this Wrapper has many advantages that the official Python wrapper doesn’t: - Solves many Memory Issues (e.g. when handling a lot of images), and it is simpler to use. - Won’t throw any Segmentation Faults or other C/C++ related errors, which are common in the official wrapper. - Doesn’t need special parameters when you run cmake in order to be installed. - Simple usage, because it is similar to the OpenBR Command Line tool. (Which is also the most well-documented in the OpenBR Website, including Tutorials).

However, there is one disadvantage: It is slower than the official python wrapper. The official wrapper doesn’t initialize/finalize the OpenBR object when used for many sequential processeses. This one, however, does. This is unavoidable since we essentially call the OpenBR command line tool.

Speed Test:

I did a quick experiment to see the time difference between the official Python wrapper and this module. The test was about recognizing a face of the same image, against a trained model:

  • The official Wrapper timing: 0.182754993439
  • Our timing: 0.663321971893

So, there is a huge difference between the speed performance of the two wrappers. Probably this is the trade-off between speed and stability.


This is a rather simple wrapper which uses basic ways to communicate with the OpenBR executable. However, it is stable and easy to use, which is the reason why I publish it as open-source.


You can contact me via e-mail at: antonis.katzourakis{AT}gmail{DOT}com

Twitter: @ant0nisktz


Copyright 2016 Antonios Katzourakis
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Release History

Release History

This version
History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pyopenbr-0.2.tar.gz (5.2 kB) Copy SHA256 Checksum SHA256 Source Sep 24, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting