def train_prototxt_maker(train, init, solver, train_set): model=os.environ['EXP'] + '/model/' +os.environ['NET_ID'] + init #change this if not os.path.isfile(model): model=model_finder(os.environ['EXP']+ '/model/' + os.environ['NET_ID']) for variable in ['train', solver]: file1= os.environ['CONFIG_DIR'] + '/' + variable + '.prototxt' file_output = os.environ['CONFIG_DIR'] + '/' + variable + '_' + train_set + '.prototxt' shutil.copyfile(file1, file_output) file_editor(file_output, train_set=train_set, test_set='') return model
def test_prototext(type_, caffe_, features, test_set): model=os.environ['EXP'] + '/model/' + os.environ['NET_ID'] + caffe_ if not os.path.isfile(model): model=model_finder(os.environ['EXP']+'/model/'+os.environ['NET_ID'], type_) os.environ['FEATURE_DIR']=os.environ['EXP'] + features + os.environ['NET_ID'] fc8 = os.environ['FEATURE_DIR'] + '/' + test_set + '/fc8' crf = os.environ['FEATURE_DIR'] + '/' + test_set + '/crf' if not os.path.exists(fc8): os.makedirs(fc8) if not os.path.exists(crf): os.makedirs(crf) file1= os.environ['CONFIG_DIR'] + '/test.prototxt' file_output = os.environ['CONFIG_DIR'] + '/test_' + test_set + '.prototxt' shutil.copyfile(file1, file_output) file_editor(file_output, train_set='', test_set=test_set) return model