Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU): GPU
• DeepStream Version:deepstream 6.0
• TensorRT Version:tensorrt8
• Issue Type( questions, new requirements, bugs) :questions
When I try to deploy the yolov5s-seg instance segmentation model in deepstream, I have a problem that the mask of the target is not displayed, or displayed incompletely.
The image size is 1920×1080, and the network input size is 640×640. Through debugging, we know that the mask will not rescale to the original image size. Therefore, in the post-processing, I restore the mask to the original image, and the data in the mask is a value of 0-1.
In addition, through the following tests, we can confirm that there is no problem with the incoming data.
obj.mask_size = kImageH * kImageW * sizeof(float);
obj.mask = new float[kImageH * kImageW];
obj.mask_width = kImageW;
obj.mask_height = kImageH;
float* rawMask = reinterpret_cast<float *>(masks.at(idx).data);
memcpy (obj.mask, rawMask, obj.mask_size);
// test for memcpy
cv::Mat tmp(kInputH, kInputW, CV_32FC1, (void*)obj.mask);
cv::Mat uchar_mat;
tmp.convertTo(uchar_mat, CV_8UC1, 255);
cv::imwrite(std::to_string(idx)+".jpg", uchar_mat);
below is the output:
But the final output mask is wrong, the result is as follows:
So, I want to know what the data in the mask should be。