Working with Camera and NetworksΒΆ

In [1]:
from conx.widgets import Camera
from conx import Network
from conx.layers import *
Using Theano backend.
In [2]:
camera = Camera()
In [3]:
camera
In [4]:
image = camera.get_image()
image
Out[4]:
_images/Camera_4_0.png
In [5]:
data = camera.get_data()
In [6]:
data.shape
Out[6]:
(240, 320, 3)
In [7]:
net = Network("Camera Network")
net.add(ImageLayer("camera", (240, 320), 3))
net.add(Conv2DLayer("conv2d", 32, (3,3)))
net.add(MaxPool2DLayer("maxpool", (2,2)))
net.add(FlattenLayer("flatten"))
net.add(Layer("output", 10))
net.connect()
net.compile(error="mse", optimizer="adam")
In [8]:
net.dashboard()
In [9]:
net.propagate(camera.get_data())
Out[9]:
[0.21539217,
 0.34589532,
 -0.51865357,
 -0.41550192,
 -0.26372117,
 0.45607451,
 -0.16242623,
 0.41117635,
 -0.10132214,
 0.27242437]