SpikeCV Open Source Contribution Guide

Thank you for your interest in the SpikeCV project! Every contribution you make will help advance spike-based vision.

Follow this guide to start your open source contribution journey!

"Together, Let's spark a butterfly effect."

SpikeCV Team

Step 1


Fork & Clone

Please Fork our GitHub repository and clone it locally.

Create a Branch

Create your feature branch from the main branch.
Naming example: feature/algorithm-name.

Set Up the Development Environment

Configure the environment and install dependencies following the README.md.

Step 2


Algorithm Development

Under SpikeCV/spkProc/ choose an appropriate submodule (e.g., filters, reconstruction, etc.) and create your algorithm file your_algorithm.py.

  • Class & Interface: Implement an algorithm class YourAlgorithm, typically including methods such as __init__ (parameter initialization) and process (core logic).
  • Coding Style: Follow PEP 8, add necessary comments, docstrings, type hints, etc.
  • Progress Display: It is recommended to use the tqdm library to show processing progress.

Usage Example

Add test_your_algorithm.py in SpikeCV/examples/ to demonstrate the complete workflow from data loading to result output, helping users understand how to use the algorithm.

Algorithm Documentation

A complete contribution involves more than just code; we use RST files for documentation management:

  • Core documentation: Update docs/source/核心操作.rst to include your algorithm's principles and parameter descriptions.
  • Example documentation: Update docs/source/使用例子.rst to describe your usage example and expected results.
  • Multimedia resources: You can add result images/GIFs in the docs/source/media/ directory and reference them in the documentation.

We provide a documentation template reference in CONTRIBUTING.md.

Your documentation will then be integrated into the SpikeCV official documentation.

Adding Dependencies

If you need to add new dependencies, configure them as optional dependencies in pyproject.toml:

[project.optional-dependencies]
your_deps_name  = [
    "package>=1.0.0",
    "package2>=2.0.0",
]
# Install specific dependencies:
pip install -e ".[your_deps_name]"
# After adding dependencies, check for conflicts
pip check

If dependency version conflicts are hard to resolve, please refer to the Dependency Management Guide.

Dependency Classification

SpikeCV strictly divides dependencies into two categories:

  • Core dependencies (e.g., torch, numpy): affect all algorithms; modifications require extreme caution.
  • Optional dependencies: libraries required for specific algorithm types (e.g., tracking) or functional modules; using this approach is recommended.

Golden Rule

When adding dependencies, follow the principle of minimal dependencies:

  • Only add direct dependencies (the libraries you import); do not add transitive dependencies.
  • Prefer using existing core dependencies and avoid duplicate dependencies (packages with similar functionality).

Step 3


Submit a Pull Request

After completing development and committing locally, follow the guidelines in CONTRIBUTING.md to check and record your environment dependencies, then open a PR targeting the main branch of Zyj061/SpikeCV, using the provided PR description template to describe your changes.

Testing & Review

The code will first pass all CI/CD pipeline checks. Then maintainers will review code quality, documentation completeness, and compatibility. Maintainers may leave comments on the PR with specific suggestions for improvements.

Merge

Once the PR passes all checks and reviews, maintainers will merge your code into the main branch. Thank you for your contribution!

You can refer to an example of a merged PR: SNNTracker

Ready to become a SpikeCV contributor?

For detailed contribution workflows, environment setup, template code, and advanced development advice, please be sure to read

CONTRIBUTING.md
Edited by Singa Xu  |  Proofread by Yajing Zheng