Neda:

the first question is why it used only forward here outputs = model.forward(t_image) ?


Because they haven’t asked here to be told that you should use output = model(t_image). 
More seriously, you would not call .forward unless you have a very good reason to not call the model itself (i.e. you tried that, it failed, you know why it failed and why calling .forward is better and, personally, I’d ask here about why calling the model won’t work).


And the second question is how can I visualise the output of the test, for example, how can I display a test image and drow the mask for it based on my trained model? Is there any example for this? Thank you in advance.


I use pyplot a lot
# magic line only if you use Jupyter
%matplotlib inline
from matplotlib import pyplot
...
# assuming mask is batch x h x w and we want the first
pyplot.subplot(1, 2, 1) # have two plots in 1 row two columns, first plot
# assuming im is batch x channel x h x w and channel is RGB
pyplot.plot(im[0].detach().cpu().permute(1, 2, 0))
pyplot.subplot(1, 2, 2) # second plot
pyplot.plot(mask[0].detach().cpu())

Best regards
Thomas