original_docstring: 
      Load the data and make the generators
      :param data_dir:       the directory where the dataset's file are stored
      :param valid_fraction: what franction of the dataset should be used
                             as a validation sample
      
docstring: Load the data and make the generators
docstring_tokens: Load the data and make the generators
code: def make_patch(inp_dir, out_dir, data_type):
      """
      Load the data and make the generators
      :param data_dir:       the directory where the dataset's file are stored
      :param valid_fraction: what franction of the dataset should be used
                             as a validation sample
      """
      print("Start to make the training patch type {:s}...".format(data_type))
  
      image_paths = glob.glob('{:s}/{:s}/*.png'.format(inp_dir, data_type), recursive=True)
  
      num_images = len(image_paths)
      if num_images == 0:
          raise RuntimeError('No data files found in ' + data_dir)
  
      patch_type = PATCH_TYPE[1] # 64x64 sliding window strategy
      patch_out_dir_1 = ops.join(out_dir, data_type)
      patch_out_dir_2 = ops.join(patch_out_dir_1, patch_type)
  
      if not ops.exists(patch_out_dir_2):
          os.makedirs(patch_out_dir_2)
  
      total_value = np.array([0.0, 0.0, 0.0])
      total_patch = 0
  
      for path in image_paths:
          mean, amount = make_ROI_by_type(path, patch_out_dir_2, patch_type)
  
          total_value += mean
          total_patch += amount
  
      mean_value = total_value / total_patch
      print(mean_value)
  
      with open(ops.join(patch_out_dir_1, 'mean_{:s}.txt'.format(patch_type)), "w") as t_file:
          for value in mean_value:
              t_file.write('{:.4f}\n'.format(value))
  
      print("Finish splitting the data type {:s}...".format(data_type))
code_tokens: def make_patch ( inp_dir , out_dir , data_type ) : print ( "Start to make the training patch type {:s}..." . format ( data_type ) ) image_paths = glob . glob ( '{:s}/{:s}/*.png' . format ( inp_dir , data_type ) , recursive = True ) num_images = len ( image_paths ) if num_images == 0 : raise RuntimeError ( 'No data files found in ' + data_dir ) patch_type = PATCH_TYPE [ 1 ] patch_out_dir_1 = ops . join ( out_dir , data_type ) patch_out_dir_2 = ops . join ( patch_out_dir_1 , patch_type ) if not ops . exists ( patch_out_dir_2 ) : os . makedirs ( patch_out_dir_2 ) total_value = np . array ( [ 0.0 , 0.0 , 0.0 ] ) total_patch = 0 for path in image_paths : mean , amount = make_ROI_by_type ( path , patch_out_dir_2 , patch_type ) total_value += mean total_patch += amount mean_value = total_value / total_patch print ( mean_value ) with open ( ops . join ( patch_out_dir_1 , 'mean_{:s}.txt' . format ( patch_type ) ) , "w" ) as t_file : for value in mean_value : t_file . write ( '{:.4f}\n' . format ( value ) ) print ( "Finish splitting the data type {:s}..." . format ( data_type ) )
short_docstring: Load the data and make the generators
short_docstring_tokens: Load the data and make the generators
comment: """
      Load the data and make the generators
      :param data_dir:       the directory where the dataset's file are stored
      :param valid_fraction: what franction of the dataset should be used
                             as a validation sample
      """$SEP$# 64x64 sliding window strategy