def __init__(self, my_list, pad, diffScenes=-1, frameFormat="RGB", addPadding=True, useHalf=False): self.list = my_list self.pad = pad self.combos = [] self.addPad = addPadding self.frameFormat = frameFormat self.useHalf = useHalf for i in range(0, len(my_list) - 1): if diffScenes > -1: skip_interpolation = psnr.IsDiffScenes(my_list[i], my_list[i + 1], diffScenes) if skip_interpolation: print("Scene detection between frames {} and {}".format( i, i + 1)) continue self.combos.append({ "f1": my_list[i], "f2": my_list[i + 1], "i": -1 })
def CheckAllScenes(self, myRenderData, diff): self.SetFolders(myRenderData) files = self._make_video_dataset(self.originalFrames) diffs = [] for i in range(1, len(files)): if psnr.IsDiffScenes(files[i - 1], files[i], diff): diffs.append(files[i - 1]) diffs.append(files[i]) return diffs