Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Python Bindings for Halide

By Connelly Barnes, 2012-2013. Updated by Fred Rotbart 2014.

This library allows you to write Halide code in Python 2.7. The library has currently only been tested on Mac OS, against a Halide source build.

Installation

Prerequisites

Install SWIG and Python libraries Numpy, and Python Image Library (PIL).

On Mac:

brew install swig         % Assumes you have Homebrew package manager (use your preferred package manager)
sudo easy_install pip
sudo pip install numpy pil

On Ubuntu Linux:

sudo apt-get install python-dev libpng12-dev python-imaging python-numpy swig

Building and Installing the Python bindings

Quick install:

sudo make install         % Install
make test                 % Optional: run unit tests

Detailed installation:

You can build Halide by using 'make' in the parent directory. This is done automatically by the Makefile for the Python bindings. The following make options are then provided for the Python bindings:

sudo make clean           % Clean in case any problems occurred
make                      % Build in place
make test                 % Run unit tests
sudo make install         % Build and install

Documentation and Examples

Consult the module documentation.

Check out the code for the example applications in the apps/ subdirectory. You can run them individually or as a batch:

make run_apps             % Run apps/*.py with GUI output 
make run_apps_headless    % Run apps; output to apps/out*.png

License

The Python bindings use the same MIT license as Halide.