Project-MONAI/MONAIStream

[Feature] Consider having a more composable functional API which seamlessly integrates with vanilla pytorch

Opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
As far as I can see, the current API requires the different components to be chained through a TransformChainComponent and there is no easy means to use the building blocks in a functional approach. This makes rapid prototyping a bit tedious. We should consider an API similar to that in Pytorch/MONAI which allows to either compose transformations or call simple functions directly.

Describe the solution you'd like
For the functional API, an API similar to the OpenCV one but based on PyTorch tensors would be great:
https://docs.opencv.org/5.x/dd/d43/tutorial_py_video_display.html

Describe alternatives you've considered
The fine-grained video IO API from torchvision.io seems to provides such a functionality for reading videos but it doesn't cover capture cards or video writting:
https://pytorch.org/vision/stable/io.html#fine-grained-video-api

Additional context
There is also quite some interesting material as part of PyTorchVideo:
https://pytorchvideo.org/