diff --git a/requirements-linux-lite.txt b/requirements-linux-lite.txt index 8192b73a..28d00cc6 100644 --- a/requirements-linux-lite.txt +++ b/requirements-linux-lite.txt @@ -20,6 +20,6 @@ torch==2.5.1 torchvision==0.20.1 pymediainfo torchmetrics -celux==0.5.3 +celux==0.5.4 https://github.com/NevermindNilas/TAS-Modes-Host/releases/download/main/upscale_ncnn_py-1.2.0-cp312-none-manylinux1_x86_64.whl https://github.com/NevermindNilas/TAS-Modes-Host/releases/download/main/rife_ncnn_vulkan_python-1.3.0-cp312-cp312-linux_x86_64.whl diff --git a/requirements-linux.txt b/requirements-linux.txt index 95395c51..bec1e10e 100644 --- a/requirements-linux.txt +++ b/requirements-linux.txt @@ -25,6 +25,6 @@ torch==2.5.1 torchvision==0.20.1 pymediainfo torchmetrics -celux==0.5.3 +celux==0.5.4 https://github.com/NevermindNilas/TAS-Modes-Host/releases/download/main/upscale_ncnn_py-1.2.0-cp312-none-manylinux1_x86_64.whl https://github.com/NevermindNilas/TAS-Modes-Host/releases/download/main/rife_ncnn_vulkan_python-1.3.0-cp312-cp312-linux_x86_64.whl diff --git a/requirements-windows-lite.txt b/requirements-windows-lite.txt index 69e187bc..feba77be 100644 --- a/requirements-windows-lite.txt +++ b/requirements-windows-lite.txt @@ -17,7 +17,7 @@ rich rich-argparse flask torchmetrics -celux==0.5.3 +celux==0.5.4 torch==2.5.1 pymediainfo torchvision==0.20.1 diff --git a/requirements-windows.txt b/requirements-windows.txt index 34f3f183..df5b9ce7 100644 --- a/requirements-windows.txt +++ b/requirements-windows.txt @@ -26,6 +26,6 @@ tensorrt-cu12-bindings==10.7.0 tensorrt-cu12_libs==10.7.0 torchmetrics pymediainfo -celux==0.5.3 +celux==0.5.4 https://github.com/NevermindNilas/TAS-Modes-Host/releases/download/main/rife_ncnn_vulkan_python-1.2.1-cp312-cp312-win_amd64.whl https://github.com/NevermindNilas/TAS-Modes-Host/releases/download/main/upscale_ncnn_py-1.2.0-cp312-none-win_amd64.whl diff --git a/src/dedup/dedup.py b/src/dedup/dedup.py index 9e544af3..db6b13a4 100644 --- a/src/dedup/dedup.py +++ b/src/dedup/dedup.py @@ -299,7 +299,9 @@ def __call__(self, frame): with torch.cuda.stream(self.normStream): frame = self.prepareFrame(frame) - self.dummyInput.copy_(torch.cat((self.prevFrame, frame), dim=1)) + self.dummyInput.copy_( + torch.cat((self.prevFrame, frame), dim=1), non_blocking=True + ) self.normStream.synchronize() with torch.cuda.stream(self.stream): diff --git a/src/utils/ffmpegSettings.py b/src/utils/ffmpegSettings.py index eca3e65a..85b94bef 100644 --- a/src/utils/ffmpegSettings.py +++ b/src/utils/ffmpegSettings.py @@ -385,7 +385,6 @@ def matchEncoder(encode_method: str): return command - class BuildBuffer: def __init__( self, @@ -400,7 +399,7 @@ def __init__( resizeMethod: str = "bicubic", width: int = 1920, height: int = 1080, - mainPath: str = "" + mainPath: str = "", ): """ Initializes the BuildBuffer class. @@ -445,22 +444,31 @@ def __init__( try: if outpoint != 0.0: self.reader = VideoReader( - videoInput, device="cpu", num_threads=decodeThreads, filters=filters + videoInput, + device="cpu", + num_threads=decodeThreads, + filters=filters, )([float(inpoint), float(outpoint)]) else: self.reader = VideoReader( - videoInput, device="cpu", num_threads=decodeThreads, filters=filters + videoInput, + device="cpu", + num_threads=decodeThreads, + filters=filters, ) + logging.info("Using celux.VideoReader for video decoding") except Exception as e: logging.error(f"Failed to initialize celux.VideoReader: {e}") logging.info("Falling back to OpenCV for video decoding") self.useOpenCV = True self.initializeOpenCV(videoInput, inputFramePoint, outputFramePoint) - + # Delete from memory, can't trust the garbage collector del jsonMetadata - def initializeOpenCV(self, videoInput: str, inputFramePoint: int = 0, outputFramePoint: int = 0): + def initializeOpenCV( + self, videoInput: str, inputFramePoint: int = 0, outputFramePoint: int = 0 + ): """ Initializes the OpenCV video reader. """ @@ -567,6 +575,8 @@ def isQueueEmpty(self) -> bool: Whether the decoding buffer is empty. """ return self.decodeBuffer.empty() + + class WriteBuffer: def __init__( self,