@@ -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);
0 commit comments