Skip to content

Commit

Permalink
bump celux to 0.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
NevermindNilas committed Dec 28, 2024
1 parent 249969f commit 869b4ae
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion requirements-linux-lite.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion requirements-linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion requirements-windows-lite.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements-windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion src/dedup/dedup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
22 changes: 16 additions & 6 deletions src/utils/ffmpegSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ def matchEncoder(encode_method: str):
return command



class BuildBuffer:
def __init__(
self,
Expand All @@ -400,7 +399,7 @@ def __init__(
resizeMethod: str = "bicubic",
width: int = 1920,
height: int = 1080,
mainPath: str = ""
mainPath: str = "",
):
"""
Initializes the BuildBuffer class.
Expand Down Expand Up @@ -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.
"""
Expand Down Expand Up @@ -567,6 +575,8 @@ def isQueueEmpty(self) -> bool:
Whether the decoding buffer is empty.
"""
return self.decodeBuffer.empty()


class WriteBuffer:
def __init__(
self,
Expand Down

0 comments on commit 869b4ae

Please sign in to comment.