Loading explore_data3.py 0 → 100644 +1109 −0 File added.Preview size limit exceeded, changes collapsed. Show changes nn_ds_neibs15.py +1 −10 Original line number Original line Diff line number Diff line Loading @@ -199,8 +199,6 @@ def getMoreFiles(fpaths,rslt): print_time("Done") print_time("Done") rslt.append(dataset) rslt.append(dataset) #from http://warmspringwinds.github.io/tensorflow/tf-slim/2016/12/21/tfrecords-guide/ #from http://warmspringwinds.github.io/tensorflow/tf-slim/2016/12/21/tfrecords-guide/ def read_and_decode(filename_queue): def read_and_decode(filename_queue): reader = tf.TFRecordReader() reader = tf.TFRecordReader() Loading Loading @@ -262,8 +260,6 @@ def extend_img_to_clusters(datasets_img,radius): rec['gt_ds'] = add_neibs(add_margins(rec['gt_ds'].reshape((height,width,-1)), radius, np.nan), radius).reshape((num_tiles,-1)) rec['gt_ds'] = add_neibs(add_margins(rec['gt_ds'].reshape((height,width,-1)), radius, np.nan), radius).reshape((num_tiles,-1)) pass pass def reformat_to_clusters(datasets_data): def reformat_to_clusters(datasets_data): cluster_size = (2 * CLUSTER_RADIUS + 1) * (2 * CLUSTER_RADIUS + 1) cluster_size = (2 * CLUSTER_RADIUS + 1) * (2 * CLUSTER_RADIUS + 1) # Reformat input data # Reformat input data Loading Loading @@ -302,7 +298,6 @@ TILE_SIZE = TILE_SIDE* TILE_SIDE # == 81 rec['target_disparity'] = target_disparity.reshape((target_disparity.shape[0],-1)) rec['target_disparity'] = target_disparity.reshape((target_disparity.shape[0],-1)) rec['gt_ds'] = gt_ds.reshape((gt_ds.shape[0],-1)) rec['gt_ds'] = gt_ds.reshape((gt_ds.shape[0],-1)) def replace_nan(datasets_data): def replace_nan(datasets_data): cluster_size = (2 * CLUSTER_RADIUS + 1) * (2 * CLUSTER_RADIUS + 1) cluster_size = (2 * CLUSTER_RADIUS + 1) * (2 * CLUSTER_RADIUS + 1) # Reformat input data # Reformat input data Loading Loading @@ -353,7 +348,6 @@ def shuffle_chunks_in_place(datasets_data, tiles_groups_per_chunk): ds['target_disparity'] = ds['target_disparity'].reshape((chunks_per_file,-1))[permut].reshape((groups_per_file,-1)) ds['target_disparity'] = ds['target_disparity'].reshape((chunks_per_file,-1))[permut].reshape((groups_per_file,-1)) ds['gt_ds'] = ds['gt_ds']. reshape((chunks_per_file,-1))[permut].reshape((groups_per_file,-1)) ds['gt_ds'] = ds['gt_ds']. reshape((chunks_per_file,-1))[permut].reshape((groups_per_file,-1)) def _setFileSlot(train_next,files): def _setFileSlot(train_next,files): train_next['files'] = files train_next['files'] = files train_next['slots'] = min(train_next['files'], MAX_FILES_PER_GROUP) train_next['slots'] = min(train_next['files'], MAX_FILES_PER_GROUP) Loading @@ -377,8 +371,6 @@ def replaceDataset(datasets_data, new_dataset, nset, period, findx): datasets_data[findx]['gt_ds'] [nset::period] = new_dataset['gt_ds'] datasets_data[findx]['gt_ds'] [nset::period] = new_dataset['gt_ds'] def zip_lvar_hvar(datasets_all_data, del_src = True): def zip_lvar_hvar(datasets_all_data, del_src = True): # cluster_size = (2 * CLUSTER_RADIUS + 1) * (2 * CLUSTER_RADIUS + 1) # cluster_size = (2 * CLUSTER_RADIUS + 1) * (2 * CLUSTER_RADIUS + 1) # Reformat input data # Reformat input data Loading Loading @@ -416,7 +408,6 @@ def reduce_tile_size(datasets_data, num_tile_layers, reduced_tile_side): [..., offs:offs+reduced_tile_side, offs:offs+reduced_tile_side]. [..., offs:offs+reduced_tile_side, offs:offs+reduced_tile_side]. reshape(-1,num_tile_layers*reduced_tile_side*reduced_tile_side)) reshape(-1,num_tile_layers*reduced_tile_side*reduced_tile_side)) def result_npy_to_tiff(npy_path, absolute, fix_nan): def result_npy_to_tiff(npy_path, absolute, fix_nan): """ """ Loading Loading
explore_data3.py 0 → 100644 +1109 −0 File added.Preview size limit exceeded, changes collapsed. Show changes
nn_ds_neibs15.py +1 −10 Original line number Original line Diff line number Diff line Loading @@ -199,8 +199,6 @@ def getMoreFiles(fpaths,rslt): print_time("Done") print_time("Done") rslt.append(dataset) rslt.append(dataset) #from http://warmspringwinds.github.io/tensorflow/tf-slim/2016/12/21/tfrecords-guide/ #from http://warmspringwinds.github.io/tensorflow/tf-slim/2016/12/21/tfrecords-guide/ def read_and_decode(filename_queue): def read_and_decode(filename_queue): reader = tf.TFRecordReader() reader = tf.TFRecordReader() Loading Loading @@ -262,8 +260,6 @@ def extend_img_to_clusters(datasets_img,radius): rec['gt_ds'] = add_neibs(add_margins(rec['gt_ds'].reshape((height,width,-1)), radius, np.nan), radius).reshape((num_tiles,-1)) rec['gt_ds'] = add_neibs(add_margins(rec['gt_ds'].reshape((height,width,-1)), radius, np.nan), radius).reshape((num_tiles,-1)) pass pass def reformat_to_clusters(datasets_data): def reformat_to_clusters(datasets_data): cluster_size = (2 * CLUSTER_RADIUS + 1) * (2 * CLUSTER_RADIUS + 1) cluster_size = (2 * CLUSTER_RADIUS + 1) * (2 * CLUSTER_RADIUS + 1) # Reformat input data # Reformat input data Loading Loading @@ -302,7 +298,6 @@ TILE_SIZE = TILE_SIDE* TILE_SIDE # == 81 rec['target_disparity'] = target_disparity.reshape((target_disparity.shape[0],-1)) rec['target_disparity'] = target_disparity.reshape((target_disparity.shape[0],-1)) rec['gt_ds'] = gt_ds.reshape((gt_ds.shape[0],-1)) rec['gt_ds'] = gt_ds.reshape((gt_ds.shape[0],-1)) def replace_nan(datasets_data): def replace_nan(datasets_data): cluster_size = (2 * CLUSTER_RADIUS + 1) * (2 * CLUSTER_RADIUS + 1) cluster_size = (2 * CLUSTER_RADIUS + 1) * (2 * CLUSTER_RADIUS + 1) # Reformat input data # Reformat input data Loading Loading @@ -353,7 +348,6 @@ def shuffle_chunks_in_place(datasets_data, tiles_groups_per_chunk): ds['target_disparity'] = ds['target_disparity'].reshape((chunks_per_file,-1))[permut].reshape((groups_per_file,-1)) ds['target_disparity'] = ds['target_disparity'].reshape((chunks_per_file,-1))[permut].reshape((groups_per_file,-1)) ds['gt_ds'] = ds['gt_ds']. reshape((chunks_per_file,-1))[permut].reshape((groups_per_file,-1)) ds['gt_ds'] = ds['gt_ds']. reshape((chunks_per_file,-1))[permut].reshape((groups_per_file,-1)) def _setFileSlot(train_next,files): def _setFileSlot(train_next,files): train_next['files'] = files train_next['files'] = files train_next['slots'] = min(train_next['files'], MAX_FILES_PER_GROUP) train_next['slots'] = min(train_next['files'], MAX_FILES_PER_GROUP) Loading @@ -377,8 +371,6 @@ def replaceDataset(datasets_data, new_dataset, nset, period, findx): datasets_data[findx]['gt_ds'] [nset::period] = new_dataset['gt_ds'] datasets_data[findx]['gt_ds'] [nset::period] = new_dataset['gt_ds'] def zip_lvar_hvar(datasets_all_data, del_src = True): def zip_lvar_hvar(datasets_all_data, del_src = True): # cluster_size = (2 * CLUSTER_RADIUS + 1) * (2 * CLUSTER_RADIUS + 1) # cluster_size = (2 * CLUSTER_RADIUS + 1) * (2 * CLUSTER_RADIUS + 1) # Reformat input data # Reformat input data Loading Loading @@ -416,7 +408,6 @@ def reduce_tile_size(datasets_data, num_tile_layers, reduced_tile_side): [..., offs:offs+reduced_tile_side, offs:offs+reduced_tile_side]. [..., offs:offs+reduced_tile_side, offs:offs+reduced_tile_side]. reshape(-1,num_tile_layers*reduced_tile_side*reduced_tile_side)) reshape(-1,num_tile_layers*reduced_tile_side*reduced_tile_side)) def result_npy_to_tiff(npy_path, absolute, fix_nan): def result_npy_to_tiff(npy_path, absolute, fix_nan): """ """ Loading