Coder Social home page Coder Social logo

pydvs's Introduction

A Cython-based Dynamic Vision Sensor (DVS) emulator. It can be used within a Python environment as demonstrated in the various test files.

This project is under the GPLv3 License (https://www.gnu.org/copyleft/gpl.html)

I added a C++ version of the basic algorithm using OpenCV.

A DVS is a camera-like sensor which emits per-pixel asynchronous Address-Event Representation (AER) packets. These are originated due to an intensity level change has reached a certain threshold.

This project emulates this behaviour using commodity hardware, that is a regular PC and camera. Modifications to the default behaviour where added, mainly: encoding of values using time, local inhibition and dynamic thresholds.

Fred Rotbart (https://github.com/fcr) has been kind enough to port to Python 3 and checked compatibility with MacOS Sierra, plus code clean-up!

Requirements:

  • Cython
  • Numpy
  • OpenCV (with Python bindings)

Before using, compile the Cython modules by running

python setup.py build_ext --inplace

in the folder where pyDVS is installed.

Files:

  • pydvs/:

    • generate_spikes.pyx - Cython backend library. Contains functions to generate spikes from a video feed.
    • external_dvs_emulator_device*.py - sPyNNaker class wrapper, it's compatible with OpenCV VideoCapture devices and VirtualCam.
    • virtual_cam.py - A camera emulator that feeds on images located in the users computer. It keeps images moving based on eye movements (e.g. micro saccades and saccades); there's a very simple attention model for the saccade mode.
  • spynnaker_test.py - Demonstration script for sPyNNaker compatible frontend.

  • stand_alone*.py - Demonstration scripts for the Cython backend, they come in single- and multi-threaded versions.

  • virtual_cam_test.py - Demonstration script for the VirtualCam class, it requires images in a directory ("./mnist" by default)

The multithreaded versions require either Python 3.4 and above or Windows

pydvs's People

Contributors

chanokin avatar fcr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pydvs's Issues

Images to spike

Hi~
I ran "python mnist_to_spikes.py" and create txt files. What does the message mean down below?
Thanks!

595 0.000000
659 0.000000
533 0.000000
597 0.000000
661 0.000000
725 0.000000
789 0.000000
853 0.000000
917 0.000000
981 0.000000
1045 0.000000
1109 0.000000
1173 0.000000
1237 0.000000
1301 0.000000
1365 0.000000
1429 0.000000
791 0.000000
855 0.000000
919 0.000000
983 0.000000
1047 0.000000
1111 0.000000
1175 0.000000
1239 0.000000
1303 0.000000
1367 0.000000
1431 0.000000
1369 0.000000
1433 0.000000
1371 0.000000
1435 0.000000
1309 0.000000
1373 0.000000
1247 0.000000
1311 0.000000
1375 0.000000
1249 0.000000
1313 0.000000
1187 0.000000
1251 0.000000
1315 0.000000
1189 0.000000
1253 0.000000
1127 0.000000
1191 0.000000
1255 0.000000
1129 0.000000
1193 0.000000
1067 0.000000
1131 0.000000
1195 0.000000
1005 0.000000
1069 0.000000
1133 0.000000
1007 0.000000
1071 0.000000
945 0.000000
1009 0.000000
947 0.000000
1011 0.000000
885 0.000000
949 0.000000
1013 0.000000
887 0.000000
951 0.000000
1015 0.000000
889 0.000000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.