Skip to main content

A deep learning toolbox for spike-to-image models.

Project description

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 0.2.3.5 from PyPI:
pip install spikezoo
  • Install the latest developing version 0.2.3.6 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 the classic REDS dataset introduced in Spk2ImgNet:

from spikezoo.pipeline import TrainPipelineConfig, TrainPipeline
from spikezoo.datasets.reds_base_dataset import REDS_BASEConfig
from spikezoo.models.base_model import BaseModelConfig
pipeline = TrainPipeline(
    cfg=TrainPipelineConfig(save_folder="results", epochs = 10),
    dataset_cfg=REDS_BASEConfig(root_dir = "spikezoo/data/reds_base"),
    model_cfg=BaseModelConfig(),
)
pipeline.train()

We finish the training with one 4090 GPU in 2 minutes, achieving 32.8dB in PSNR and 0.92 in SSIM.

🌟 We encourage users to develop their models with simple modifications to our framework.

📚 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}},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spikezoo-0.2.3.6.tar.gz (16.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spikezoo-0.2.3.6-py3-none-any.whl (16.3 MB view details)

Uploaded Python 3

File details

Details for the file spikezoo-0.2.3.6.tar.gz.

File metadata

  • Download URL: spikezoo-0.2.3.6.tar.gz
  • Upload date:
  • Size: 16.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for spikezoo-0.2.3.6.tar.gz
Algorithm Hash digest
SHA256 f6d3ac16ca925705e76abea32387cb5d75a33aa77394a72924f2821ec957ea68
MD5 f5e34e19f0ad12bb6e578b90035a7ae9
BLAKE2b-256 2a6b76ed007921c9a6e5c261e0cbd6304cbccdfaad8493adeb3b82c2e60a0842

See more details on using hashes here.

File details

Details for the file spikezoo-0.2.3.6-py3-none-any.whl.

File metadata

  • Download URL: spikezoo-0.2.3.6-py3-none-any.whl
  • Upload date:
  • Size: 16.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for spikezoo-0.2.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4e1a7908157ccd840acd1c9ffaf631d3f0e23f551009cc17ea5ccd8989434dbf
MD5 dc7ff5db1b1e28d6cc9ada854719d0e0
BLAKE2b-256 c88934c6d2cd0405a51e6112b6950565bde071a7cc0a495d5f12e20809515fc6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page