Skip to content

Loading videos in grayscale #642

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

Closed
mdivyanshu97 opened this issue Apr 14, 2025 · 2 comments
Closed

Loading videos in grayscale #642

mdivyanshu97 opened this issue Apr 14, 2025 · 2 comments

Comments

@mdivyanshu97
Copy link

🚀 The feature

Hey, first of all thank you so much for this library. It has reduced by training time at least by half. I work with medical data and it is usually in grey-scale. I was wondering if the library supports loading directly in grayscale format similar to FFmpeg with parameter format = 'gray'. I am currently loading the video in rgb and then doing a PyTorch Grayscale transform but as you can guess, this is making the process slower. I was wondering if the library already supports or it is easy to support this functionality.

Thank you again.

Motivation, pitch

No response

@NicolasHug
Copy link
Member

Hi @mdivyanshu97 and thank you for your feedback!

TorchCodec doesn't support native grayscale conversion for now, so we recommend relying on torchvision's Grayscale transform, as you're currently doing.

Native grayscale conversion is in scope for TorchCodec, I think we will eventually implement it via the more general native transform API discussed in #526. This is still WIP, so I can't share an ETA with you at the moment.

@mdivyanshu97
Copy link
Author

Thank you @NicolasHug . The idea of passing transforms directly to the library sounds great and I think will definitely improve the video-processing speeds even further.

Thanks again and eager to try new functionalities of the amazing library.

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

No branches or pull requests

2 participants