Commit 1463feba authored by Rodrigo Benenson's avatar Rodrigo Benenson
Browse files

Reformated to be a proper package

parent 95091f84
# distutils: language = c++ # distutils: language = c++
# distutils: sources = eigen_impl.cpp # distutils: sources = pydensecrf/eigen_impl.cpp
# distutils: include_dirs = densecrf/include # distutils: include_dirs = pydensecrf/densecrf/include
# [::1] means we want a C-contiguous array. # [::1] means we want a C-contiguous array.
......
...@@ -19,9 +19,9 @@ Up = (U + 1) / (np.sum(U, axis=0) + 2) ...@@ -19,9 +19,9 @@ Up = (U + 1) / (np.sum(U, axis=0) + 2)
img = np.zeros((10,10,3), dtype=np.uint8) img = np.zeros((10,10,3), dtype=np.uint8)
img[2:8,2:8,:] = 255 img[2:8,2:8,:] = 255
# d.setUnaryEnergy(-np.log(Up)) d.setUnaryEnergy(-np.log(Up))
# d.setUnaryEnergy(PyConstUnary(-np.log(Up))) #d.setUnaryEnergy(PyConstUnary(-np.log(Up)))
d.addPairwiseBilateral(2, 2, img, 3)
# d.addPairwiseBilateral(2, 2, img, 3) # d.addPairwiseBilateral(2, 2, img, 3)
# d.addPairwiseBilateral(2, 2, img, 3) np.argmax(d.inference(10), axis=0).reshape(10,10)
# np.argmax(d.inference(10), axis=0).reshape(10,10)
...@@ -54,7 +54,7 @@ def create_pairwise_gaussian(sdims, shape): ...@@ -54,7 +54,7 @@ def create_pairwise_gaussian(sdims, shape):
""" """
# create mesh # create mesh
cord_range = [range(s) for s in shape] hcord_range = [range(s) for s in shape]
mesh = np.array(np.meshgrid(*cord_range, indexing='ij'), dtype=np.float32) mesh = np.array(np.meshgrid(*cord_range, indexing='ij'), dtype=np.float32)
# scale mesh accordingly # scale mesh accordingly
......
...@@ -13,6 +13,7 @@ setup( ...@@ -13,6 +13,7 @@ setup(
author="Lucas Beyer", author="Lucas Beyer",
author_email="lucasb.eyer.be@gmail.com", author_email="lucasb.eyer.be@gmail.com",
url="http://github.com/lucasb-eyer/pydensecrf", url="http://github.com/lucasb-eyer/pydensecrf",
ext_modules=cythonize(['eigen.pyx', 'densecrf.pyx']), ext_modules=cythonize(['pydensecrf/eigen.pyx', 'pydensecrf/densecrf.pyx']),
py_modules = ["pydensecrf/utils"]
) )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment