Add high level API (Merge pull request #14780)
* Add high level API * Fix Model * Add DetectionModel * Add ClassificationModel * Fix classify * Add python test * Fix pytest * Fix comments to review * Fix detect * Fix docs * Modify DetectionOutput postprocessing * Fix test * Extract ref boxes * Fix draw rect * fix test * Add rect wrap * Fix wrap * Fix detect * Fix Rect wrap * Fix OCL_FP16 * Fix MyriadX * Fix nms * Fix NMS * Fix coords
This commit is contained in:
committed by
Maksim Shabunin
parent
f482050f9a
commit
778f42ad34
@@ -752,15 +752,6 @@ PyObject* pyopencv_from(const Size_<float>& sz)
|
||||
return Py_BuildValue("(ff)", sz.width, sz.height);
|
||||
}
|
||||
|
||||
template<>
|
||||
bool pyopencv_to(PyObject* obj, Rect& r, const char* name)
|
||||
{
|
||||
CV_UNUSED(name);
|
||||
if(!obj || obj == Py_None)
|
||||
return true;
|
||||
return PyArg_ParseTuple(obj, "iiii", &r.x, &r.y, &r.width, &r.height) > 0;
|
||||
}
|
||||
|
||||
template<>
|
||||
PyObject* pyopencv_from(const Rect& r)
|
||||
{
|
||||
@@ -1366,6 +1357,25 @@ template<> struct pyopencvVecConverter<RotatedRect>
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
bool pyopencv_to(PyObject* obj, Rect& r, const char* name)
|
||||
{
|
||||
CV_UNUSED(name);
|
||||
if(!obj || obj == Py_None)
|
||||
return true;
|
||||
|
||||
if (PyTuple_Check(obj))
|
||||
return PyArg_ParseTuple(obj, "iiii", &r.x, &r.y, &r.width, &r.height) > 0;
|
||||
else
|
||||
{
|
||||
std::vector<int> value(4);
|
||||
pyopencvVecConverter<int>::to(obj, value, ArgInfo(name, 0));
|
||||
r = Rect(value[0], value[1], value[2], value[3]);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
bool pyopencv_to(PyObject *obj, TermCriteria& dst, const char *name)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user