It is my implementation of parse-bbox-func
extern "C"
bool ForTestParseBox(std::vector<NvDsInferLayerInfo> const &outputLayersInfo,
NvDsInferNetworkInfo const &networkInfo,
NvDsInferParseDetectionParams const &detectionParams,
std::vector<NvDsInferObjectDetectionInfo> &objectList)
{
float* result = (float*)outputLayersInfo[0].buffer;
int numClassesToParse = detectionParams.numClassesConfigured;
for (size_t i = 0; i < numClassesToParse; i++)
{
NvDsInferObjectDetectionInfo object;
object.classId = i;
object.detectionConfidence = 0.7;
object.left = (int)result[4 * i + 3];
object.top = (int)result[4 * i + 4]; //CLIP(recty1, 0, networkInfo.height - 1);
object.width = (int)result[4 * i + 1] - (int)result[4 * i + 3]; //CLIP(rectx2, 0, networkInfo.width - 1) - object.left + 1;
object.height = (int)result[4 * i + 2] - (int)result[4 * i + 4]; //CLIP(recty2, 0, networkInfo.height - 1) - object.top + 1;
std::cout << numClassesToParse << ":" << object.left << ":" << object.top << ":" << object.width << ":" << object.height << std::endl;
objectList.push_back(object);
}
return true;
}
It doesn’t show anything.I checked the data(object.left,object.top,object.width,object.height) and it was correct.