I wrote this example that should be able to convert tensors to images. It might not work 100% for you but it should help 
import torch
from torchvision import transforms

tensor_2_image = transforms.ToPILImage() # Converts to Image
output = torch.randn(2, 3, 16, 56, 56) # Tensor

for batch in output:
  batch = batch.permute(1, 0, 2, 3) # Change axises -> 16,3,56,56
  images = [tensor_2_image(im) for im in batch] # Convert images
  for image in images:
    print(image)
    # Do what you want with your image here

Edit: Perhaps OpenCV wants a numpy array when I think about it. You can convert the image to a numpy array with np_image = np.array(image)