Fix DNN samples for compatibility with Python 3.

Add PyInt_Check in pyopencv_dnn.hpp.
This commit is contained in:
catree
2017-10-13 19:38:42 +02:00
parent 1ba29cc95d
commit 22dece8146
4 changed files with 12 additions and 8 deletions
+5
View File
@@ -16,6 +16,11 @@ bool pyopencv_to(PyObject *o, dnn::DictValue &dv, const char *name)
dv = dnn::DictValue((int64)PyLong_AsLongLong(o));
return true;
}
else if (PyInt_Check(o))
{
dv = dnn::DictValue((int64)PyInt_AS_LONG(o));
return true;
}
else if (PyFloat_Check(o))
{
dv = dnn::DictValue(PyFloat_AS_DOUBLE(o));