Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
__pycache__
*.so
lib/coco/PythonAPI/build/
lib/coco/PythonAPI/pycocotools/_mask.c
lib/multicut_cython/build/
lib/multicut_cython/multicut.cpp
lib/nms_cython/build/
lib/nms_cython/nms_grid.cpp
models/mpii/mpii-single-resnet-101.*
models/coco/coco-resnet-101.*
models/coco/pairwise*
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ In _Conference on Computer Vision and Pattern Recognition (CVPR)_, 2017**
For more information visit http://pose.mpi-inf.mpg.de

Python 3 is required to run this code.
First of all, you should install TensorFlow as described in the
[official documentation](https://www.tensorflow.org/install/).
We recommended to use `virtualenv`.
On Linux, you may need to install the `python3-dev` and `python3-tk` packages.

You will also need to install the following Python packages:
We recommended using `virtualenv` to create an isolated Python environment.

You will also need to install the Python packages listed in `requirements.txt`,
including TensorFlow:

```
$ pip3 install scipy scikit-image matplotlib pyyaml easydict cython munkres
$ pip install -r requirements.txt
```

When running training or prediction scripts, please make sure to set the environment variable
Expand Down Expand Up @@ -82,4 +83,3 @@ Please cite ArtTrack and DeeperCut in your publications if it helps your researc
url = {http://arxiv.org/abs/1605.03170},
author = {Eldar Insafutdinov and Leonid Pishchulin and Bjoern Andres and Mykhaylo Andriluka and Bernt Schiele}
}

2 changes: 1 addition & 1 deletion lib/multicut_cython/multicut.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def solve_nl_lmp(np.ndarray[np.float64_t, ndim=2, mode="c"] unary_array,
is_sparse_graph, solver_type, do_suppression, logit_in_solver):


cdef np.ndarray[np.uint64_t, ndim=2, mode="c"] result = np.zeros([unary_array.shape[0], 2], dtype=np.uint64)
cdef np.ndarray[np.ulonglong_t, ndim=2, mode="c"] result = np.zeros([unary_array.shape[0], 2], dtype=np.ulonglong)

solve_nl_lmp_cpp(&unary_array[0, 0], unary_array.shape[0], unary_array.shape[1],
&pwidx_array[0, 0], pwidx_array.shape[0], pwidx_array.shape[1],
Expand Down
12 changes: 7 additions & 5 deletions lib/multicut_cython/solve_nl_lmp.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@

#include <algorithm>

#include <array>

#include <vector>

#include <iostream>

using namespace std;

template <typename T>
template <typename T>
andres::View<T> get_view2d(T *gridData, int grid_height, int grid_width)
{
std::array<size_t, 2> shape;
shape[0] = grid_height;
shape[1] = grid_width;
andres::View<T> view(shape.begin(), shape.end(), gridData, andres::FirstMajorOrder);
andres::View<T> view(shape.begin(), shape.end(), gridData, andres::FirstMajorOrder);
return view;
}

Expand All @@ -26,7 +28,7 @@ void solve_nl_lmp_cpp(double *unValues, int un_H, int un_W,
uint16_t* pwIndices, int pwi_H, int pwi_W,
double* pwValues, int pwv_H, int pwv_W,
bool is_sparse_graph, bool solver_type, bool do_suppression, bool do_logit_transform,
uint64_t *result)
unsigned long long* result)
{
andres::View<uint16_t> pwind_view = get_view2d<uint16_t>(pwIndices, pwi_H, pwi_W);
andres::View<double> un_view = get_view2d<double>(unValues, un_H, un_W);
Expand Down Expand Up @@ -58,12 +60,12 @@ void solve_nl_lmp_cpp(double *unValues, int un_H, int un_W,
else {
//unLab = solve_lmp_complete_graph(un_view, pwind_view, pw_view, do_suppression);

unLab = solve_nl_lmp_complete_graph(un_view, pwind_view, pw_view, method, do_logit_transform, do_suppression);
unLab = solve_nl_lmp_complete_graph(un_view, pwind_view, pw_view, method, do_logit_transform, do_suppression);
}
}
assert(unLab.size() > 0);

andres::View<uint64_t> result_view = get_view2d<uint64_t>(result, un_H, 2);
andres::View<unsigned long long> result_view = get_view2d<unsigned long long>(result, un_H, 2);
for(int k = 0; k < un_H; ++k)
{
result_view(k, 0) = unLab(k, 0);
Expand Down
10 changes: 6 additions & 4 deletions lib/nms_cython/include/nms_scoremap.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

// #include <numpy/arrayobject.h>

#include <array>

#include <vector>

#include <iostream>
Expand All @@ -25,11 +27,11 @@ std::vector<int> nms_grid_cpp(const float *unProbValues, size_t height, size_t w
// cout << "width: " << width << endl;
const size_t num_locs = height * width;

// MA: is this row or column major?
// MA: is this row or column major?
std::array<size_t, 2> shape;
shape[0] = grid_height;
shape[1] = grid_width;
andres::View<unsigned char> grid(shape.begin(), shape.end(), gridData);
andres::View<unsigned char> grid(shape.begin(), shape.end(), gridData);

std::vector<int> indices(height*width);
for(int i = 0; i < num_locs; ++i)
Expand Down Expand Up @@ -100,12 +102,12 @@ std::vector<int> nms_grid_cpp_test(float *unProbValues, size_t height, size_t wi
std::array<size_t, 2> shape;
shape[0] = height;
shape[1] = width;
andres::View<float> grid(shape.begin(), shape.end(), unProbValues);
andres::View<float> grid(shape.begin(), shape.end(), unProbValues);

std::cout << "Hello fuck! " << height << " " << width << std::endl;
std::vector<int> result;
result.push_back(5);
result.push_back(3);
result.push_back(1);
return result;
}
}
9 changes: 9 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cython
easydict
matplotlib
munkres
numpy
pyyaml
scikit-image
scipy
tensorflow