In [1]:
%pylab
%matplotlib inline


Using matplotlib backend: agg
Populating the interactive namespace from numpy and matplotlib

In [2]:
cd ..


/home/scott/Documents/git/neukrill-net-work

In [3]:
import sys
import numpy as np
import skimage
import cv2
import sklearn

In [4]:
from holoviews import *


:0: FutureWarning: IPython widgets are experimental and may change in the future.

In [5]:
%load_ext holoviews.ipython


Welcome to the HoloViews IPython extension! (http://ioam.github.io/holoviews/)
Available magics: %compositor, %opts, %params, %view, %%labels, %%opts, %%view
<matplotlib.figure.Figure at 0x7f20fb220cd0>
<matplotlib.figure.Figure at 0x7f20fb220d90>
<matplotlib.figure.Figure at 0x7f20fb1ba250>

In [6]:
import neukrill_net.utils
import neukrill_net.highlevelfeatures

In [7]:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg

In [8]:
settings = neukrill_net.utils.Settings('settings.json')

In [9]:
X,y = settings.flattened_train_paths(settings.classes)

In [10]:
img = neukrill_net.highlevelfeatures.loadimage(X[0])

In [11]:
imgplot = plt.imshow(img)
imgplot.set_cmap('gray')



In [12]:
import skimage.feature

In [16]:
reload(neukrill_net.highlevelfeatures)


Out[16]:
<module 'neukrill_net.highlevelfeatures' from '/home/scott/Documents/git/neukrill-net-tools/neukrill_net/highlevelfeatures.py'>

In [17]:
hlf = neukrill_net.highlevelfeatures.ThresholdAdjacency()

In [18]:
hlf.extract_image(img)


Out[18]:
array([  9.27835052e-02,   8.24742268e-02,   1.28865979e-01,
         2.57731959e-01,   2.21649485e-01,   1.23711340e-01,
         5.67010309e-02,   1.03092784e-02,   2.57731959e-02,
         9.27835052e-02,   8.24742268e-02,   1.28865979e-01,
         2.57731959e-01,   2.21649485e-01,   1.23711340e-01,
         5.67010309e-02,   1.03092784e-02,   2.57731959e-02,
         7.88043478e-02,   8.69565217e-02,   1.35869565e-01,
         1.87500000e-01,   1.19565217e-01,   8.15217391e-02,
         1.22282609e-01,   1.03260870e-01,   8.42391304e-02,
         9.22432432e-01,   2.94594595e-02,   1.89189189e-02,
         1.70270270e-02,   1.00000000e-02,   1.62162162e-03,
         5.40540541e-04,   0.00000000e+00,   0.00000000e+00,
         9.22432432e-01,   2.94594595e-02,   1.89189189e-02,
         1.70270270e-02,   1.00000000e-02,   1.62162162e-03,
         5.40540541e-04,   0.00000000e+00,   0.00000000e+00,
         8.10550199e-01,   8.11117413e-02,   4.42427680e-02,
         3.14804311e-02,   1.95689166e-02,   1.04934770e-02,
         1.70164492e-03,   8.50822462e-04,   0.00000000e+00])

In [ ]:
t0 = time.time()
XF = hlf.transform(X)
print("Computing features took {}".format(time.time()-t0))

In [ ]: