import numpy as np import datetime import torch import os import imageio class VideoProcessor: def __init__(self, save_path: str='./results', name_suffix: str=''): self.save_path = save_path os.makedirs(self.save_path, exist_ok=True) self.name_suffix = name_suffix def crop2standard540p(self, vid_array): _, height, width, _ = vid_array.shape height_center = height//2 width_center = width//2 if width_center>height_center: ## horizon mode return vid_array[:, height_center-270:height_center+270, width_center-480:width_center+480] elif width_center