Exemplo n.º 1
0
    def black_test(self):
        dataprovider = imageUnits.ImageProvider(path='data/val/*.tif', bathsize=50, shuffle_data=False, channels=2,
                                                nclass=3, pad=False)
        sum_acc = 0
        for i in range(16):
            batch_x, batch_y = dataprovider.next_batch()
            zero = np.zeros((50, 64, 64, 1))
            one = np.ones((50, 64, 64, 1))
            batch_x = np.concatenate((zero, one), axis=3)
            accuracy = np.mean(
                np.equal(np.argmax(batch_x, 3), np.argmax(batch_y, 3)).astype(np.float))

            sum_acc += accuracy
        print(sum_acc / 16)
Exemplo n.º 2
0
import FCN
import imageUnits

batch_size = 1
channels = 3
nclass = 2

path = 'data/train/*.tif'

data_provider = imageUnits.ImageProvider(path=path,
                                         bathsize=batch_size,
                                         shuffle_data=True,
                                         channels=channels,
                                         nclass=nclass)
net = FCN.FC_net(data_provider,
                 batch_size,
                 conv_size=3,
                 pool_size=2,
                 channels=channels,
                 nclass=nclass,
                 save_path='model',
                 white_channel_weight=0.5,
                 layers=5)
net.predite()
Exemplo n.º 3
0
import imageUnits
import tensorflow as tf
import numpy as tf
import Unet

train_path = 'data/val/*.tif'
batch_size = 1
channels = 3
nclass = 2
pad = True

predition_data_provider = imageUnits.ImageProvider(path=train_path,
                                                   bathsize=batch_size,
                                                   shuffle_data=True,
                                                   channels=channels,
                                                   nclass=nclass,
                                                   start=0,
                                                   pad=pad)
unet = Unet.unet(predition_data_provider,
                 layers=3,
                 first_feature_num=64,
                 conv_size=3,
                 pool_size=2,
                 batch_size=batch_size,
                 channels=channels,
                 nclass=nclass,
                 save_path='layer3',
                 white_channel_weight=0.4,
                 pad=pad)
unet.predite()