diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-aertb.spec | 369 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 371 insertions, 0 deletions
@@ -0,0 +1 @@ +/aertb-0.4.1.tar.gz diff --git a/python-aertb.spec b/python-aertb.spec new file mode 100644 index 0000000..605db5d --- /dev/null +++ b/python-aertb.spec @@ -0,0 +1,369 @@ +%global _empty_manifest_terminate_build 0 +Name: python-aertb +Version: 0.4.1 +Release: 1 +Summary: please add a summary manually as the author left a blank one +License: MIT License +URL: https://aertb.readthedocs.io +Source0: https://mirrors.aliyun.com/pypi/web/packages/d4/99/323d032de4e9c2b6db3e9b05bcf74c5cc221c070ceb08c606561422c7980/aertb-0.4.1.tar.gz +BuildArch: noarch + + +%description +# AER-toolbox +This library intends to be a minimal tool for loading events from files with common event-camera file extensions into +Python. + +See the project on [PyPI](https://pypi.org/project/aertb/) or do `pip3 install aertb` + +### Usage +```py +from aertb.core import FileLoader + +datLoader = FileLoader('dat') # 'bin', or 'aedat' +datLoader.load_events('../example_data/dat/cars/obj_004414_td.dat') +``` + +Supported extensions: + + - `.dat`: N-Cars / Prophesee Cameras + - `.bin`: N-MNIST, N-Caltech101 + - `.aedat`: PokerDVS + - `.mat`: DVS-Barrel + +It also make the process of loading and iterating HDF5 files easier. +```py +from aertb.core import HDF5File + +dataset_train = HDF5File('TRAIN.h5') +train_iterator = dataset_train.iterator(n_samples_group=10, rand=23) + +for sample in tqdm(train_iterator): + # do something with sample.events, sample.label or sample.name +``` + +Example: making a GIF +```py +from aertb.core import HDF5File, make_gif + +file = HDF5File('../DVS_Barrel.hdf5') +sample = file.load_events(group='moving', name='11') +make_gif(sample, filename='sample_moving.gif', camera_size=(128, 128), n_frames=480, gtype='std') +``` + +The library also includes a command line interface for converting files from a given extension to hdf5, as well as gif +making capabilities for easy visualisation of the files. + +### Opening the CLI + 1. If the install with pip worked perfectly, you can now type `aertb` in a terminal window and the CLI will open. + + 2. If you are installing it from Github: download you should download the project from github and follow the following + instructions: + - a) `git clone ...` + - b) Create a virual environment, if venv is not installed run `pip install virtualenv`, + then `python3 -m venv aertb_env` + - c) Run `source aertb_env/bin/activate` + - d) Run the following command: `pip install -r requirements.txt` + - e) Open the cli with `python3 .` or with the `__main__.py` file + +### Using the CLI + 1. Once the CLI is open you get a a similar output on your terminal: +  + 2. type `help` to see supported commands and `help <topic>` to get more info of the command + +### Examples: + +#### Creating an HDF5 out of a directory +``` +tohdf5 -f 'example_data/dat' -e 'dat' -o 'mytest.h5' +``` +The recommended directory shape is : + + |--Parent (given as parameter) + |-- LabelClass1 + |-- SampleName1 + |-- SampleName2 + |-- .... + |-- LabelClass2 + |-- SampleName1 + |-- SampleName2 + |-- .... + |-- ... + +And we suggest that train and test are kept as separate folders so they translate +to two different files +#### Creating an HDF5 out of a single file +``` +tohdf5 -f 'example_data/bin/one/03263.bin' -o 'mytest2.h5' +``` + + +#### Creating a gif out of a given file +``` +makegif -f 'example_data/prophesee_dat/test_23l_td.dat' -o 'myGif.gif' -nfr 240 -g 'std' +``` + +  + + +### Exiting the CLI: + +1. type `quit` +2. Exit virtual environment: `$ deactivate` + +%package -n python3-aertb +Summary: please add a summary manually as the author left a blank one +Provides: python-aertb +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-aertb +# AER-toolbox +This library intends to be a minimal tool for loading events from files with common event-camera file extensions into +Python. + +See the project on [PyPI](https://pypi.org/project/aertb/) or do `pip3 install aertb` + +### Usage +```py +from aertb.core import FileLoader + +datLoader = FileLoader('dat') # 'bin', or 'aedat' +datLoader.load_events('../example_data/dat/cars/obj_004414_td.dat') +``` + +Supported extensions: + + - `.dat`: N-Cars / Prophesee Cameras + - `.bin`: N-MNIST, N-Caltech101 + - `.aedat`: PokerDVS + - `.mat`: DVS-Barrel + +It also make the process of loading and iterating HDF5 files easier. +```py +from aertb.core import HDF5File + +dataset_train = HDF5File('TRAIN.h5') +train_iterator = dataset_train.iterator(n_samples_group=10, rand=23) + +for sample in tqdm(train_iterator): + # do something with sample.events, sample.label or sample.name +``` + +Example: making a GIF +```py +from aertb.core import HDF5File, make_gif + +file = HDF5File('../DVS_Barrel.hdf5') +sample = file.load_events(group='moving', name='11') +make_gif(sample, filename='sample_moving.gif', camera_size=(128, 128), n_frames=480, gtype='std') +``` + +The library also includes a command line interface for converting files from a given extension to hdf5, as well as gif +making capabilities for easy visualisation of the files. + +### Opening the CLI + 1. If the install with pip worked perfectly, you can now type `aertb` in a terminal window and the CLI will open. + + 2. If you are installing it from Github: download you should download the project from github and follow the following + instructions: + - a) `git clone ...` + - b) Create a virual environment, if venv is not installed run `pip install virtualenv`, + then `python3 -m venv aertb_env` + - c) Run `source aertb_env/bin/activate` + - d) Run the following command: `pip install -r requirements.txt` + - e) Open the cli with `python3 .` or with the `__main__.py` file + +### Using the CLI + 1. Once the CLI is open you get a a similar output on your terminal: +  + 2. type `help` to see supported commands and `help <topic>` to get more info of the command + +### Examples: + +#### Creating an HDF5 out of a directory +``` +tohdf5 -f 'example_data/dat' -e 'dat' -o 'mytest.h5' +``` +The recommended directory shape is : + + |--Parent (given as parameter) + |-- LabelClass1 + |-- SampleName1 + |-- SampleName2 + |-- .... + |-- LabelClass2 + |-- SampleName1 + |-- SampleName2 + |-- .... + |-- ... + +And we suggest that train and test are kept as separate folders so they translate +to two different files +#### Creating an HDF5 out of a single file +``` +tohdf5 -f 'example_data/bin/one/03263.bin' -o 'mytest2.h5' +``` + + +#### Creating a gif out of a given file +``` +makegif -f 'example_data/prophesee_dat/test_23l_td.dat' -o 'myGif.gif' -nfr 240 -g 'std' +``` + +  + + +### Exiting the CLI: + +1. type `quit` +2. Exit virtual environment: `$ deactivate` + +%package help +Summary: Development documents and examples for aertb +Provides: python3-aertb-doc +%description help +# AER-toolbox +This library intends to be a minimal tool for loading events from files with common event-camera file extensions into +Python. + +See the project on [PyPI](https://pypi.org/project/aertb/) or do `pip3 install aertb` + +### Usage +```py +from aertb.core import FileLoader + +datLoader = FileLoader('dat') # 'bin', or 'aedat' +datLoader.load_events('../example_data/dat/cars/obj_004414_td.dat') +``` + +Supported extensions: + + - `.dat`: N-Cars / Prophesee Cameras + - `.bin`: N-MNIST, N-Caltech101 + - `.aedat`: PokerDVS + - `.mat`: DVS-Barrel + +It also make the process of loading and iterating HDF5 files easier. +```py +from aertb.core import HDF5File + +dataset_train = HDF5File('TRAIN.h5') +train_iterator = dataset_train.iterator(n_samples_group=10, rand=23) + +for sample in tqdm(train_iterator): + # do something with sample.events, sample.label or sample.name +``` + +Example: making a GIF +```py +from aertb.core import HDF5File, make_gif + +file = HDF5File('../DVS_Barrel.hdf5') +sample = file.load_events(group='moving', name='11') +make_gif(sample, filename='sample_moving.gif', camera_size=(128, 128), n_frames=480, gtype='std') +``` + +The library also includes a command line interface for converting files from a given extension to hdf5, as well as gif +making capabilities for easy visualisation of the files. + +### Opening the CLI + 1. If the install with pip worked perfectly, you can now type `aertb` in a terminal window and the CLI will open. + + 2. If you are installing it from Github: download you should download the project from github and follow the following + instructions: + - a) `git clone ...` + - b) Create a virual environment, if venv is not installed run `pip install virtualenv`, + then `python3 -m venv aertb_env` + - c) Run `source aertb_env/bin/activate` + - d) Run the following command: `pip install -r requirements.txt` + - e) Open the cli with `python3 .` or with the `__main__.py` file + +### Using the CLI + 1. Once the CLI is open you get a a similar output on your terminal: +  + 2. type `help` to see supported commands and `help <topic>` to get more info of the command + +### Examples: + +#### Creating an HDF5 out of a directory +``` +tohdf5 -f 'example_data/dat' -e 'dat' -o 'mytest.h5' +``` +The recommended directory shape is : + + |--Parent (given as parameter) + |-- LabelClass1 + |-- SampleName1 + |-- SampleName2 + |-- .... + |-- LabelClass2 + |-- SampleName1 + |-- SampleName2 + |-- .... + |-- ... + +And we suggest that train and test are kept as separate folders so they translate +to two different files +#### Creating an HDF5 out of a single file +``` +tohdf5 -f 'example_data/bin/one/03263.bin' -o 'mytest2.h5' +``` + + +#### Creating a gif out of a given file +``` +makegif -f 'example_data/prophesee_dat/test_23l_td.dat' -o 'myGif.gif' -nfr 240 -g 'std' +``` + +  + + +### Exiting the CLI: + +1. type `quit` +2. Exit virtual environment: `$ deactivate` + +%prep +%autosetup -n aertb-0.4.1 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-aertb -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.4.1-1 +- Package Spec generated @@ -0,0 +1 @@ +5ecb3105675b6d03121263dd951db8e1 aertb-0.4.1.tar.gz |