Thanks for your reply
I have already downloaded and installed deepstream_python_apps. As mentioned in Accessing Mask Parameters from NvOSD_MaskParams in Python (not using Triton), I modified the line
.def_readwrite("mask_params", &NvDsObjectMeta::mask_params)
in bindnvdsmeta.cpp file into :
.def_property_readonly("mask_params", [](NvDsObjectMeta &self) -> py::array {
auto dtype = py::dtype(
py::format_descriptor<float>::format());
auto base = py::array(dtype,
{self.mask_params.size},
{sizeof(float)});
return py::array(dtype, {self.mask_params.size},
{sizeof(float)},
self.mask_params.data, base);
})
But I always get the same error:
TypeError: Unable to convert function return value to Python type! The signature was
(self: pyds.NvDsObjectMeta) -> _NvOSD_MaskParams
I also tried to add in bindnvosd.cpp :
py::class_<NvOSD_MaskParams>(m, "NvOSD_MaskParams",
pydsdoc::NvOSD::MaskParamsDoc::descr)
.def(py::init<>())
.def_readwrite("data", &NvOSD_MaskParams::data)
.def_readwrite("size", &NvOSD_MaskParams::size)
.def_readwrite("threshold", &NvOSD_MaskParams::threshold)
.def_readwrite("width", &NvOSD_MaskParams::width)
.def_readwrite("height", &NvOSD_MaskParams::height)
.def("cast",
[](void *data) {
return (NvOSD_MaskParams *) data;
},
py::return_value_policy::reference,
pydsdoc::NvOSD::RectParamsDoc::cast)
.def("cast",
[](size_t data) {
return (NvOSD_MaskParams *) data;
},
py::return_value_policy::reference,
pydsdoc::NvOSD::MaskParamsDoc::cast);
But this error occurs when running make:
error: 'MaskParamsDoc' is not a member of 'pydsdoc::NvOSD'
pydsdoc::NvOSD::MaskParamsDoc::descr)
Please could you provide us more information on the files to be modified ?