Exemplo n.º 1
0
verifydata1 = np.ndarray([batchSize, 4], np.float32)
verifydata1[0] = [1.0, 3.0, 1.0, 3.0]
verifydata2 = np.ndarray([batchSize, 4], np.float32)
verifydata2[0] = [2.0, 1.0, 2.0, 1.0]
verifydata3 = np.ndarray([batchSize, 4], np.float32)
verifydata3[0] = [0.0, 0.5, 1.0, 1.5]

#输入层
inputlayer = tf.placeholder(tf.float32, shape=(batchSize, 4))

#预期的数据
finaldata = tf.placeholder(tf.float32, shape=(batchSize, 4))

#网络定义
plist = []
loadFromFile = ConvNet.openEmptyFileR('test.txt')#从文件中加载已训练的,文件不存在的话默认会随机初始化网络
#可以调整 5 这个数字,看对最终结果的影响,数字太小网络容量不足无法学习太复杂的情况
fc0 = ConvNet.addlist(plist,ConvNet.FC(inDepth = 4,outDepth = 5,loadFromFile = loadFromFile))
fc1 = ConvNet.addlist(plist,ConvNet.FC(inDepth = 5,outDepth = 4,loadFromFile = loadFromFile))
if loadFromFile:loadFromFile.close()   

def net(inputT):
    _ret = fc0.getLayer(inputT, isRelu=True, fixed = False)
    _ret = fc1.getLayer(_ret, isRelu=False, fixed = False)
    return _ret

_net = net(inputlayer)

#损失函数
# loss = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(labels=train_labels_node, logits=logits))  #这个loss是用来处理分类的情况,现在是回归所以不用
loss = tf.reduce_sum(tf.square(_net - finaldata))
Exemplo n.º 2
0
from six.moves import xrange  # pylint: disable=redefined-builtin
import tensorflow as tf
import ConvNet
import tensorflow.contrib.rnn.BasicLSTMCell



ind1 = np.ndarray([1, 8, 8, 2], np.float32)
for i in xrange(0, 8):
    for j in xrange(0, 8):
        ind1[0,i, j, 0] = (i+1) * 8 + (j+1);
        ind1[0,i, j, 1] = (i+1) * 8 + (j+1) + 0.5;
        
inputLayer = tf.placeholder(tf.float32, shape=(1,8, 8, 2))

testfile = ConvNet.openEmptyFileR('conv.txt')
conv1, conv1save = ConvNet.ConvLayer(inputLayer, filterSize=5, outDepth=4, convStride=1,padding=True, poolSize=2, loadFromFile=testfile)
conv2, conv2save = ConvNet.ConvLayer(conv1, filterSize=5, outDepth=8, convStride=1,padding=True, poolSize=2, loadFromFile=testfile)
reshape = ConvNet.Conv2FC_Reshape(conv2)
fc1,fc1save = ConvNet.FCLayer(reshape, 8, loadFromFile=testfile)
fc2,fc2save = ConvNet.FCLayer(fc1, 2*2*8, loadFromFile=testfile)
deshape = ConvNet.FC2Conv_Reshape(fc2,2,2,8)
uconv1,uconv1save = ConvNet.DeConvLayer(deshape,filterSize=5,output_shape=[1,4,4,4],convStride = 2,loadFromFile = testfile)
uconv2,uconv2save = ConvNet.DeConvLayer(uconv1,filterSize=5,output_shape=[1,8,8,2],convStride = 2,loadFromFile = testfile)

if testfile:testfile.close()


with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())
    
Exemplo n.º 3
0
            file_index = 0
        bytestream.close()
        bytestream = open(filePath + str(file_index)+".bin","br")
        content_index = 0

    buf = bytestream.read(BATCH_SIZE * IMAGE_H * IMAGE_W * IMAGE_CHANNEL)
    data = np.frombuffer(buf, dtype=np.uint8).astype(np.float32)
    data = (data) / 256.0 - 0.5
    data = data.reshape(BATCH_SIZE, IMAGE_H, IMAGE_W, IMAGE_CHANNEL)
    return data



print("startload")
glist = []
loadFromFile = ConvNet.openEmptyFileR('gan4g.txt')
gfc0 = ConvNet.addlist(glist,ConvNet.FC(inDepth = Z_DIM,outDepth = Z_DIM*4,loadFromFile = loadFromFile))
gfc1 = ConvNet.addlist(glist,ConvNet.FC(inDepth = Z_DIM*4,outDepth = GF*4*3*4,loadFromFile = loadFromFile))
gdc0 = ConvNet.addlist(glist,ConvNet.DeConv(inDepth = GF*4,outDepth = GF*4,filterSize = 3,loadFromFile = loadFromFile))#4in
gdc1 = ConvNet.addlist(glist,ConvNet.DeConv(inDepth = GF*4,outDepth = GF*4,filterSize = 3,loadFromFile = loadFromFile))#8in
gdc2 = ConvNet.addlist(glist,ConvNet.DeConv(inDepth = GF*4,outDepth = GF*2,filterSize = 5,loadFromFile = loadFromFile))#16in
gdc3 = ConvNet.addlist(glist,ConvNet.DeConv(inDepth = GF*2,outDepth = GF*2,filterSize = 5,loadFromFile = loadFromFile))#32in
gdc4 = ConvNet.addlist(glist,ConvNet.DeConv(inDepth = GF*2,outDepth = GF*1,filterSize = 5,loadFromFile = loadFromFile))#32in
gdc5 = ConvNet.addlist(glist,ConvNet.DeConv(inDepth = GF*1,outDepth = IMAGE_CHANNEL,filterSize = 5,loadFromFile = loadFromFile))#64in
if loadFromFile:loadFromFile.close()

dlist = []
loadFromFile = ConvNet.openEmptyFileR('gan4d.txt')
dcv0 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = IMAGE_CHANNEL,outDepth = DF*1,filterSize = 7,loadFromFile = loadFromFile))#64out
dcv1 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = DF*1,outDepth = DF*2,filterSize = 5,loadFromFile = loadFromFile))#32out
dcv2 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = DF*2,outDepth = DF*2,filterSize = 5,loadFromFile = loadFromFile))#16out
Exemplo n.º 4
0
GF = 32             # Dimension of G filters in first conv layer. default [64]
DF = 32             # Dimension of D filters in first conv layer. default [64]
Z_DIM = 100
IMAGE_CHANNEL = 3
LR = 0.0001         # Learning rate
#左右翻转

def read_image(path):
    image = scipy.misc.imread(path)
    image = scipy.misc.imresize(image,(IMAGE_H,IMAGE_W))
    image = image[np.newaxis,:,:,:] 
    image = image.astype('float32')/255.0 - 0.5
    return image

dlist = []
loadFromFile = ConvNet.openEmptyFileR('gan10d.txt')
dcv0 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = IMAGE_CHANNEL,outDepth = DF*2,filterSize = 7,loadFromFile = loadFromFile))#64out
dcv1 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = DF*2,outDepth = DF*4,filterSize = 5,loadFromFile = loadFromFile))#32out
dcv2 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = DF*4,outDepth = DF*8,filterSize = 5,loadFromFile = loadFromFile))#16out
dcv3 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = DF*8,outDepth = DF*16,filterSize = 3,loadFromFile = loadFromFile))#8out
dcv4 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = DF*16,outDepth = DF*16,filterSize = 3,loadFromFile = loadFromFile))#4out
dfc0 = ConvNet.addlist(dlist,ConvNet.FC(inDepth = DF*16*3*4,outDepth = 64,loadFromFile = loadFromFile))
dfc1 = ConvNet.addlist(dlist,ConvNet.FC(inDepth = 64,outDepth = 1,loadFromFile = loadFromFile))
if loadFromFile:loadFromFile.close()

def discriminator(inputT):
    _ret = dcv0.getLayer(inputT, convStride = 2, poolSize = 2,isRelu=True, fixed = False)
    _ret = dcv1.getLayer(_ret, convStride = 2, poolSize = 1,isRelu=True, fixed = False)
    _ret = dcv2.getLayer(_ret, convStride = 2, poolSize = 1,isRelu=True, fixed = False)
    _ret = dcv3.getLayer(_ret, convStride = 2, poolSize = 1,isRelu=True, fixed = False)
    _ret = dcv4.getLayer(_ret, convStride = 2, poolSize = 1,isRelu=True, fixed = False)
Exemplo n.º 5
0
            g = wholeData[idx,j,i,1] * scale + bias
            b = wholeData[idx,j,i,2] * scale + bias
            ConvNet.setpixel(data,i,j,r,g,b)
    #lbl = wholeData[idx]
    ConvNet.saveImg(data, filename)
print("loading")
CifarData = extract_data("E:\\MNIST\\cifar-10-batches-bin\\HWC.bin",60000)
print("loaded")

inputLayer = tf.placeholder(tf.float32,shape=(BATCH_SIZE, IMAGE_SIZEH, IMAGE_SIZEW, NUM_CHANNELS))
finaldata = tf.placeholder(tf.float32, shape=(BATCH_SIZE, IMAGE_SIZEH, IMAGE_SIZEW, NUM_CHANNELS))

inputData = np.ndarray([BATCH_SIZE, IMAGE_SIZEH, IMAGE_SIZEW, NUM_CHANNELS], np.float32)
verifydata = np.ndarray([BATCH_SIZE, IMAGE_SIZEH, IMAGE_SIZEW, NUM_CHANNELS], np.float32)

testfile = ConvNet.openEmptyFileR('cifar.txt')
conv1,conv1save = ConvNet.ConvLayer(inputLayer,filterSize = 5,outDepth = 32,convStride = 1,poolSize = 2,loadFromFile=testfile)
conv2,conv2save = ConvNet.ConvLayer(conv1,filterSize = 5,outDepth = 32,convStride = 1,poolSize = 2,loadFromFile=testfile)
conv3,conv3save = ConvNet.ConvLayer(conv2,filterSize = 5,outDepth = 64,convStride = 1,poolSize = 2,loadFromFile=testfile)
reshape = ConvNet.Conv2FC_Reshape(conv3)

fc1,fc1saver = ConvNet.FCLayer(reshape,2048,loadFromFile=testfile)

deshape = ConvNet.FC2Conv_Reshape(fc1,4,4,128)
uconv1,uconv1save = ConvNet.DeConvLayer(deshape,filterSize=5,output_shape=[BATCH_SIZE,8,8,64],convStride = 2, loadFromFile = testfile)
uconv2,uconv2save = ConvNet.DeConvLayer(uconv1,filterSize=5,output_shape=[BATCH_SIZE,16,16,64],convStride = 2, loadFromFile = testfile)
uconv3,uconv3save = ConvNet.DeConvLayer(uconv2,filterSize=5,output_shape=[BATCH_SIZE,32,32,3],convStride = 2, loadFromFile = testfile, isRelu = False)
regeneratedImg = uconv3

if testfile:testfile.close()   
Exemplo n.º 6
0
    #clearImg(data,0)
    for i in xrange(0,wholeData.shape[1]):
        for j in xrange(0,wholeData.shape[2]):
            r = wholeData[idx,j,i,0] * scale + bias
            g = wholeData[idx,j,i,1] * scale + bias
            b = wholeData[idx,j,i,2] * scale + bias
            ConvNet.setpixel(data,i,j,r,g,b)
    #lbl = wholeData[idx]
    ConvNet.saveImg(data, filename)

CifarData = extract_data("E:\\MNIST\\cifar-10-batches-bin\\HWC.bin",60000)

inputData = np.ndarray([BATCH_SIZE, IMAGE_SIZEH, IMAGE_SIZEW, NUM_CHANNELS], np.float32)
verifydata = np.ndarray([BATCH_SIZE, IMAGE_SIZEH, IMAGE_SIZEW, NUM_CHANNELS], np.float32)

loadFromFile = ConvNet.openEmptyFileR('cifar.txt')
cv1  = ConvNet.Conv(inDepth = NUM_CHANNELS,outDepth = 32,filterSize = 5, loadFromFile=loadFromFile)#16*16
cv2  = ConvNet.Conv(inDepth = 32,outDepth = 32,filterSize = 5, loadFromFile=loadFromFile)#8*8
cv3  = ConvNet.Conv(inDepth = 32,outDepth = 64,filterSize = 5, loadFromFile=loadFromFile)#4*4
fc2 = ConvNet.FC(inDepth = 4*4*64,outDepth = 2048,loadFromFile = loadFromFile)
dc1 = ConvNet.DeConv(inDepth = 128,outDepth = 64,filterSize = 5,loadFromFile = loadFromFile)
dc2 = ConvNet.DeConv(inDepth = 64,outDepth = 64,filterSize = 5,loadFromFile = loadFromFile)
dc3 = ConvNet.DeConv(inDepth = 64,outDepth = 3,filterSize = 5,loadFromFile = loadFromFile)

if loadFromFile:loadFromFile.close()   


inputLayer = tf.placeholder(tf.float32,shape=(BATCH_SIZE, IMAGE_SIZEH, IMAGE_SIZEW, NUM_CHANNELS))
finaldata = tf.placeholder(tf.float32, shape=(BATCH_SIZE, IMAGE_SIZEH, IMAGE_SIZEW, NUM_CHANNELS))

net = cv1.getLayer(inputLayer, convStride = 1, poolSize = 2, isRelu = True, fixed = False)
Exemplo n.º 7
0
import MNISTDataLargeSet

BATCH_SIZE = 256

#用来验证的数据,和训练数据一样,也可以用不同的数据验证

#输入层
inputlayer = tf.placeholder(tf.float32, [BATCH_SIZE, MNISTDataLargeSet.IMAGE_H, MNISTDataLargeSet.IMAGE_W, MNISTDataLargeSet.IMAGE_CHANNEL])
testOne = tf.placeholder(tf.float32, [BATCH_SIZE, MNISTDataLargeSet.IMAGE_H, MNISTDataLargeSet.IMAGE_W, MNISTDataLargeSet.IMAGE_CHANNEL])

#预期的数据
labels_node = tf.placeholder(tf.int64, shape=(BATCH_SIZE))

#网络定义
plist = []
loadFromFile = ConvNet.openEmptyFileR('MNISTLargeSet.txt')#从文件中加载已训练的,文件不存在的话默认会随机初始化网络
cv0 = ConvNet.addlist(plist,ConvNet.Conv(inDepth = MNISTDataLargeSet.IMAGE_CHANNEL,outDepth = 16,filterSize = 5,loadFromFile = loadFromFile))
cv1 = ConvNet.addlist(plist,ConvNet.Conv(inDepth = 16,outDepth = 32,filterSize = 5,loadFromFile = loadFromFile))
fc0 = ConvNet.addlist(plist,ConvNet.FC(inDepth = 7*7*32,outDepth = 64,loadFromFile = loadFromFile))
fc1 = ConvNet.addlist(plist,ConvNet.FC(inDepth = 64,outDepth = 10,loadFromFile = loadFromFile))
if loadFromFile:loadFromFile.close()   

def net(inputT):
    _ret = cv0.getLayer(inputT, convStride = 1, poolSize = 2,isRelu=True, fixed = False)
    _ret = cv1.getLayer(_ret, convStride = 1, poolSize = 2,isRelu=True, fixed = False)
    _ret = ConvNet.Conv2FC_Reshape(_ret)
    _ret = fc0.getLayer(_ret, isRelu=True, fixed = False)
    _ret = fc1.getLayer(_ret, isRelu=False, fixed = False)
    return _ret

fc2 = net(inputlayer)
Exemplo n.º 8
0
        self.nextImage = None
    
        self.t = threading.Thread(target=_load_t,args=())
        self.t.start()
    
        return ret

CBHR = celebaBetter("E:\\MNIST\\celebaBetter\\")
CBLR = celebaBetter("E:\\MNIST\\CelebABetterLowRes\\")



print("startload")
glist = []
GF = 64             # Dimension of G filters in first conv layer. default [64]
loadFromFile = ConvNet.openEmptyFileR('gan12srg.txt')

def resblock():
    gcva = ConvNet.addlist(glist,ConvNet.Conv(inDepth = IMAGE_CHANNEL,outDepth = GF*1,filterSize = 5,biasInitVal=0,loadFromFile = loadFromFile))
    gcvb = ConvNet.addlist(glist,ConvNet.Conv(inDepth = GF*1         ,outDepth = GF*1,filterSize = 5,biasInitVal=0,loadFromFile = loadFromFile))
    gcvc = ConvNet.addlist(glist,ConvNet.Conv(inDepth = GF*1         ,outDepth = GF*1,filterSize = 5,biasInitVal=0,loadFromFile = loadFromFile))
    gcvd = ConvNet.addlist(glist,ConvNet.Conv(inDepth = GF*1,outDepth = IMAGE_CHANNEL,filterSize = 5,biasInitVal=0,loadFromFile = loadFromFile))
    return gcva,gcvb,gcvc,gcvd

gcva0,gcvb0,gcvc0,gcvd0 = resblock()
gcva1,gcvb1,gcvc1,gcvd1 = resblock()
gcva2,gcvb2,gcvc2,gcvd2 = resblock()
gcva3,gcvb3,gcvc3,gcvd3 = resblock()
gcva4,gcvb4,gcvc4,gcvd4 = resblock()
gcva5,gcvb5,gcvc5,gcvd5 = resblock()
Exemplo n.º 9
0
CBT = celebaFacePretty("E:\\MNIST\\CelebA\\Img\\img_celeba.7z\\trainData\\good\\")
CBF = celebaFacePretty("E:\\MNIST\\CelebA\\Img\\img_celeba.7z\\trainData\\nogood\\")
CBM = celebaFacePretty("E:\\MNIST\\CelebA\\Img\\img_celeba.7z\\trainData\\mid\\")
CBPL = celebaFacePretty("E:\\MNIST\\CelebA\\Img\\img_celeba.7z\\trainData\\plus\\")
CBMI = celebaFacePretty("E:\\MNIST\\CelebA\\Img\\img_celeba.7z\\trainData\\minus\\")
#CB_GB =  celebaFacePretty2(True,"E:\\MNIST\\CelebA\\Img\\img_celeba.7z\\trainData\\GB\\")
CB_BG =  celebaFacePretty2(False,"E:\\MNIST\\CelebA\\Img\\img_celeba.7z\\trainData\\BG\\")

#img = CBT.extract_data()
#ConvNet.saveImages(img, [4,4], "test.jpg")
#exit()

DF = 32             # Dimension of D filters in first conv layer. default [64]
dlist = []
loadFromFile = ConvNet.openEmptyFileR('faceTrain.txt')
dcv0 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = IMAGE_CHANNEL,outDepth = DF,filterSize = 5,loadFromFile = loadFromFile))#64out
dcv1 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = DF,outDepth = DF*2,filterSize = 5,loadFromFile = loadFromFile))#64out
dcv2 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = DF*2,outDepth = DF*4,filterSize = 5,loadFromFile = loadFromFile))#32out
dcv3 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = DF*4,outDepth = DF*8,filterSize = 5,loadFromFile = loadFromFile))#16out
dcv4 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = DF*8,outDepth = DF*16,filterSize = 3,loadFromFile = loadFromFile))#8out
dcv5 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = DF*16,outDepth = DF*16,filterSize = 3,loadFromFile = loadFromFile))#4out
dfc0 = ConvNet.addlist(dlist,ConvNet.FC(inDepth = DF*16*3*4,outDepth = 128,loadFromFile = loadFromFile))
dfc1 = ConvNet.addlist(dlist,ConvNet.FC(inDepth = 128,outDepth = 1,loadFromFile = loadFromFile))
if loadFromFile:loadFromFile.close()

def discriminator(inputT):
    _ret = dcv0.getLayer(inputT, convStride = 1, poolSize = 2,isRelu=True, fixed = False)
    _ret = dcv1.getLayer(_ret, convStride = 1, poolSize = 2,isRelu=True, fixed = False)
    _ret = dcv2.getLayer(_ret, convStride = 1, poolSize = 2,isRelu=True, fixed = False)
    _ret = dcv3.getLayer(_ret, convStride = 1, poolSize = 2,isRelu=True, fixed = False)
Exemplo n.º 10
0
        bytestream.close()
        bytestream = open(filePath + str(file_index)+".bin","br")
        content_index = 0

    buf = bytestream.read(BATCH_SIZE * IMAGE_H * IMAGE_W * IMAGE_CHANNEL)
    data = np.frombuffer(buf, dtype=np.uint8).astype(np.float32)
    data = (data) / 256.0 - 0.5
    data = data.reshape(BATCH_SIZE, IMAGE_H, IMAGE_W, IMAGE_CHANNEL)
    return data

t2, t4, t8, t16 = IMAGE_H//2, IMAGE_H//4, IMAGE_H//8, IMAGE_H//16
s2, s4, s8, s16 = IMAGE_W//2, IMAGE_W//4, IMAGE_W//8, IMAGE_W//16

print("loading")
glist = []
loadFromFile = ConvNet.openEmptyFileR("gan10g.txt")
gfc0 = ConvNet.addlist(glist,ConvNet.FC(inDepth = Z_DIM,outDepth = GF*8*t16*s16,loadFromFile = loadFromFile))
gdc0 = ConvNet.addlist(glist,ConvNet.DeConv(inDepth = GF*8,outDepth = GF*4,filterSize = 5,loadFromFile = loadFromFile))
gdc1 = ConvNet.addlist(glist,ConvNet.DeConv(inDepth = GF*4,outDepth = GF*2,filterSize = 5,loadFromFile = loadFromFile))
gdc2 = ConvNet.addlist(glist,ConvNet.DeConv(inDepth = GF*2,outDepth = GF*2,filterSize = 5,loadFromFile = loadFromFile))
gdc3 = ConvNet.addlist(glist,ConvNet.DeConv(inDepth = GF*2,outDepth = IMAGE_CHANNEL,filterSize = 5,loadFromFile = loadFromFile))
if loadFromFile:loadFromFile.close()

dlist = []
loadFromFile = ConvNet.openEmptyFileR("gan10d.txt")
dcv0 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = IMAGE_CHANNEL,outDepth = DF*1,filterSize = 5,loadFromFile = loadFromFile))
dcv1 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = DF*1,outDepth = DF*2,filterSize = 5,loadFromFile = loadFromFile))
dcv2 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = DF*2,outDepth = DF*4,filterSize = 5,loadFromFile = loadFromFile))
dcv3 = ConvNet.addlist(dlist,ConvNet.Conv(inDepth = DF*4,outDepth = DF*8,filterSize = 5,loadFromFile = loadFromFile))
dfc0 = ConvNet.addlist(dlist,ConvNet.FC(inDepth = DF*8*t16*s16,outDepth = Z_DIM,loadFromFile = loadFromFile))
dfc1 = ConvNet.addlist(dlist,ConvNet.FC(inDepth = Z_DIM,outDepth = 1,loadFromFile = loadFromFile))
Exemplo n.º 11
0
,"lefteye_x"            
,"lefteye_y"            
,"righteye_x"           
,"righteye_y"           
,"nose_x"
,"nose_y"        
,"leftmouth_x"          
,"leftmouth_y"          
,"rightmouth_x"         
,"rightmouth_y"         
]


total = 202599
disk = "K:"
loadFromFileattr = ConvNet.openEmptyFileR(disk+"\\MNIST\\CelebA\\Anno\\list_attr_celeba.txt")
loadFromFileldmk = ConvNet.openEmptyFileR(disk+"\\MNIST\\CelebA\\Anno\\list_landmarks_align_celeba.txt")

line = loadFromFileattr.readline();
line = loadFromFileattr.readline();
line = loadFromFileldmk.readline();
line = loadFromFileldmk.readline();

alist = []
avg = [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
top = [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
btn = [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]

for i in xrange(0,total):
    attr = loadFromFileattr.readline()
    ldmk = loadFromFileldmk.readline()