keras-preprocessing icon indicating copy to clipboard operation
keras-preprocessing copied to clipboard

Video Generator

Open brandonschabell opened this issue 6 years ago • 0 comments

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).

brandonschabell avatar Feb 16 '19 23:02 brandonschabell