Keras sequence generators for video data
Project description
Keras Sequence Video generators
This package proposes some classes to work with Keras (included in TensorFlow) that generates batches of frames from video files.
It is useful to work with Time Distributed Layer with Video input (frames). The use GRU or LSTM. See articles:
Requirements are:
- Python3 (Python 2 will never been supported)
- OpenCV
- numpy
- Keras
- TensorFlow (or other backend, not tested)
If you want to compile the package, you need:
- sphinx to compile doc
- setuptools
Installation
You can install the package via pip
:
pip install keras-video-generators
If you want to build from sources, clone the repository then:
python setup.py build
Usage
The package contains 3 generators that inherits Sequence
interface. So they may be used with model.fit_generator()
:
VideoFrameGenerator
that will take the choosen number of frames from the entire videoSlidingFrameGenerator
that takes frames with decay for the entire video or with a sequence timeOpticalFlowGenerator
that gives optical flow sequence from frames with different methods
Each of these generators accepts parameters:
glob_pattern
that must contain{classname}
, e.g. './videos/{classname}/*.png' - the "classname" in string is used to detect classesnb_frame
that is the number of frame in the sequencebatch_size
transformation
that can beNone
or or ImageDataGenerator to make data augmentationuse_frame_cache
to use with caution, if set toTrue
, the class will keep frames in memory (without augmentation). You need a lot of memory- and many more, see class documentation
Work in progress
- Complete documentation
- use Optical Flow on SlidingFrameGenerator
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for keras-video-generators-1.0.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9db8979bbc1058f8541418d5dcea48d67c7a2e00233a8074d6f436fa3689936b |
|
MD5 | 6f9e94eb99d401f6dba713bee4ee08d3 |
|
BLAKE2b-256 | 43d4e9e8c9c7eda81e16220204a01a23b9eb8f983b6db47c834ea7c3d1a8ef43 |