You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An API that interfaces directly with video camera streams.
Motivation
After including encoder/decoders for image and video would be to also great to have native support for accessing to video cameras e.g for robotics or real-time applications possibly making use of hardware acceleration.
Pitch
I would expect to have a simple API where you could pass a video file path, camera index, or set of cameras that return a batch with synchronized frames (this might need some logic).
importtorchimporttorchvisionastv# create camera instancestream=tv.VideoStream(cam_id=0) # from specific camera found in your devicestream=tv.VideoStream("http://<username:password>@<ip_address>/video.cgi?.mjpg") # e.g from ip camerastream=tv.VideoStream([path1, path2, ...]) # multiple camerasstream.open()
# get data (this could implemented as a callback too)forframe, metainstream:
# frame: torch.Tensor (BxCxHxW) # 1 for single camera/ B for multi-cam# meta: Dict[str, Any] (e.g. 'audio')frame=gaussian_blur(frame) # BxCxHxWpl.imshow(frame) # visualizer is another topic :) stream.close()
Alternatives
Existing solutions is using opencv for now.
Additional context
This comes from the motivation to integrate pytorch vision stuff like kornia into ROS2.
To follow up on this, it would technically be possible to deal with arbitrary memory stream (e.g. buffer), interfacing with a camera is something we'd have to research.
I'll try to research a bit on how does OpenCV do that and get back to you later next week if that's ok?
Sadly, we're not adding additional features at the moment.
We'll add this to list of feature requests, but have no ETA -- added to the larger tracking issue
Uh oh!
There was an error while loading. Please reload this page.
🚀 Feature
An API that interfaces directly with video camera streams.
Motivation
After including encoder/decoders for image and video would be to also great to have native support for accessing to video cameras e.g for robotics or real-time applications possibly making use of hardware acceleration.
Pitch
I would expect to have a simple API where you could pass a video file path, camera index, or set of cameras that return a batch with synchronized frames (this might need some logic).
Alternatives
Existing solutions is using opencv for now.
Additional context
This comes from the motivation to integrate pytorch vision stuff like kornia into ROS2.
cc @bjuncek
The text was updated successfully, but these errors were encountered: