| 270 | // Function to get the docstring for an entry function |
| 271 | |
| 272 | inline std::string GetDocString(const std::string &strInto, const std::string &strTensor, const std::string &strMinMax) |
| 273 | { |
| 274 | std::string strSrc; |
| 275 | if (strTensor.find("tensor") != std::string::npos) |
| 276 | { |
| 277 | strSrc = std::string(R"pbdoc( |
| 278 | src (cvcuda.Tensor): Input tensor to get minimum/maximum values/locations.)pbdoc"); |
| 279 | } |
| 280 | else if (strTensor.find("batch") != std::string::npos) |
| 281 | { |
| 282 | strSrc = std::string(R"pbdoc( |
| 283 | src (cvcuda.ImageBatchVarShape): Input image batch to get minimum/maximum values/locations.)pbdoc"); |
| 284 | } |
| 285 | |
| 286 | std::string strArgs; |
| 287 | if (strInto.find("into") != std::string::npos) |
| 288 | { |
| 289 | if (strMinMax.find("min") != std::string::npos) |
| 290 | { |
| 291 | strArgs += std::string(R"pbdoc( |
| 292 | min_val (cvcuda.Tensor): Output tensor with minimum value. |
| 293 | min_loc (cvcuda.Tensor): Output tensor with minimum locations. |
| 294 | num_min (cvcuda.Tensor): Output tensor with number of minimum locations found.)pbdoc"); |
| 295 | } |
| 296 | if (strMinMax.find("max") != std::string::npos) |
| 297 | { |
| 298 | strArgs += std::string(R"pbdoc( |
| 299 | max_val (cvcuda.Tensor): Output tensor with maximum value. |
| 300 | max_loc (cvcuda.Tensor): Output tensor with maximum locations. |
| 301 | num_max (cvcuda.Tensor): Output tensor with number of maximum locations found.)pbdoc"); |
| 302 | } |
| 303 | strArgs += strSrc; |
| 304 | } |
| 305 | else |
| 306 | { |
| 307 | strArgs += strSrc; |
| 308 | strArgs += std::string(R"pbdoc( |
| 309 | max_locations (Number, optional): Number of maximum locations to find, default is 1% of total |
| 310 | pixels at a minimum of 1.)pbdoc"); |
| 311 | } |
| 312 | |
| 313 | std::string strReturns; |
| 314 | if (strMinMax.find("minimum/maximum") != std::string::npos) |
| 315 | { |
| 316 | strReturns = std::string(R"pbdoc( |
| 317 | Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]: A tuple with minimum value, locations and number |
| 318 | of minima, and also maximum value, locations and number of maxima.)pbdoc"); |
| 319 | } |
| 320 | else if (strMinMax.find("min") != std::string::npos) |
| 321 | { |
| 322 | strReturns = std::string(R"pbdoc( |
| 323 | Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]: A tuple with minimum value, locations and number |
| 324 | of minima.)pbdoc"); |
| 325 | } |
| 326 | else if (strMinMax.find("max") != std::string::npos) |
| 327 | { |
| 328 | strReturns = std::string(R"pbdoc( |
| 329 | Tuple[cvcuda.Tensor, cvcuda.Tensor, cvcuda.Tensor]: A tuple with maximum value, locations and number |
no test coverage detected