コード例 #1
0
    def __init__(self, config):
        Module.__init__(self, config)

        # Clean up example scene or scene created by last run when debugging pipeline inside blender
        Initializer.cleanup()

        # setting up the GlobalStorage
        global_config = Config(self.config.get_raw_dict("global", {}))
        GlobalStorage.init_global(global_config)

        # call the init again to make sure all values from the global config where read correctly, too
        self._default_init()
コード例 #2
0
 def run(self):
     horizon_color = self.config.get_list("horizon_color",
                                          [0.05, 0.05, 0.05])
     compute_device = self.config.get_string("compute_device", "GPU")
     compute_device_type = self.config.get_string("compute_device_type",
                                                  None)
     use_experimental_features = self.config.get_bool(
         "use_experimental_features", False)
     Initializer.init(horizon_color,
                      compute_device,
                      compute_device_type,
                      use_experimental_features,
                      clean_up_scene=False)
コード例 #3
0
from src.utility.RendererUtility import RendererUtility
import numpy as np

import argparse
import os

parser = argparse.ArgumentParser()
parser.add_argument(
    'house', help="Path to the house.json file of the SUNCG scene to load")
parser.add_argument('output_dir',
                    nargs='?',
                    default="examples/datasets/suncg_with_cam_sampling/output",
                    help="Path to where the final files, will be saved")
args = parser.parse_args()

Initializer.init()

# load the objects into the scene
label_mapping = LabelIdMapping.from_csv(
    Utility.resolve_path(
        os.path.join('resources', 'id_mappings', 'nyu_idset.csv')))
objs = SuncgLoader.load(args.house, label_mapping)

# makes Suncg objects emit light
SuncgLighting.light()

# Init sampler for sampling locations inside the loaded suncg house
point_sampler = SuncgPointInRoomSampler(objs)
# Init bvh tree containing all mesh objects
bvh_tree = MeshObject.create_bvh_tree_multi_objects(
    [o for o in objs if isinstance(o, MeshObject)])