##############################################################################

unix(d2s('mkdir -p', opjD(fname(model_path))))

for t in train_val_lst:
    print t
print('')
for t in solver_lst:
    print t

list_of_strings_to_txt_file(opj(model_path, 'train_val.prototxt'),
                            train_val_lst)
solver_path = opj(model_path, 'solver.prototxt')
list_of_strings_to_txt_file(solver_path, solver_lst)

solver = protos.setup_solver(solver_path)


def put_data_into_model(data, solver, b=0):
    ############## load data into solver #####################
    #

    ctr = 0
    for t in range(2):
        for camera in ['left', 'right']:
            solver.net.blobs['ZED_data_pool2'].data[
                b, ctr:ctr + 3, :, :] = data[camera][t][:, :, :].transpose(
                    2, 0, 1)
            ctr += 3

    Racing = 0
示例#2
0
        plot(x, y, 'o')
        pause(2)

print_b = False
load_images = True
A = get_new_Data_dic()
meta_path = '/Volumes/SSD_2TB/bair_car_data_new_28April2017/meta/direct_rewrite_test_28Apr17_17h50m34s_Mr_Black'
rgb_1to4_path = '/Volumes/SSD_2TB/bair_car_data_new_28April2017/rgb_1to4/direct_rewrite_test_28Apr17_17h50m34s_Mr_Black'
multi_preprocess_pkl_files(A,
                           meta_path,
                           rgb_1to4_path,
                           print_b,
                           load_images,
                           load_right_images=True)
import kzpy3.caf8.protos as protos
solver = protos.setup_solver(opjh('kzpy3/caf8/z2_color_aruco/solver.prototxt'))
solver.net.copy_from(
    '/Users/karlzipser/caffe_models/z2_color_aruco_potential_May2017/z2_color_iter_6500000.caffemodel'
)
#solver.net.copy_from('/Users/karlzipser/caffe_models/z2_color/z2_color.caffemodel')
solver.net.blobs['metadata'].data[0, :, :, :] *= 0
solver.net.blobs['metadata'].data[0, 3, :, :] = 1
for i in range(1000, len(A['left'])):
    ctr = 0
    for c in range(3):
        for camera in ['left', 'right']:
            for t in range(2):
                solver.net.blobs['ZED_data_pool2'].data[
                    0, ctr, :, :] = A[camera][i][:, :, c]
                ctr += 1
    solver.net.forward()