Hello all,
I am testing nvinfer with a custom model, for this model I need to change the padding color used in nvinfer. By default nvinfer uses a black padding but I would like to use a gray scale padding instead.
I found this code inside gstnvinfer.cpp:
/* Pad the scaled image with black color. */
cudaReturn =
cudaMemset2DAsync ((uint8_t *) destCudaPtr + pixel_size * dest_width,
dest_frame->planeParams.pitch[0], 0,
pixel_size * (dest_frame->width - dest_width), dest_frame->height,
nvinfer->convertStream);
if (cudaReturn != cudaSuccess) {
GST_ERROR_OBJECT (nvinfer,
"cudaMemset2DAsync failed with error %s while converting buffer",
cudaGetErrorName (cudaReturn));
return GST_FLOW_ERROR;
}
cudaReturn =
cudaMemset2DAsync ((uint8_t *) destCudaPtr +
dest_frame->planeParams.pitch[0] * dest_height,
dest_frame->planeParams.pitch[0], 0, pixel_size * dest_width,
dest_frame->height - dest_height, nvinfer->convertStream);
if (cudaReturn != cudaSuccess) {
GST_ERROR_OBJECT (nvinfer,
"cudaMemset2DAsync failed with error %s while converting buffer",
cudaGetErrorName (cudaReturn));
return GST_FLOW_ERROR;
}
First, the color choice for the padding will be an option in a future release of Deepstream?
Second, if I want to use a gray scale padding should I change the 0 by another value, recompile and installed it right? In this case what is the scale of pixels (0 to 255) ?
Finally there is a way to visualize/save this padded image ?