This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

pyopenbr

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

Simple Usage:

import pyopenbr
result = pyopenbr.run(algorithm="FaceRecognition", compare="image1.jpg model.gal")
print(result)

Documentation:

Parameters:

The parameters and the algorithms are exactly the same as the OpenBR Command-Line tool. The official documentation can be found at: http://openbiometrics.org/docs/api_docs/cl_api/

Syntax:

These are valid syntax examples for doing the same thing:

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

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

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

Notes:

  • 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: http://openbiometrics.org/docs/tutorials/#face-recognition
# and see the similarities in the usage.
import pyopenbr

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

# Run a test of the trained model:
result = pyopenbr.run(algorithm="FaceRecognition", compare="model.gal 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.

Requirements:

You need to have OpenBR installed on your system. For installation instructions please visit: http://openbiometrics.org/docs/install/

Compatibility:

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.

Advantages/Disadvantages:

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.

Notice:

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.

Contact:

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

Twitter: @ant0nisktz

License:

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

0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

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 HPE HPE Development 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