Home > Net >  Libtorch: The U-net segmentation output is correct, but repeated 3 times beside each other
Libtorch: The U-net segmentation output is correct, but repeated 3 times beside each other

Time:08-11

I’m trying to deploy the model at enter image description here

The output from the libtorch code is as follows: enter image description here

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);
  • Related