spikingjelly.datasets package#
备注
API 改动说明
SpikingJelly 0.0.0.1.0 对 datasets 包进行了结构性重构,以提升代码的模块化程度和可维护性。主要改动为:
datasets/__init__.py被拆分为base.py、utils.py以及transform.py;新的
datasets/__init__.py仅作为 API 门面(facade),负责引入并暴露各子模块中的公开对象;datasets/to_rep_x.py及其中内容已被移除。
使用建议:
数据集类:推荐从
spikingjelly.datasets命名空间直接导入;工具函数和数据增强:推荐通过
spikingjelly.datasets.utils和spikingjelly.datasets.transform子模块访问;
# 推荐 ✅
from spikingjelly.datasets import DVS128Gesture
from spikingjelly.datasets.utils import create_sub_dataset
# 旧的导入方式,不推荐 ❌
from spikingjelly.datasets.dvs128_gesture import DVS128Gesture
from spikingjelly.datasets import create_sub_dataset
为保证兼容性,以上旧的导入方式在当前版本中仍然可用,但不再推荐在新代码中使用。
API Change Notice
In SpikingJelly 0.0.0.1.0, the datasets package has undergone a structural refactor to improve modularity and maintainability. The main changes include:
datasets/__init__.pyhas been split intobase.py,utils.py, andtransform.py;the new
datasets/__init__.pynow serves solely as an API facade, responsible for importing and re-exporting public objects from its submodules;datasets/to_rep_x.pyand its contents have been removed.
Usage recommendations:
Dataset classes: import them directly from the
spikingjelly.datasetsnamespace;Utility functions and data augmentation: access them via the
spikingjelly.datasets.utilsandspikingjelly.datasets.transformsubmodules;
# Recommended ✅
from spikingjelly.datasets import DVS128Gesture
from spikingjelly.datasets.utils import create_sub_dataset
# Legacy import patterns, not recommended ❌
from spikingjelly.datasets.dvs128_gesture import DVS128Gesture
from spikingjelly.datasets import create_sub_dataset
To preserve compatibility, the legacy import patterns shown above remain supported in the current version, but their use is discouraged.
Datasets#
- spikingjelly.datasets.asl_dvs module
- spikingjelly.datasets.bullying10k module
- spikingjelly.datasets.cifar10_dvs
- spikingjelly.datasets.dvs_lip module
- spikingjelly.datasets.dvs128_gesture module
- spikingjelly.datasets.es_imagenet module
- spikingjelly.datasets.hardvs module
- spikingjelly.datasets.n_caltech101 module
- spikingjelly.datasets.n_mnist module
- spikingjelly.datasets.nav_gesture module
- spikingjelly.datasets.shd module
- spikingjelly.datasets.speechcommands module
Dataset Base Class#
Dataset Utilities#
- spikingjelly.datasets.utils module
save_as_pic()save_every_frame_of_an_entire_DVS_dataset()play_frame()load_aedat_v3()load_ATIS_bin()load_npz_frames()integrate_events_segment_to_frame()cal_fixed_frames_number_segment_index()integrate_events_by_fixed_frames_number()integrate_events_file_to_frames_file_by_fixed_frames_number()integrate_events_by_fixed_duration()integrate_events_file_to_frames_file_by_fixed_duration()save_frames_to_npz_and_print()create_same_directory_structure()split_to_train_test_set()fast_split_to_train_test_set()pad_sequence_collate()padded_sequence_mask()create_sub_dataset()