@@ -45,10 +45,10 @@ maxflow2d_wrapper(PyObject *self, PyObject *args)
45
45
46
46
int chns = 1 ;
47
47
if (dimI == 3 ) chns = shapeI[2 ];
48
- int outshape[2 ];
48
+ npy_intp outshape[2 ];
49
49
outshape[0 ]=shapeI[0 ];
50
50
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);
52
52
maxflow_inference ((unsigned char *) arr_L->data , (const float *) arr_I->data , (const float *) arr_P->data , NULL ,
53
53
shapeI[0 ], shapeI[1 ], chns, 2 , lambda, sigma);
54
54
@@ -100,10 +100,10 @@ interactive_maxflow2d_wrapper(PyObject *self, PyObject *args)
100
100
101
101
int chns = 1 ;
102
102
if (dimI == 3 ) chns = shapeI[2 ];
103
- int outshape[2 ];
103
+ npy_intp outshape[2 ];
104
104
outshape[0 ]=shapeI[0 ];
105
105
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);
107
107
maxflow_inference ((unsigned char *) arr_L->data , (const float *) arr_I->data ,
108
108
(const float *) arr_P->data , (const unsigned char *) arr_S->data ,
109
109
shapeI[0 ], shapeI[1 ], chns, 2 , lambda, sigma);
@@ -153,8 +153,8 @@ maxflow3d_wrapper(PyObject *self, PyObject *args)
153
153
154
154
int chns = 1 ;
155
155
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);
158
158
maxflow3d_inference ((unsigned char *) arr_L->data , (const float *) arr_I->data ,
159
159
(const float *) arr_P->data , NULL ,
160
160
shapeI[0 ], shapeI[1 ], shapeI[2 ], chns, 2 , lambda, sigma);
@@ -207,8 +207,8 @@ interactive_maxflow3d_wrapper(PyObject *self, PyObject *args)
207
207
208
208
int chns = 1 ;
209
209
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);
212
212
maxflow3d_inference ((unsigned char *) arr_L->data , (const float *) arr_I->data ,
213
213
(const float *) arr_P->data , (const unsigned char *) arr_S->data ,
214
214
shapeI[0 ], shapeI[1 ], shapeI[2 ], chns, 2 , lambda, sigma);
0 commit comments