No project description provided
Project description
GERD: Geometric event response data generation
GERD generates event-based datasets for objects tracking tasks at arbitrary resolutions subject to arbitrary transformations. Both the shapes and the transformations can be arbitrarily parameterized so you can carefully control the type of change happening to each object in the scene over time. This is useful to study event-based algorithms from first-principles: objects in the real world are controlled by highly specific transformations, but that is often overlooked in the literature.
Example render of shapes subject to affine transformation with a relatively high velocity (v=2.56).
Important simulation details (read me first)
We apply translation, scaling, rotation, and shearing to the shapes independently.
You can configure the transformations to use different starting conditions and the velocities will be updated according to a specified PyTorch distribution.
All of this is parameterized in the RenderParameters class in the render.py file.
Activation normalization
Translation velocities are normalized to the pixel grid, meaning that a velocity of 1 in the x axis means that the object moves one pixel to the right every frame. The other velocities are normalized to produce a similar number of pixel activations, to avoid skewing the dataset towards a specific transformation.
Fractional velocities and upsampling
A velocity of 0.1 is problematic in a pixel grid, so upsample to a grid that, by default, is 8 times larger than the specified resolution. An event in the downsampled (actual) grid will "trigger" when a certain fraction of the upsampled pixels are turned on. To accumulate pixel activations in the upsampled grid over time, we use a thresholded integrator.
Usage
You can install GERD by running
pip install gerd or by manually pulling the repository and installing the local version with pip install <path-to-gerd>.
The code is written in Python using the PyTorch library. GERD roughly has two use cases: 1) generate datasets for training or simulation and 2) render a few and carefully crafted simulations for visualizations or surgical tests
1. Generating datasets
To generate a dataset, use the gerd command (see gerd --help for more information).
The example below generates 1000 videos that translates and scales into the /data directory.
- Configure the dataset parameters
- Copy and modify the
example.yamlconfiguration to suit your needs
- Copy and modify the
- Run the dataset generation
gerd 1000 /data example.yaml- Note that the data is saved as a sparse PyTorch tensor
- Import and use the dataset in your training code as a PyTorch dataset
import gerd
my_train_dataset = gerd.GerdDataset("/data", train=True)
my_test_dataset = gerd.GerdDataset("/data", train=False)
By default, the dataset will crop the frames to 40 timesteps and assume that each file contains 128 timesteps.
You can change this by providing additional parameters to the GerdDataset class.
2. Render precise simulations
On a low level, we offer a general generating function render in the render.py file, that can render specific shapes, defined in shapes.py.
On a higher level, the main.py file contains a script that generates a dataset of three specific objects moving in a scene: a square, a circle, and a triangle.
We will cover that usecase below:
Authors
- Jens E. Pedersen (@GitHub jegp), doctoral student at KTH Royal Institute of Technology, Sweden.
- Dimitris Korakounis, doctoral student at KTH Royal Institute of Technology, Sweden.
- Raghav Singhal, visiting student at KTH Royal Institute of Technology, Sweden.
- Jörg Conradt, principal investigator
The work has received funding from the EC Horizon 2020 Framework Programme under Grant Agreements 785907 and 945539.
Citation
If you use this work, please cite it as follows
@misc{pedersen2024gerd,
title={GERD: Geometric event response data generation},
author={Jens Egholm Pedersen and Dimitris Korakovounis and Jörg Conradt},
year={2024},
eprint={2412.03259},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2412.03259},
}
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gerd-0.5.1.tar.gz.
File metadata
- Download URL: gerd-0.5.1.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0553c5654a0015f3cfd27389391b49eab42cd6eeb5b6f0d0cd3603918c14bde
|
|
| MD5 |
249670e23c7ba2f04808175a3770e44d
|
|
| BLAKE2b-256 |
be2b16c48caf80a2b4e08fa5f0e198e9eacfe15bfbb82660e4753618521a0225
|
Provenance
The following attestation bundles were made for gerd-0.5.1.tar.gz:
Publisher:
publish.yml on ncskth/gerd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gerd-0.5.1.tar.gz -
Subject digest:
e0553c5654a0015f3cfd27389391b49eab42cd6eeb5b6f0d0cd3603918c14bde - Sigstore transparency entry: 1145548804
- Sigstore integration time:
-
Permalink:
ncskth/gerd@d7bb3d2d80c20043f9e4bcaed5a36ac7957f9bdc -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/ncskth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d7bb3d2d80c20043f9e4bcaed5a36ac7957f9bdc -
Trigger Event:
release
-
Statement type:
File details
Details for the file gerd-0.5.1-py3-none-any.whl.
File metadata
- Download URL: gerd-0.5.1-py3-none-any.whl
- Upload date:
- Size: 109.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b57b0c527efb3c3dfda207503e4f130d69dc54402f4a61d3784c3d3cba46297d
|
|
| MD5 |
4c2af0f48349f7522cf6a38e612bb51d
|
|
| BLAKE2b-256 |
2ab9f7e4d9ab77272eb83516836c12eff7482a7ea8e4827e2b247cfc016a9df5
|
Provenance
The following attestation bundles were made for gerd-0.5.1-py3-none-any.whl:
Publisher:
publish.yml on ncskth/gerd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gerd-0.5.1-py3-none-any.whl -
Subject digest:
b57b0c527efb3c3dfda207503e4f130d69dc54402f4a61d3784c3d3cba46297d - Sigstore transparency entry: 1145548856
- Sigstore integration time:
-
Permalink:
ncskth/gerd@d7bb3d2d80c20043f9e4bcaed5a36ac7957f9bdc -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/ncskth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d7bb3d2d80c20043f9e4bcaed5a36ac7957f9bdc -
Trigger Event:
release
-
Statement type: