Comments (6)
@NicolasHug Thank you so much for the quick implementation! :) One week OOO and it's already in there, great! π
from vision.
Hi @voegtlel , thank you for the feature request. Can you detail exactly what you mean by a "file-like object"? What Python type would that be exactly? Thank you!
from vision.
Hi @NicolasHug,
sure, but I can only refer to the documentation of pyav
av.open(file, mode='r', **kwargs)
Main entrypoint to opening files/streams.Parameters:
file (str) β The file to open, which can be either a string or a file-like object.
Although I must admit, that this is misleading, because typing only states str
as type, but the documented string says, that file-like objects are allowed. I believe they refer to io, which is also what I'd understand:
The io module provides Pythonβs main facilities for dealing with various types of I/O. There are three main types of I/O: text I/O, binary I/O and raw I/O. These are generic categories, and various backing stores can be used for each of them. A concrete object belonging to any of these categories is called a file object. Other common terms are stream and file-like object.
from vision.
Do you think this is already handled by some of the private APIs like _read_video_from_memory
?
For context, the video decoders of torchvision aren't really maintained lately and we hope to provide better support for video decoding soon. It is possible for us to address some minor improvements as long as they're super easy, but big changes may not be in scope for torchvision. TBH, it's still not clear to me what exactly this feature request is about (i.e. what types need to be supported), so it's hard for me to give you a definite answer just yet
from vision.
I could imagine that this API could solve it as well. Effectively, this request is about allowing streams in the old api, which is not possible right now because of this line: https://github.com/pytorch/vision/blob/main/torchvision/io/video.py#L270 which expects a filename, but the pyav api could also handle a BytesIO
object. I.e. if that line would be like:
if not isinstance(filename, io.IOBase) and not os.path.exists(filename):
from vision.
Thanks for the details.
OK, I guess we can move the if not os.path.exists(filename):
within the if get_video_backend() != "pyav":
block and just let pyav do its own input checking.
from vision.
Related Issues (20)
- Runaway mask_loss for MaskRCNN when using non-binary mask. HOT 2
- Inconsistent Behavior with transforms.v2 for Multiple Arguments HOT 1
- adjust_hue broken on ARM64 HOT 1
- [Bug] Unable to build documentation on local machine HOT 2
- procrustes alignment for pytorch HOT 3
- Windows CUDA unittests jobs are failing
- Cant find nms function in code? HOT 1
- encode_jpeg generates noise when processing 4k image HOT 5
- size mismatch for rpn HOT 4
- SetupTools update breaks Vision Nightly aarch64 builds are failing for CPU and GPU HOT 3
- prioritize batching for torchvision::nms HOT 4
- ImportError: cannot import name 'datapoints' from 'torchvision.prototype' HOT 1
- crossvit vs vision transformer HOT 2
- GPU accelerated video loading with optimizations for reading at specific timestamps or time intervals HOT 1
- add typing to torchvision.models.detection.faster_rcnn HOT 2
- ConvertImageDtype not converting properly from uint8 HOT 3
- loss_box_reg increasing while training mask rcnn HOT 1
- Torch Load Warning causing test suite to fail. HOT 5
- Prebuilt .whl and .conda of torchvision for aarch64 + cuda
- RuntimeError: Argument #4: Padding size should be less than the corresponding input dimension for v2 transforms HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vision.