-
Notifications
You must be signed in to change notification settings - Fork 154
Ray Video Reader Enhancement #848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
suiyoubi
wants to merge
11
commits into
ray-api
Choose a base branch
from
aot/ray-video-reader-new
base: ray-api
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
67eeda4
Refactor video reading stages: Rename VideoReaderStage to VideoListSt…
suiyoubi 29a5510
Rename test_video_reader to test_video_list
suiyoubi 731a60e
Update VideoListStage name and corresponding tests to reflect new nam…
suiyoubi 85f6eb0
Update test assertions in VideoReaderDownloadStage to use "video_list…
suiyoubi 302f0d2
Refactor video processing stages: Replace VideoDownloadStage with Vid…
suiyoubi e33c117
Enhance VideoListStage and VideoReaderStage documentation
suiyoubi 841793b
Refactor video reading pipeline: Introduce VideoLoadingStage as a com…
suiyoubi b3f4b02
Remove SplitPipeTask from video module and update imports accordingly.
suiyoubi 41de3dd
Refactor video task imports: Update import statements in video_list, …
suiyoubi 7aa2ca4
ruff fix
suiyoubi b0e2439
Implement FilePartitioningStage: Introduce a new stage for partitioni…
suiyoubi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
145 changes: 0 additions & 145 deletions
145
ray-curator/ray_curator/stages/video/io/video_download.py
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
from dataclasses import dataclass | ||
|
||
from ray_curator.stages.base import CompositeStage, ProcessingStage | ||
from ray_curator.stages.video.io.video_download import VideoDownloadStage | ||
from ray_curator.stages.io.reader.file_partitioning import FilePartitioningStage | ||
from ray_curator.stages.video.io.video_reader import VideoReaderStage | ||
from ray_curator.tasks import VideoTask, _EmptyTask | ||
from ray_curator.tasks import _EmptyTask | ||
from ray_curator.tasks.video import VideoTask | ||
|
||
|
||
@dataclass | ||
class VideoReaderDownloadStage(CompositeStage[_EmptyTask, VideoTask]): | ||
class VideoLoadingStage(CompositeStage[_EmptyTask, VideoTask]): | ||
"""Composite stage that reads video files from storage and downloads/processes them. | ||
|
||
This stage combines VideoReaderStage and VideoDownloadStage into a single | ||
This stage combines FilePartitioningStage and VideoReaderStage into a single | ||
high-level operation for reading video files from a directory and processing | ||
them with metadata extraction. | ||
|
||
|
@@ -29,20 +30,22 @@ def __post_init__(self): | |
|
||
@property | ||
def name(self) -> str: | ||
return "video_reader_download" | ||
return "video_loading" | ||
|
||
def decompose(self) -> list[ProcessingStage]: | ||
"""Decompose into constituent execution stages. | ||
|
||
Returns: | ||
List of processing stages: [VideoReaderStage, VideoDownloadStage] | ||
List of processing stages: [FilePartitioningStage, VideoReaderStage] | ||
""" | ||
reader_stage = VideoReaderStage( | ||
input_video_path=self.input_video_path, | ||
video_limit=self.video_limit | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Super nit should we also have video_limit be an |
||
reader_stage = FilePartitioningStage( | ||
file_paths=self.input_video_path, | ||
files_per_partition=1, | ||
file_extensions=[".mp4", ".mov", ".avi", ".mkv", ".webm"], | ||
limit=self.video_limit, | ||
) | ||
|
||
download_stage = VideoDownloadStage( | ||
download_stage = VideoReaderStage( | ||
verbose=self.verbose | ||
) | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what convention is right, and if we want to change it in future, but take a look here https://github.com/NVIDIA-NeMo/Curator/blob/ray-api/ray-curator/ray_curator/stages/io/reader/jsonl.py
We have a stage called
JsonlReaderStage(ProcessingStage[FileGroupTask, DocumentBatch])
and then the composite stage is calledJsonlReader(CompositeStage[_EmptyTask, DocumentBatch])
. Do we want to match that, and call it VideoReaderStage and VideoReader respectively?