def run(self):
        """ Extracts floors in the following steps:
        1. Searchs for the specified object.
        2. Splits the surfaces which point upwards at a specified level away.
        """

        mesh_objects = []
        for obj in self.config.get_list("selector"):
            if obj.type != "MESH":
                warnings.warn(
                    "The object: {} is not a mesh but was selected in the FloorExtractor!"
                    .format(obj.name))
                continue
            mesh_objects.append(MeshObject(obj))

        floors = extract_floor(
            mesh_objects=mesh_objects,
            compare_angle_degrees=radians(
                self.config.get_float('compare_angle_degrees', 7.5)),
            compare_height=self.config.get_float('compare_height', 0.15),
            new_name_for_object=self.config.get_string("name_for_split_obj",
                                                       "Floor"),
            should_skip_if_object_is_already_there=self.config.get_bool(
                "should_skip_if_object_is_already_there", False))

        add_properties = self.config.get_raw_dict("add_properties", {})
        if add_properties:
            config = Config({"add_properties": add_properties})
            loader_interface = LoaderInterface(config)
            loader_interface._set_properties(floors)
 def __init__(self, config):
     LoaderInterface.__init__(self, config)
     self.house_path = resolve_path(self.config.get_string("path"))
     suncg_folder_path = os.path.join(os.path.dirname(self.house_path),
                                      "../..")
     self.suncg_dir = self.config.get_string("suncg_path",
                                             suncg_folder_path)
Example #3
0
    def __init__(self, config: Config):
        LoaderInterface.__init__(self, config)

        self.mapping_file = resolve_path(
            self.config.get_string(
                "mapping_file",
                resolve_resource(
                    os.path.join("front_3D", "3D_front_mapping.csv"))))
        if not os.path.exists(self.mapping_file):
            raise Exception("The mapping file could not be found: {}".format(
                self.mapping_file))
Example #4
0
    def __init__(self, config):
        LoaderInterface.__init__(self, config)

        self._data_dir = resolve_path(
            self.config.get_string("data_dir", resolve_resource("IKEA")))

        if self.config.has_param("category"):
            self._obj_categories = self.config.get_raw_value("category", None)
        else:
            self._obj_categories = None

        self._obj_style = self.config.get_raw_value("style", None)
Example #5
0
    def __init__(self, config):
        LoaderInterface.__init__(self, config)

        self._file_path = resolve_path(self.config.get_string("file_path"))

        self._texture_folder = resolve_path(
            self.config.get_string("texture_folder"))

        # the default unknown texture folder is not included inside of the scenenet texture folder
        default_unknown_texture_folder = os.path.join(self._texture_folder,
                                                      "unknown")
        # the textures in this folder are used, if the object has no available texture
        self._unknown_texture_folder = resolve_path(
            self.config.get_string("unknown_texture_folder",
                                   default_unknown_texture_folder))
 def __init__(self, config):
     LoaderInterface.__init__(self, config)
     self._data_path = resolve_path(
         self.config.get_string("data_path", resolve_resource("AMASS")))
     # Body Model Specs
     self._used_body_model_gender = self.config.get_string(
         "body_model_gender", random.choice(["male", "female", "neutral"]))
     # These numbers are based on a recommendation from the authors. refer to visualization tutorial from the
     # authors: https://github.com/nghorbani/amass/blob/master/notebooks/01-AMASS_Visualization.ipynb
     self._num_betas = 10  # number of body parameters
     self._num_dmpls = 8  # number of DMPL parameters
     # Pose Specs
     self._used_sub_dataset_id = self.config.get_string("sub_dataset_id")
     self._used_subject_id = self.config.get_string("subject_id", "")
     self._used_sequence_id = self.config.get_int("sequence_id", -1)
     self._used_frame_id = self.config.get_int("frame_id", -1)
 def __init__(self, config):
     LoaderInterface.__init__(self, config)
 def __init__(self, config):
     LoaderInterface.__init__(self, config)
     # set a RE-specific material name pattern to look for in the selected objects
     self.target_material = "re_ground_mat.*"