Versalit SNN-Tracker
Detection, tracking and counting without a CNN detector: the scene becomes neuromorphic-camera events, geometry finds the objects and a spiking neural network says what each one is.
What it does
Point it at a fixed camera — a street, a gate, a parking lot — and it detects what moves, gives each object an ID, says whether it is a person, a car, a bicycle or a truck/bus, and counts how many crossed a line in each direction.
On the demo, a 30-second traffic video, the pipeline followed 53 valid tracks with an average duration of 3.3 seconds.
How it works
Regular video is turned into events, as in a neuromorphic camera (DVS): each pixel only produces a signal when its brightness changes. The static background disappears; a moving object becomes a dense cluster of points.
From there it is geometry: dilation and connected components become boxes, a Kalman filter written from scratch follows each box (position and velocity) and a virtual line counts crossings. The only neural network is the SNN that looks at each track's event crop and names the class — with a majority vote over the last 15 frames, so it does not change its mind every frame.
video → ON/OFF events (simulated DVS) → dilation + connected components = boxes → Kalman filter [x, y, vx, vy] = tracks with IDs → SNN on the event crop (2×48×48, 10 timesteps) = class → line crossing with a margin = count per direction
Classifier metrics
| Class | Correct |
|---|---|
| person | 90.2% |
| car | 93.3% |
| bicycle | 90.9% |
| truck/bus | 75.9% |
| Overall | 87.2% |
How to read it: 576 test crops, 20% of a set of 2,880. Labels come from the search query that fetched each video — no manual annotation — and the test set mixes crops from the same videos used in training; expect less on new footage. The most common mistake is a truck or bus taken for a bicycle.
How to run it
git clone https://huggingface.co/delvek/versalit-snn-tracker
cd versalit-snn-tracker
pip install -r requirements.txt
# writes a video with camera + tracks | events | counts
python -m src.demo your_video.mp4 -o out.mp4
Train it again
# downloads public videos per class and extracts the event crops
python -m src.harvest_blobs --videos 6
python -m src.train_blob --epochs 30
Honest limitations
- Needs a fixed camera: when the camera moves, the whole scene produces events.
- A stopped object produces no events; the Kalman filter holds the track for a few frames, not forever.
- Touching objects merge into a single cluster.
- Truck/bus is the weakest class (75.9%).