Working with Camera and NetworksΒΆ

In [1]:
from conx.widgets import CameraWidget
from conx import Network
from conx.layers import *
Using Theano backend.
In [2]:
camera = CameraWidget()
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 [10]:
net.snapshot(camera.get_data())
Out[10]:
_images/Camera_9_1.svg