Skip to content

Commit fca235c

Browse files
committed
update numpy version to 1.19.11
1 parent 2c7871a commit fca235c

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

densecrf_python/densecrf.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ densecrf_wrapper(PyObject *self, PyObject *args)
4242
VectorXs map = dense_crf_inference((const unsigned char *)arr_I->data, (const float *)arr_fP->data,
4343
shape_fP[0], shape_fP[1], shape_fP[2], crf_param);
4444

45-
int outshape[2];
45+
npy_intp outshape[2];
4646
outshape[0]=shape_fP[0];
4747
outshape[1]=shape_fP[1];
48-
PyArrayObject * labels = (PyArrayObject*) PyArray_FromDims(2, outshape, NPY_INT8);
48+
PyArrayObject * labels = (PyArrayObject*) PyArray_SimpleNew(2, outshape, NPY_INT8);
4949
for (int x=0;x<outshape[0]*outshape[1];x++)
5050
{
5151
*(labels->data + x*labels->strides[1]) = map[x];

densecrf_python/densecrf3d.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ dense_crf_wrapper(PyObject *self, PyObject *args)
141141
(unsigned char *)arr_I->data);
142142
MatrixXf probMapsMatrix = crf3d.inference(MaxIterations);
143143
VectorXs segmentationVector = crf3d.currentMap(probMapsMatrix);
144-
int outshape[3];
144+
npy_intp outshape[3];
145145
outshape[0] = shape_P[0];
146146
outshape[1] = shape_P[1];
147147
outshape[2] = shape_P[2];
148-
PyArrayObject * labels = (PyArrayObject*) PyArray_FromDims(3, outshape, NPY_INT8);
148+
PyArrayObject * labels = (PyArrayObject*) PyArray_SimpleNew(3, outshape, NPY_INT8);
149149
for(int i = 0; i < num_voxel; i++)
150150
{
151151
*(labels->data + i) = segmentationVector(i);

maxflow_python/maxflow.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ maxflow2d_wrapper(PyObject *self, PyObject *args)
4545

4646
int chns = 1;
4747
if(dimI == 3) chns = shapeI[2];
48-
int outshape[2];
48+
npy_intp outshape[2];
4949
outshape[0]=shapeI[0];
5050
outshape[1]=shapeI[1];
51-
PyArrayObject * arr_L = (PyArrayObject*) PyArray_FromDims(2, outshape, NPY_INT8);
51+
PyArrayObject * arr_L = (PyArrayObject*) PyArray_SimpleNew(2, outshape, NPY_INT8);
5252
maxflow_inference((unsigned char *) arr_L->data, (const float *) arr_I->data, (const float *) arr_P->data, NULL,
5353
shapeI[0], shapeI[1], chns, 2, lambda, sigma);
5454

@@ -100,10 +100,10 @@ interactive_maxflow2d_wrapper(PyObject *self, PyObject *args)
100100

101101
int chns = 1;
102102
if(dimI == 3) chns = shapeI[2];
103-
int outshape[2];
103+
npy_intp outshape[2];
104104
outshape[0]=shapeI[0];
105105
outshape[1]=shapeI[1];
106-
PyArrayObject * arr_L = (PyArrayObject*) PyArray_FromDims(2, outshape, NPY_INT8);
106+
PyArrayObject * arr_L = (PyArrayObject*) PyArray_SimpleNew(2, outshape, NPY_INT8);
107107
maxflow_inference((unsigned char *) arr_L->data, (const float *) arr_I->data,
108108
(const float *) arr_P->data, (const unsigned char *) arr_S->data,
109109
shapeI[0], shapeI[1], chns, 2, lambda, sigma);
@@ -153,8 +153,8 @@ maxflow3d_wrapper(PyObject *self, PyObject *args)
153153

154154
int chns = 1;
155155
if(dimI == 4) chns = shapeI[3];
156-
int outshape[3] = {shapeI[0], shapeI[1], shapeI[2]};
157-
PyArrayObject * arr_L = (PyArrayObject*) PyArray_FromDims(3, outshape, NPY_INT8);
156+
npy_intp outshape[3] = {shapeI[0], shapeI[1], shapeI[2]};
157+
PyArrayObject * arr_L = (PyArrayObject*) PyArray_SimpleNew(3, outshape, NPY_INT8);
158158
maxflow3d_inference((unsigned char *) arr_L->data, (const float *) arr_I->data,
159159
(const float *) arr_P->data, NULL,
160160
shapeI[0], shapeI[1], shapeI[2], chns, 2, lambda, sigma);
@@ -207,8 +207,8 @@ interactive_maxflow3d_wrapper(PyObject *self, PyObject *args)
207207

208208
int chns = 1;
209209
if(dimI == 4) chns = shapeI[3];
210-
int outshape[3] = {shapeI[0], shapeI[1], shapeI[2]};
211-
PyArrayObject * arr_L = (PyArrayObject*) PyArray_FromDims(3, outshape, NPY_INT8);
210+
npy_intp outshape[3] = {shapeI[0], shapeI[1], shapeI[2]};
211+
PyArrayObject * arr_L = (PyArrayObject*) PyArray_SimpleNew(3, outshape, NPY_INT8);
212212
maxflow3d_inference((unsigned char *) arr_L->data, (const float *) arr_I->data,
213213
(const float *) arr_P->data, (const unsigned char *) arr_S->data,
214214
shapeI[0], shapeI[1], shapeI[2], chns, 2, lambda, sigma);

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
numpy>=1.19.1

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272

7373
setup(name=package_name,
74-
version = "0.0.6",
74+
version = "0.1.0",
7575
author ='Guotai Wang',
7676
author_email = '[email protected]',
7777
description = description,

0 commit comments

Comments
 (0)