blenderproc.python.loader.SceneNetLoader module

Loading the scene net loader.

class blenderproc.python.loader.SceneNetLoader._SceneNetLoader[source]

Bases: object

static random_sample_materials_for_each_obj(loaded_objects, texture_folder, unknown_texture_folder)[source]

Random sample materials for each of the loaded objects

Based on the name the textures from the texture_folder will be selected

Parameters:
  • loaded_objects (List[MeshObject]) – objects loaded from the .obj file

  • texture_folder (str) – The path to the texture folder used to sample the textures.

  • unknown_texture_folder (str) – The path to the textures, which are used if the the texture type is unknown.

static set_category_ids(loaded_objects, label_mapping)[source]

Set the category ids for the objs based on the .csv file loaded in LabelIdMapping

Each object will have a custom property with a label, can be used by the SegMapRenderer.

Parameters:
  • loaded_objects (List[MeshObject]) – objects loaded from the .obj file

  • label_mapping (LabelIdMapping) – A dict which maps the names of the objects to ids.

blenderproc.python.loader.SceneNetLoader.load_scenenet(file_path, texture_folder, label_mapping, unknown_texture_folder=None)[source]

Loads all SceneNet objects at the given “file_path”.

The textures for each object are sampled based on the name of the object, if the name is not represented in the texture folder the unknown folder is used. This folder does not exist, after downloading the texture dataset. Make sure to create and put some textures, you want to use for these instances there.

All objects get “category_id” set based on the data in the “resources/id_mappings/nyu_idset.csv”

Each object will have the custom property “is_scene_net_obj”.

Parameters:
  • file_path (str) – The path to the .obj file from SceneNet.

  • label_mapping (LabelIdMapping) – A dict which maps the names of the objects to ids.

  • texture_folder (str) – The path to the texture folder used to sample the textures.

  • unknown_texture_folder (Optional[str]) – The path to the textures, which are used if the texture type is unknown. The default path does not exist if the dataset was just downloaded, it has to be created manually.

Return type:

List[MeshObject]

Returns:

The list of loaded mesh objects.