Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

Migrate Image and Video Utilities from vlm-tools

This PR migrates utility methods for image, video, and other tools from vlm-tools to vlmrun-python-sdk, specifically into the vlmrun/common directory.

Changes

  • Added image utilities (encode_image, download_image)
  • Added video utilities (VideoItertools with CLIP support)
  • Added comprehensive tests
  • Updated dependencies and documentation
  • Implemented proper error handling

Testing

  • Image tests pass successfully
  • Video tests skip properly when CLIP not available
  • Added proper error handling and timeouts

Link to Devin run: https://app.devin.ai/sessions/6ee804e6261142bb9b1fd0f7c5299a8d

Instructions from user:

Look at the utility methods for image, video and others in vlm-tools and copy them over to vlm-run/vlmrun-python-sdk (under vlmrun/common). Add tests as needed. Attempt to keep the code high-quality with extremely high-attention to detail for the developer experience.

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring


from .image import encode_image, download_image

__all__ = ["encode_image", "download_image"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the init file and make users import image utilities via from vlmrun.common.image import encode_image

Copy link
Contributor

Choose a reason for hiding this comment

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

Resolve the requirements conflicts and rebase on main.

devin-ai-integration bot and others added 6 commits January 7, 2025 17:55
- Add encode_image and download_image functions
- Add VideoItertools for CLIP-based frame sampling
- Add comprehensive tests and documentation
- Update dependencies and README

Co-Authored-By: Sudeep Pillai <[email protected]>
- Move CLIP import inside try block
- Make VideoItertools import optional in __init__.py
- Allow image utilities to work without torch dependencies

Co-Authored-By: Sudeep Pillai <[email protected]>
- Fix frame_generator fixture to use proper iterator pattern
- Add hasattr check in VideoItertools.__del__ for safer cleanup

Co-Authored-By: Sudeep Pillai <[email protected]>
…paths

- Remove vlmrun/common/__init__.py to enforce explicit imports
- Update test_image.py to import directly from image module
- Update README.md examples to use direct imports

This change improves code clarity by making imports more explicit.

Co-Authored-By: Sudeep Pillai <[email protected]>
@devin-ai-integration devin-ai-integration bot force-pushed the devin/1736270073-migrate-utilities branch from 5fffcf9 to 86e5f08 Compare January 7, 2025 17:57
@spillai spillai merged commit 590f652 into main Jan 7, 2025
1 check passed
@spillai spillai deleted the devin/1736270073-migrate-utilities branch January 23, 2025 08:37
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.

2 participants