def scene_fname(self, bundle_file):
     """Scene file name based on bundle number
 Inputs: bundle_file (string) - bundle file number, from
         rome16k.parse.bundle_files
 Outputs: scene_fname (string) - path to the scene file
 """
     return os.path.join(self.rome16k_dir, 'scenes',
                         parse.scene_fname(bundle_file))
Exemple #2
0
        end_time = time.time()
        myprint("Done with {}-tuples ({} sec)".format(k,
                                                      end_time - start_time))
        myprint("Saving {}-tuples...".format(k))
        if not os.path.exists(os.path.dirname(tfname)):
            os.makedirs(os.path.dirname(tfname))
        with open(tuples_fname(opts, bundle_file, k), 'wb') as f:
            np.save(f, np.array(tlist).astype(np.uint16))
    # Final save of Tuples
    myprint("Done")


opts = get_build_scene_opts()
if opts.save == 'all':
    N = len(parse.bundle_files)
    for i, bundle_file in enumerate(parse.bundle_files):
        scene_fname = os.path.join(opts.top_dir, 'scenes',
                                   parse.scene_fname(bundle_file))
        if opts.verbose > 0:
            print('Computing {} ({} of {})...'.format(bundle_file, i + 1, N))
        start_time = time.time()
        process_scene_bundle(opts, bundle_file, scene_fname)
        end_time = time.time()
        if opts.verbose > 0:
            print('Finished {} ({:0.3f} sec)'.format(bundle_file,
                                                     end_time - start_time))
else:
    scene_fname = os.path.join(opts.top_dir, 'scenes',
                               parse.scene_fname(opts.save))
    process_scene_bundle(opts, opts.save, scene_fname)
 def scene_fname(self, bundle_file):
     return os.path.join(self.rome16k_dir, 'scenes',
                         parse.scene_fname(bundle_file))