-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathReadme.txt
More file actions
52 lines (43 loc) · 1.85 KB
/
Copy pathReadme.txt
File metadata and controls
52 lines (43 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
## Minimal code for running inference on spiking neural network trained for Event-based Video Reconstruction via Potential-assisted Spiking Neural Network, CVPR2022.
=======================================================================
## Requirements
* Python >= 3.7 (3.9 recommended)
* PyTorch >= 1.6 (1.9 recommended)
* Spikingjelly = 0.0.0.0.6
======================================================================
## Running with Anaconda
cuda_version=10.2
conda create -n snnrec
conda activate snnrec
conda install -y pytorch torchvision cudatoolkit=$cuda_version -c pytorch
conda install pandas
## Install Spikingjelly
pip install spikingjelly==0.0.0.0.6
=====================================================================
## Inference
Usage:
python rec_snn.py [-network NETWORK] [-path_to_pretrain_models PATH_TO_PRETRAIN_MODELS] [-path_to_event_files PATH_TO_EVENT_FILES] [-save_path SAVE_PATH] [-height HEIGHT] [-width WIDTH] [-num_events_per_pixel NUM_EVENTS_PER_PIXEL]
For example, to run EVSNN:
python rec_snn.py -network EVSNN_LIF_final -path_to_pretrain_models ./pretrained_models/EVSNN.pth
To run PA-EVSNN
python rec_snn.py -network PAEVSNN_LIF_AMPLIF_final -path_to_pretrain_models ./pretrained_models/PAEVSNN.pth
======================================================================
## Folder Structure
minimal_code_snn/
|
├── rec_snn.py - evaluation of trained model
|
├── data/ - default directory for storing input data
|
├── model/ - models, losses, and metrics
| ├── dataset.py
| ├── snn_network.py
|
├── neurons/
| ├── spiking_neuron.py - spiking neurons, MP neurons
|
├── results/ - generated results are saved here
|
└── utils/ - small utility functions
├── util.py
└── ...