In [1]:
import matplotlib.pyplot as plt
from utils import data_utils, train_utils
%matplotlib inline
import cv2
import numpy as np
from matplotlib import cm
from PIL import Image
from descartes.patch import PolygonPatch
from shapely import wkt
from shapely import affinity
import matplotlib
In [2]:
new_style = {'grid': False}
matplotlib.rc('axes', **new_style)
In [4]:
train_input = train_utils.input_data(class_id=0, crop_size=144, crop_per_img=1, rotation=360, verbose=True, train=True)
In [6]:
img, label = train_inputd.next()
In [8]:
print img.shape, label.shape
In [10]:
ind = 0
fig, axs = plt.subplots(5,5, figsize=[20,20])
for i in range(5):
for j in range(5):
axs[i,j].imshow(data_utils.scale_percentile(img[ind, :,:,9:12]))
ind = ind+1
In [11]:
ind = 0
fig, axs = plt.subplots(5,5, figsize=[20,20])
for i in range(5):
for j in range(5):
axs[i,j].imshow(label[ind, :, :], cmap=plt.cm.gray)
ind = ind+1
In [7]:
data_utils.CLASSES
Out[7]:
In [18]:
img_data = data_utils.ImageData(17)
In [19]:
# load data
img_data.load_image()
img_data.create_label()
img_data.create_train_feature()
In [20]:
img_data.visualize_image(plot_all=True)
In [21]:
img_data.visualize_label()
In [23]:
data_utils.plot_bar_stats()
In [24]:
data_utils.plot_stats(title='Total area', value='TotalArea')
In [25]:
data_utils.plot_stats(title='Counts', value='Counts')