Skip to content

chenkang455/Spike-Zoo

Repository files navigation

GitHub repo stars GitHub Issues PyPI version Documentation StatusLicense

📖 About

⚡Spike-Zoo is the go-to library for state-of-the-art pretrained spike-to-image models designed to reconstruct images from spike streams. Whether you're looking for a simple inference solution or aiming to train your own spike-to-image models, ⚡Spike-Zoo is a modular toolbox that supports both, with key features including:

  • Fast inference with pre-trained models.
  • Training support for custom-designed spike-to-image models.
  • Specialized functions for processing spike data.

We are highly looking forward to your advice on our project. We welcome any issues or code contributions and will respond within one day.

🚩 Updates/Changelog

  • 25-02-02: Release the Spike-Zoo v0.2 code, which supports more methods, provide more usages like training your method from scratch.
  • 24-07-19: Release the Spike-Zoo v0.1 code for base evaluation of SOTA methods.

🍾 Quick Start

1. Installation

For users focused on utilizing pretrained models for spike-to-image conversion, we recommend installing SpikeZoo using one of the following methods:

  • Install the last stable version from PyPI:
pip install spikezoo
  • Install the latest developing version from the source code (recommended):
git clone https://github.com/chenkang455/Spike-Zoo
cd Spike-Zoo
python setup.py install

For users interested in training their own spike-to-image model based on our framework, we recommend cloning the repository and modifying the related code directly.

git clone https://github.com/chenkang455/Spike-Zoo
cd Spike-Zoo
python setup.py develop

2. Inference

Reconstructing images from the spike is super easy with Spike-Zoo. Try the following code of the single model:

from spikezoo.pipeline import Pipeline, PipelineConfig
import spikezoo as sz
pipeline = Pipeline(
    cfg=PipelineConfig(save_folder="results",version="v023"),
    model_cfg=sz.METHOD.BASE,
    dataset_cfg=sz.DATASET.BASE 
)
pipeline.infer_from_dataset(idx = 0)

3. Training

We provide a user-friendly code for training our provided BASE model (modified from the SpikeCLIP) for our provided BASE dataset:

from spikezoo.pipeline import TrainPipelineConfig, TrainPipeline
from spikezoo.datasets.base_dataset import BaseDatasetConfig
from spikezoo.models.base_model import BaseModelConfig
pipeline = TrainPipeline(
    cfg=TrainPipelineConfig(save_folder="results", epochs = 10),
    dataset_cfg=BaseDatasetConfig(),
    model_cfg=BaseModelConfig(),
)
pipeline.train()

🌟 We encourage users to develop their models with simple modifications to our framework. Follow the below documentation. 👇👇👇

📚 How to navigate the documentation

Link Description
Quick Start Learn how to quickly get started with the Spike-Zoo repository for inference and training.
Dataset Learn the parameter configuration of datasets and how to construct them.
Model Learn the parameter configuration of models and how to construct them.
Pipeline Learn how to configure and construct the processing pipeline for models.
Released Version Introduces the differences between different release versions of pre-trained weights.
Examples Complete code examples for using Spike-Zoo.
Supports Learn about the datasets and models supported by Spike-Zoo.

📅 TODO

  • Support the overall pipeline for spike simulation.
  • Provide the tutorials.
  • Support more training settings.
  • Support more spike-based image reconstruction methods and datasets.

✨‍ Acknowledgment

Our code is built on the open-source projects of SpikeCV, IQA-Pytorch, BasicSR and NeRFStudio.We appreciate the effort of the contributors to these repositories. Thanks for @zhiwen_huang, @ruizhao26, @shiyan_chen and @Leozhangjiyuan for their help in building this project.

📑 Citation

If you find our codes helpful to your research, please consider to use the following citation:

@misc{spikezoo,
  title={{Spike-Zoo}: A Toolbox for Spike-to-Image Reconstruction},
  author={Kang Chen and Zhiyuan Ye and Tiejun Huang and Zhaofei Yu},
  year={2025},
  howpublished = {\url{https://github.com/chenkang455/Spike-Zoo}},
}

About

⚡A Toolbox for Spike-to-Image Reconstruction

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages