-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
dnn / python: cv2.dnn.NMSBoxes throws SystemError #12299
Copy link
Copy link
Closed
Description
- OpenCV => 3.4.2
- Operating System / Platform => Windows 64 Bit
- Compiler => mingw
related: #12270
trying with code like:
#boxes = [(1,2,3,4),(2,1,3,4),(4,3,2,1)] # a list of tuples ?
boxes = np.array([[[1,2,3,4],[2,1,3,4],[4,3,2,1]]],np.int32) # a (2d) numpy array ?
conf = np.array([.6, .5, .2], np.float32)
indices = cv2.dnn.NMSBoxes(boxes, conf, .1, .1)
# expected: [0,2], but we get:
SystemError: <built-in function NMSBoxes> returned NULL without setting an error
generated code looks like this:
static PyObject* pyopencv_cv_dnn_NMSBoxes(PyObject* , PyObject* args, PyObject* kw)
{
using namespace cv::dnn;
PyObject* pyobj_bboxes = NULL;
vector_Rect bboxes;
PyObject* pyobj_scores = NULL;
vector_float scores;
float score_threshold=0.f;
float nms_threshold=0.f;
vector_int indices;
float eta=1.f;
int top_k=0;
const char* keywords[] = { "bboxes", "scores", "score_threshold", "nms_threshold", "eta", "top_k", NULL };
if( PyArg_ParseTupleAndKeywords(args, kw, "OOff|fi:NMSBoxes", (char**)keywords, &pyobj_bboxes, &pyobj_scores, &score_threshold, &nms_threshold, &eta, &top_k) &&
pyopencv_to(pyobj_bboxes, bboxes, ArgInfo("bboxes", 0)) &&
pyopencv_to(pyobj_scores, scores, ArgInfo("scores", 0)) )
{
ERRWRAP2(cv::dnn::NMSBoxes(bboxes, scores, score_threshold, nms_threshold, indices, eta, top_k));
return pyopencv_from(indices);
}
return NULL;
}
so, either PyArg_ParseTupleAndKeywords or pyopencv_to must have failed here, and it fell through, returning NULL.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels