예제 #1
0
def dataset(opts):
  img_paths1 = []
  img_paths2 = []
  if opts['experiment'] == 'afskaering':
    img_paths2 = misc.gather_files(os.path.join(
        options.dataset_dir, 'Dag 2'), 'Afskaering*_kam*.bmp')
  elif opts['experiment'] == 'ekstra1':
    img_paths2 = misc.gather_files(os.path.join(
        options.dataset_dir, 'Dag 2'), 'Ekstra billedserie 1*_kam*.bmp')
  elif opts['experiment'] == 'ekstra2':
    img_paths2 = misc.gather_files(os.path.join(
        options.dataset_dir, 'Dag 2'), 'Ekstra billedserie 2*_kam*.bmp')
  elif opts['experiment'] == 'mishandling':
    img_paths2 = misc.gather_files(os.path.join(
        options.dataset_dir, 'Dag 2'), 'Mishandling*_kam*.bmp')
  elif opts['experiment'] == 'ophaengning':
    img_paths2 = misc.gather_files(os.path.join(
        options.dataset_dir, 'Dag 2'), 'Ophaengning*_kam*.bmp')

  img_paths1.extend(misc.gather_files(os.path.join(
      options.dataset_dir, 'Dag 1'), 'Normal*_kam*.bmp'))
  img_paths2.extend(misc.gather_files(os.path.join(
      options.dataset_dir, 'Dag 2'), 'Normal*_kam*.bmp'))

  img_paths1, img_paths2 = prune(img_paths1, img_paths2)

  depth_paths1 = map(depth_path, img_paths1)
  depth_paths2 = map(depth_path, img_paths2)

  return zip(img_paths1, depth_paths1), zip(img_paths2, depth_paths2)
예제 #2
0
def training_files(num):
  img_files = misc.gather_files(options.dataset_dir, '*_kam*.bmp')[:num]
  depth_files = map(depth_path, img_files)
  return zip(img_files, depth_files)