-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Qwen 2.5 Omni: apply video defaults #37660
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
Changes from all commits
5d1d2f4
3614fb1
ea05767
ee6fea1
cc418bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,8 @@ class Qwen2_5OmniProcessorKwargs(ProcessingKwargs, total=False): | |
| "seconds_per_chunk": 2.0, | ||
| "position_id_per_seconds": 25, | ||
| "use_audio_in_video": False, | ||
| "min_pixels": 128 * 28 * 28, | ||
| "max_pixels": 768 * 28 * 28, | ||
| }, | ||
| "audio_kwargs": { | ||
| "sampling_rate": 16000, | ||
|
|
@@ -147,7 +149,7 @@ def __call__( | |
| seconds_per_chunk = output_kwargs["videos_kwargs"].pop("seconds_per_chunk") | ||
| position_id_per_seconds = output_kwargs["videos_kwargs"].pop("position_id_per_seconds") | ||
| use_audio_in_video = output_kwargs["videos_kwargs"].pop("use_audio_in_video") | ||
| fps = output_kwargs["videos_kwargs"].pop("fps", None) | ||
| fps = output_kwargs["videos_kwargs"].pop("fps", 2.0) | ||
|
Member
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. ah, then we can put it in
Member
Author
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. Yes, but when I tested I think it was not being properly forwarded to all the places where it's needed. I'll take a quick look, otherwise we can merge this and handle the fps in another PR.
Member
Author
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. I think that consistently using the video fps provided by the user, or defaulting to the value in
Member
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. Related to #37687 as well, users should be able to overwrite the value indeed. And the naming diverged without us noticing 😢 |
||
|
|
||
| if audio is not None: | ||
| output_kwargs["audio_kwargs"]["padding"] = "max_length" # Support "max_length" padding only here | ||
|
|
@@ -174,8 +176,7 @@ def __call__( | |
| if videos is not None: | ||
| videos = make_batched_videos(videos) | ||
| videos_inputs = self.image_processor(images=None, videos=videos, **output_kwargs["videos_kwargs"]) | ||
| if fps is None: | ||
| fps = [2.0] * len(videos) | ||
| fps = [fps] * len(videos) | ||
|
Member
Author
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. This is technically unrelated, but I don't think the input kwarg is expected as a list in this method. |
||
| videos_inputs["video_second_per_grid"] = [ | ||
| self.image_processor.temporal_patch_size / fps[i] for i in range(len(fps)) | ||
| ] | ||
|
|
||
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.
From https://github.com/QwenLM/Qwen2.5-Omni/blob/7c8dddb38d52a58ce57e778e10fa0eaf26e078e9/qwen-omni-utils/src/qwen_omni_utils/v2_5/vision_process.py#L30
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.
Indeed, also noticed but didn't want to enforce as it's dynamic in their repo, depending on video length. I agree this is better than nothing and a longer term solution would be to add it in
self.video_processor