keras-preprocessing
keras-preprocessing copied to clipboard
Video Generator
I have a feature request: I'm starting to work with videos more often and I'm spending far too long creating generators that can tie multiple frames together into 4D tensors to be used for video-based RNNs. It would be very helpful to have a video_data_generator. My initial vision of this would rely on a directory structure such as this:
/Train -- /Class1 -- -- /Video1 -- -- -- /Video1-frame01.jpeg -- -- -- /Video1-frame02.jpeg -- -- /Video2 ... and so on.
The generator would probably need to include an argument for a maximum sequence length. The generator would then yield 4D np.arrays -> (sequence_length, height, width, channels). I'd be happy to work on the feature, but I wanted to at least see if you felt it was a useful feature or if there are any clever workarounds that I'm not aware of.
-
[y] Check that you are up-to-date with the master branch of keras-preprocessing. You can update with:
pip install git+git://github.com/keras-team/keras-preprocessing.git --upgrade --no-deps
-
[n/a] Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).