I’m trying to deploy the model at
The output from the libtorch code is as follows:
It looks similar to the output from PyTorch, but it’s repeated 3 times beside each other.
I failed to discover the reason for this mistake in the above C . Please, help to check and advise.
CodePudding user response:
The problem is here:
cv::Mat resultImg(448, 448, CV_8UC3);
this declares a matrix with 3 color channels, but you're saving an image with a single channel.
Change it to this:
cv::Mat resultImg(448, 448, CV_8U);