__author__ = 'Sarath'

import numpy
import os
import sys

#sys.path.append("../Model/")
from Model.corrnet import *


def create_folder(folder):

    if not os.path.exists(folder):
        os.makedirs(folder)


src_folder = sys.argv[1] + "matpic/"
tgt_folder = sys.argv[2]

model = CorrNet()
model.load(tgt_folder)

create_folder(tgt_folder + "project/")

mat = numpy.load(src_folder + "train/view1.npy")
new_mat = model.proj_from_left(mat)
numpy.save(tgt_folder + "project/train-view1", new_mat)

mat = numpy.load(src_folder + "train/view2.npy")
new_mat = model.proj_from_right(mat)
numpy.save(tgt_folder + "project/train-view2", new_mat)

mat = numpy.load(src_folder + "train/labels.npy")
numpy.save(tgt_folder + "project/train-labels", mat)


mat = numpy.load(src_folder + "valid/view1.npy")
new_mat = model.proj_from_left(mat)
numpy.save(tgt_folder + "project/valid-view1", new_mat)

mat = numpy.load(src_folder + "valid/view2.npy")
new_mat = model.proj_from_right(mat)
numpy.save(tgt_folder + "project/valid-view2", new_mat)

mat = numpy.load(src_folder + "valid/labels.npy")
numpy.save(tgt_folder + "project/valid-labels", mat)


mat = numpy.load(src_folder + "test/view1.npy")
new_mat = model.proj_from_left(mat)
numpy.save(tgt_folder + "project/test-view1", new_mat)

mat = numpy.load(src_folder + "test/view2.npy")
new_mat = model.proj_from_right(mat)
numpy.save(tgt_folder + "project/test-view2", new_mat)

mat = numpy.load(src_folder + "test/labels.npy")
numpy.save(tgt_folder + "project/test-labels", mat)

aaa62b6b8c1557ab227aaecbc0705d8c7f3f26e5
<mask token>


def create_folder(folder):
    if not os.path.exists(folder):
        os.makedirs(folder)


<mask token>

<mask token>


def create_folder(folder):
    if not os.path.exists(folder):
        os.makedirs(folder)


<mask token>
model.load(tgt_folder)
create_folder(tgt_folder + 'project/')
<mask token>
numpy.save(tgt_folder + 'project/train-view1', new_mat)
<mask token>
numpy.save(tgt_folder + 'project/train-view2', new_mat)
<mask token>
numpy.save(tgt_folder + 'project/train-labels', mat)
<mask token>
numpy.save(tgt_folder + 'project/valid-view1', new_mat)
<mask token>
numpy.save(tgt_folder + 'project/valid-view2', new_mat)
<mask token>
numpy.save(tgt_folder + 'project/valid-labels', mat)
<mask token>
numpy.save(tgt_folder + 'project/test-view1', new_mat)
<mask token>
numpy.save(tgt_folder + 'project/test-view2', new_mat)
<mask token>
numpy.save(tgt_folder + 'project/test-labels', mat)

__author__ = 'Sarath'
<mask token>


def create_folder(folder):
    if not os.path.exists(folder):
        os.makedirs(folder)


src_folder = sys.argv[1] + 'matpic/'
tgt_folder = sys.argv[2]
model = CorrNet()
model.load(tgt_folder)
create_folder(tgt_folder + 'project/')
mat = numpy.load(src_folder + 'train/view1.npy')
new_mat = model.proj_from_left(mat)
numpy.save(tgt_folder + 'project/train-view1', new_mat)
mat = numpy.load(src_folder + 'train/view2.npy')
new_mat = model.proj_from_right(mat)
numpy.save(tgt_folder + 'project/train-view2', new_mat)
mat = numpy.load(src_folder + 'train/labels.npy')
numpy.save(tgt_folder + 'project/train-labels', mat)
mat = numpy.load(src_folder + 'valid/view1.npy')
new_mat = model.proj_from_left(mat)
numpy.save(tgt_folder + 'project/valid-view1', new_mat)
mat = numpy.load(src_folder + 'valid/view2.npy')
new_mat = model.proj_from_right(mat)
numpy.save(tgt_folder + 'project/valid-view2', new_mat)
mat = numpy.load(src_folder + 'valid/labels.npy')
numpy.save(tgt_folder + 'project/valid-labels', mat)
mat = numpy.load(src_folder + 'test/view1.npy')
new_mat = model.proj_from_left(mat)
numpy.save(tgt_folder + 'project/test-view1', new_mat)
mat = numpy.load(src_folder + 'test/view2.npy')
new_mat = model.proj_from_right(mat)
numpy.save(tgt_folder + 'project/test-view2', new_mat)
mat = numpy.load(src_folder + 'test/labels.npy')
numpy.save(tgt_folder + 'project/test-labels', mat)

__author__ = 'Sarath'
import numpy
import os
import sys
from Model.corrnet import *


def create_folder(folder):
    if not os.path.exists(folder):
        os.makedirs(folder)


src_folder = sys.argv[1] + 'matpic/'
tgt_folder = sys.argv[2]
model = CorrNet()
model.load(tgt_folder)
create_folder(tgt_folder + 'project/')
mat = numpy.load(src_folder + 'train/view1.npy')
new_mat = model.proj_from_left(mat)
numpy.save(tgt_folder + 'project/train-view1', new_mat)
mat = numpy.load(src_folder + 'train/view2.npy')
new_mat = model.proj_from_right(mat)
numpy.save(tgt_folder + 'project/train-view2', new_mat)
mat = numpy.load(src_folder + 'train/labels.npy')
numpy.save(tgt_folder + 'project/train-labels', mat)
mat = numpy.load(src_folder + 'valid/view1.npy')
new_mat = model.proj_from_left(mat)
numpy.save(tgt_folder + 'project/valid-view1', new_mat)
mat = numpy.load(src_folder + 'valid/view2.npy')
new_mat = model.proj_from_right(mat)
numpy.save(tgt_folder + 'project/valid-view2', new_mat)
mat = numpy.load(src_folder + 'valid/labels.npy')
numpy.save(tgt_folder + 'project/valid-labels', mat)
mat = numpy.load(src_folder + 'test/view1.npy')
new_mat = model.proj_from_left(mat)
numpy.save(tgt_folder + 'project/test-view1', new_mat)
mat = numpy.load(src_folder + 'test/view2.npy')
new_mat = model.proj_from_right(mat)
numpy.save(tgt_folder + 'project/test-view2', new_mat)
mat = numpy.load(src_folder + 'test/labels.npy')
numpy.save(tgt_folder + 'project/test-labels', mat)

__author__ = 'Sarath'

import numpy
import os
import sys

#sys.path.append("../Model/")
from Model.corrnet import *


def create_folder(folder):

    if not os.path.exists(folder):
        os.makedirs(folder)


src_folder = sys.argv[1] + "matpic/"
tgt_folder = sys.argv[2]

model = CorrNet()
model.load(tgt_folder)

create_folder(tgt_folder + "project/")

mat = numpy.load(src_folder + "train/view1.npy")
new_mat = model.proj_from_left(mat)
numpy.save(tgt_folder + "project/train-view1", new_mat)

mat = numpy.load(src_folder + "train/view2.npy")
new_mat = model.proj_from_right(mat)
numpy.save(tgt_folder + "project/train-view2", new_mat)

mat = numpy.load(src_folder + "train/labels.npy")
numpy.save(tgt_folder + "project/train-labels", mat)


mat = numpy.load(src_folder + "valid/view1.npy")
new_mat = model.proj_from_left(mat)
numpy.save(tgt_folder + "project/valid-view1", new_mat)

mat = numpy.load(src_folder + "valid/view2.npy")
new_mat = model.proj_from_right(mat)
numpy.save(tgt_folder + "project/valid-view2", new_mat)

mat = numpy.load(src_folder + "valid/labels.npy")
numpy.save(tgt_folder + "project/valid-labels", mat)


mat = numpy.load(src_folder + "test/view1.npy")
new_mat = model.proj_from_left(mat)
numpy.save(tgt_folder + "project/test-view1", new_mat)

mat = numpy.load(src_folder + "test/view2.npy")
new_mat = model.proj_from_right(mat)
numpy.save(tgt_folder + "project/test-view2", new_mat)

mat = numpy.load(src_folder + "test/labels.npy")
numpy.save(tgt_folder + "project/test-labels", mat)
