def log_video(self, tag, video, size=None, normalized=False, step=None):
    from skimage.transform import resize
    size = np.round(((size.detach().cpu().numpy() * [38, 78]) + [78, 157])).astype(int)
    if (video.shape[0] > 8):
        video = video[:8]
    video = video.detach().permute(0, 2, 1, 3, 4).to('cpu', non_blocking=True)
    step = (step or self.global_step)
    if (not normalized):
        video = utils.array_to_float_video((video * 50), low=(- 200), high=200, perc=False)
    self.logger.experiment.add_video(tag, video, step, fps=10)
    vs = video.detach().cpu().numpy()
    for (i, v) in enumerate(vs):
        for (j, image) in enumerate(v):
            image = image.transpose(1, 2, 0)
            if (size is not None):
                image = resize(image, size[i])
            mlflow.log_image(image, (tag + f'/{i}_{j}.png'))
def log_video(self, tag, video, size=None, normalized=False, step=None):
    from skimage.transform import resize
    size = np.round(((size.detach().cpu().numpy() * [38, 78]) + [78, 157])).astype(int)
    if (video.shape[0] > 8):
        video = video[:8]
    video = video.detach().permute(0, 2, 1, 3, 4).to('cpu', non_blocking=True)
    step = (step or self.global_step)
    if (not normalized):
        video = utils.array_to_float_video((video * 50), low=(- 200), high=200, perc=False)
    self.logger.experiment.add_video(tag, video, step, fps=10)
    vs = video.detach().cpu().numpy()
    for (i, v) in enumerate(vs):
        for (j, image) in enumerate(v):
            image = image.transpose(1, 2, 0)
            if (size is not None):
                image = resize(image, size[i])
            mlflow.log_image(image, (tag + f'/{i}_{j}.png'))