Skip to content
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

FEAT Video Converter: Adding Images to Videos #702

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

jbolor21
Copy link
Contributor

Description

Adding new video converter to add image to video

Tests and Documentation

Made new notebook and ran

@jbolor21 jbolor21 marked this pull request as draft February 10, 2025 23:29
@jbolor21 jbolor21 changed the title FEAT Video Converter: Adding Images to Videos [DRAFT] FEAT Video Converter: Adding Images to Videos Feb 10, 2025
pyproject.toml Outdated
@@ -58,6 +58,7 @@ dependencies = [
"ipykernel>=6.29.4",
"numpy>=1.26.4",
"openai>=1.58.1",
"opencv-python>=4.11.0.86",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you figure out what this pulls in? Might be a rather heavyweight package. If you're not sure how please lmk and we can do it together 🙂

@jbolor21 jbolor21 changed the title [DRAFT] FEAT Video Converter: Adding Images to Videos FEAT Video Converter: Adding Images to Videos Feb 26, 2025
@jbolor21 jbolor21 marked this pull request as ready for review February 26, 2025 23:06
self._img_resize_size = img_resize_size
self._video_path = video_path

async def _add_image_to_video(self, image_path: str, output_path: str):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest async def _add_image_to_video(self, image_path: str, output_path: str) -> str:

Copy link
Contributor

@nina-msft nina-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to fix up pre-commit hook failures, otherwise lgtm 🚀 ✨

initialize_pyrit(memory_db_type=IN_MEMORY)

input_video = str(pathlib.Path(".") / ".." / ".." / ".." / "assets" / "sample_video.mp4")
output_video = str(pathlib.Path(".") / ".." / ".." / ".." / "assets" / "sample_output_video.mp4")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this output_video path isn't being used right now, make sure to include it in the converter init on L26


async def convert_async(self, *, prompt: str, input_type: PromptDataType = "image_path") -> ConverterResult:
"""
Converter that adds an image to a video
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT:

Suggested change
Converter that adds an image to a video
Adds input image to video

Copy link
Contributor

@jsong468 jsong468 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! This'll be really cool to try out :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants