Exemplo n.º 1
0
 def __init__(self, threadID, name, input, output):
     threading.Thread.__init__(self)
     self.threadID = threadID
     self.name = name
     self.node = openRetina(model=dict(
         layer=name,  # label for this layer
         input=input,  # input: can be the camera, noise, a movie (TODO)
         output=output,  # output: can be stream, display, ...
         T_SIM=120))
Exemplo n.º 2
0
openRetina : a retina

See https://github.com/laurentperrinet/openRetina

"""
__author__ = "(c) Pierre Albiges, Victor Boutin & Laurent Perrinet INT - CNRS"
import io
import socket
import struct
import time
import threading
import picamera
import numpy as np

from openRetina import openRetina
ret = openRetina()

client_socket = socket.socket()
print('This client sends data to IP: ', ret.ip)
client_socket.connect((ret.ip, 8000))
connection = client_socket.makefile('wb')
try:
    connection_lock = threading.Lock()
    pool_lock = threading.Lock()
    pool = []

    class ImageStreamer(threading.Thread):
        def __init__(self):
            super(ImageStreamer, self).__init__()
            self.stream = io.BytesIO()
            self.event = threading.Event()
Exemplo n.º 3
0
# -*- coding: utf8 -*-
from __future__ import division, print_function
"""
openRetina : a basic thalamic layer

See https://github.com/laurentperrinet/openRetina

"""
__author__ = "(c) Victor Boutin & Laurent Perrinet INT - CNRS"

import subprocess
p = subprocess.Popen(['./photoreceptors.py'])
from openRetina import openRetina
thalamus = openRetina(model=dict(layer='thalamus', # label for this layer
                             input=['stream'], # input: can be the camera, noise, a movie (TODO)
                             output=['display', 'capture'], # output: can be stream, display, capture,...
                             T_SIM=120))
thalamus.run()
Exemplo n.º 4
0
#! /usr/bin/env python3
# -*- coding: utf8 -*-
from __future__ import division, print_function
"""
openRetina : a photoreceptor layer

See https://github.com/laurentperrinet/openRetina

"""
__author__ = "(c) Victor Boutin & Laurent Perrinet INT - CNRS"

from openRetina import openRetina
phrs = openRetina(model=dict(layer='phrs', # label for this layer
                             input=['noise'], # input: can be the camera, noise, a movie (TODO)
                             output=['stream'] # output: can be stream, display, ...
                             ))
phrs.run()
Exemplo n.º 5
0
openRetina : a retina

See https://github.com/laurentperrinet/openRetina

"""
__author__ = "(c) Victor Boutin & Laurent Perrinet INT - CNRS"
import io
import socket
import struct
import time
import threading
import picamera
import numpy as np

from openRetina import openRetina
ret = openRetina()

client_socket = socket.socket()
print('This client sends data to IP: ', ret.ip)
client_socket.connect((ret.ip, 8000))
connection = client_socket.makefile('wb')
try:
    connection_lock = threading.Lock()
    pool_lock = threading.Lock()
    pool = []

    class ImageStreamer(threading.Thread):
        def __init__(self):
            super(ImageStreamer, self).__init__()
            self.stream = io.BytesIO()
            self.event = threading.Event()
Exemplo n.º 6
0

# Create new threads
thread1 = myThread(1, 'test_noise', input=['noise'], output=['stream'])
# thread2 = myThread(2, 'test_display', # label for this layer
#                              input=['stream'], # input: can be the camera, noise, a movie (TODO)
#                              output=['display'], # output: can be stream, display, capture,...
#                              )

# Start new Threads
thread1.start()
#thread2.start()

thalamus = openRetina(model=dict(
    layer='test_display',  # label for this layer
    input=['stream'],  # input: can be the camera, noise, a movie (TODO)
    output=['display'],  # output: can be stream, display, capture,...
    T_SIM=120))

thalamus.run()

# thread1.join()
#thread2.join()

print("Exiting Main Thread")

#
# import multiprocessing
# phrs = openRetina(model=dict(layer='test_noise', # label for this layer
#                              input=['noise'], # input: can be the camera, noise, a movie (TODO)
#                              output=['stream'] # output: can be stream, display, ...
Exemplo n.º 7
0
#! /usr/bin/env python3
# -*- coding: utf8 -*-
from __future__ import division, print_function
"""
openRetina : a photoreceptor layer

See https://github.com/laurentperrinet/openRetina

"""
__author__ = "(c) Pierre Albiges, Victor Boutin & Laurent Perrinet INT - CNRS"

from openRetina import openRetina
phrs = openRetina(model=dict(
    layer='phrs',  # label for this layer
    input=['camera'],  # input: can be the camera, noise, a movie (TODO)
    output=['stream']  # output: can be stream, display, ...
))
phrs.run()