-
Notifications
You must be signed in to change notification settings - Fork 38
Feature request: loading jpeg from memory (ndarray and Tensor) #2
Comments
Is there support for batch decoding (because of variable-sized inputs, either extra masks or lengths argument is going to be required, similar to padded sequences; or only accepting input as list; or nested/jagged tensor) |
Can't you just create a view on the buffer to mask out the portion that corresponds to a single jpeg? |
The motivation for batch decoding isn't just avoiding selecting out single jpeg's. It's for saving on parallel processing by making it more coordinated and having more control over it. E.g. modern audio codecs support batched decoding for that reason: https://mobile.twitter.com/neilzegh/status/1426122384357134337 nvjpeg might support it as well |
Also, if accimage is a thin wrapper to libjpeg(-turbo), then maybe torchvision also wraps it directly these days? |
Sure, but accimage is a thin veneer around libjpeg-turbo and intel's IPP image processing routines to mimic the PIL Image API. It doesn't look as if IPP supports batched processing. It parallelises over the rows of the image IIRC. Likewise, I don't think the libjpeg API provides batch decoding.
That's besides the point, as
Accimage will not support nvjpeg, building a
https://mobile.twitter.com/neilzegh/status/1426122384357134337 |
Probably
jpeg_mem_src
would help (accepts a offset and count).The text was updated successfully, but these errors were encountered: