Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 950 Bytes

GETTINGSTARTED.md

File metadata and controls

52 lines (36 loc) · 950 Bytes

📚 Getting Started

🎉 Quick Start

Here's a simple example demonstrating how to use CeLux to read video frames and process them:

import celux as cx

def process_frame(frame):
    # Implement your frame processing logic here
    pass

with cx.VideoReader(
    "path/to/input/video.mp4",
) as reader:
    for frame in reader:
        # Frame is a PyTorch tensor in HWC format
        process_frame(frame)

Parameters:

  • device (str): Device to use. Can be "cpu" or "cuda".

📜 Detailed Usage

CeLux allows you to efficiently decode and process video frames with ease. Below are some common operations:

Initialize VideoReader

reader = cx.VideoReader(
    "path/to/video.mp4",
)

Iterate Through Frames

for frame in reader:
    # Your processing logic
    pass

Access Video Properties

properties = reader.get_properties()
print(properties)