As a new pytorch user, I found the data sampling and transforms code lacking for my personal use-case. It's understandable, since the core developers are busy working on the more important stuff. Still, I wanted to quickly build up the available sampling code to the same level as tensorflow, keras, etc and I think I've accomplished that with the
torchsample package is a 3rd-party library that includes code for comprehensive sampling from both in-memory and out-of-memory data, and includes a ton of useful augmentation transforms that apply directly on arbitrary torch tensors (rather than just PIL images).
It also has great support for situations where both the input and target tensors are images (e.g. segmentation datasets). It also supports arbitrary data types. It supersedes the currently available sampling code in the main torchvision/torch codebase.
Take a look here: https://github.com/ncullen93/torchsample
I've also wrote a fairly long tutorial showing how it works for a ton of common scenarios which can be found in the
tutorials folder of the above repository.
It's my hope that this will kick-start the community-driven development of the sampling code in the main torch and torchvision packages, and serve as reliable and flexible sampling code in the meantime.
NOTE: This package is in no way endorsed by, affiliated with, or otherwise associated with the official Pytorch ecosystem or team.