{"id":15290469,"url":"https://github.com/metal3d/keras-video-generators","last_synced_at":"2025-04-09T22:17:18.240Z","repository":{"id":37276194,"uuid":"223432971","full_name":"metal3d/keras-video-generators","owner":"metal3d","description":"Keras generators to generate sequences from videos as input","archived":false,"fork":false,"pushed_at":"2023-11-25T13:42:36.000Z","size":8188,"stargazers_count":99,"open_issues_count":30,"forks_count":31,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-09T22:17:12.707Z","etag":null,"topics":["keras","keras-generators","machine-learning","machinelearning","python3","tensorflow"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metal3d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-22T15:34:02.000Z","updated_at":"2025-02-13T01:07:49.000Z","dependencies_parsed_at":"2024-10-31T04:02:32.236Z","dependency_job_id":null,"html_url":"https://github.com/metal3d/keras-video-generators","commit_stats":{"total_commits":117,"total_committers":8,"mean_commits":14.625,"dds":0.09401709401709402,"last_synced_commit":"06db9d5d5bc1e327aad682f65254cad3ebc7d753"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metal3d%2Fkeras-video-generators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metal3d%2Fkeras-video-generators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metal3d%2Fkeras-video-generators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metal3d%2Fkeras-video-generators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metal3d","download_url":"https://codeload.github.com/metal3d/keras-video-generators/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119287,"owners_count":21050755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["keras","keras-generators","machine-learning","machinelearning","python3","tensorflow"],"created_at":"2024-09-30T16:08:17.494Z","updated_at":"2025-04-09T22:17:18.210Z","avatar_url":"https://github.com/metal3d.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a8f50f8c8b544e46b105537e01855dc7)](https://app.codacy.com/gh/metal3d/keras-video-generators?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=metal3d/keras-video-generators\u0026utm_campaign=Badge_Grade_Settings)\n[![PyPI version](https://badge.fury.io/py/keras-video-generators.svg)](https://pypi.org/project/keras-video-generators/) [![Build Status](https://travis-ci.org/metal3d/keras-video-generators.svg?branch=master)](https://travis-ci.org/metal3d/keras-video-generators)\n\n# Keras Sequence Video Generators\n\nThis package offers classes that generate sequences of frames from video files using Keras (officially included in TensorFlow as of the 2.0 release). The resulting frame sequences work with the Time Distributed, GRU, LSTM, and other recurrent layers.\n\nSee articles:\n\n- [The basics of Video frame as input](https://medium.com/smileinnovation/how-to-work-with-time-distributed-data-in-a-neural-network-b8b39aa4ce00)\n- [Usage of these generators here](https://medium.com/smileinnovation/training-neural-network-with-image-sequence-an-example-with-video-as-input-c3407f7a0b0f)\n\nAn provided example of usage can be [displayed in nbviewer here](https://nbviewer.jupyter.org/github/metal3d/keras-video-generators/blob/master/Example%20of%20usage.ipynb).\n\nRequirements are:\n\n- Python \u003e= 3.6 (Python 2 will never been supported)\n- OpenCV\n- numpy\n- Keras \u003e= 2\n- TensorFlow \u003e= 1.15 (or other backend, not tested, TensorFlow is needed by Keras)\n\nTensorFlow 2 works as well. This requirements **is not integrated in the setup.py** to let you choose the version, or to let you try with other backend. We mean that you will need to install a backend yourself (e.g. `pip install tensorflow`)\n\nIf you want to compile the package, you need:\n\n- sphinx to compile doc (work in progress)\n- setuptools\n\n# Installation\n\nYou can install the package via `pip`:\n\n```bash\npip install keras-video-generators\n```\n\nIf you want to build from source, clone the repository then:\n\n```bash\npython setup.py build\n```\n\n# Usage\n\nThe module name (keras_video) is different from the installation package name (keras-video-generators). Import the entire module with\n\n```bash\nimport keras_video\n```\n\nor load a single generator:\n\n```bash\nfrom keras_video import VideoFrameGenerator\n```\n\nThe package contains three generators that inherit the `Sequence` interface and may be used with `model.fit_generator()`:\n\n- `VideoFrameGenerator` provides a pre-determined number of frames from the entire video\n- `SlidingFrameGenerator` provides frames with decay for the entire video or with a sequence time\n- `OpticalFlowGenerator` provides an optical flow sequence from frames with different methods (experimental)\n\nEach generator accepts a standard set of parameters:\n\n- `glob_pattern`; must contain `{classname}`, e.g. './videos/{classname}/*.avi' - the \"classname\" in string is used to detect classes\n- `nb_frames`; the number of frames in the sequence\n- `batch_size`; the number of sequences in one batch\n- `transformation`; can be `None` or ImageDataGenerator (Keras) for data augmentation\n- `use_frame_cache`; use with caution, if set to `True`, the class will keep frames in memory (without augmentation). You need **a lot of memory**\n\nSee the class documentation for all parameters.\n\n\n# Changelog\n\n## v1.1.0\n- TensorFlow 2.5 compatibility\n- Code cleanup\n- Fixup some unbound variables\n\n\n## v1.0.14\n- Changes to get first and last frames in sequence\n\n## v1.0.13\n- try to fix SageMaker problem by avoiding usage of internal keras from tensorflow\n\n## v1.0.12\n- fix transformation error with SlidingFrameGenerator\n\n## v1.0.11\n- set generator to be Iterable\n- frame cache was disabled by error, it's back now\n- fixup import Sequence from `tensorflow.keras`\n- fix frame count problems for video with bad headers\n\n## v1.0.10\n- fix Windows problems with path using backslashes\n- add auto discovery for classes if \"None\" is sent\n- add travis tests\n\n\n## v1.0.9\n- fix frame counter in SlidingFrameGenerator\n\n## v1.0.8\n- fix tiny video frame count\n- refactorisation\n- pep8\n- fix problems for video without headers\n\n## v1.0.7\n- fix name check in classes to get them from filename\n- add `split_test` and `split_val`\n\n## v1.0.5\n- fix package generation\n\n## v1.0.4 \n- fix assertion\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetal3d%2Fkeras-video-generators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetal3d%2Fkeras-video-generators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetal3d%2Fkeras-video-generators/lists"}