Skip to content

Commit

Permalink
chore(README): update READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
ideas-man committed Jul 20, 2020
1 parent cde8f47 commit 12f7a63
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 71 deletions.
15 changes: 9 additions & 6 deletions examples/bop_object_on_surface_sampling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ To aggregate data and labels over multiple scenes, simply run the script multipl
* Set custom properties for those planes: `manipulators.EntityManipulator` module.
* Switch to an light emission shader for the top plane: `materials.MaterialManipulator` module.
* Load CCTexture materials: `loader.CCMaterialLoader` module.
* Sample a material for the other planes: `materials.MaterialRandomizer` module.
* Sample a material for the other planes: `manupulators.EntityManipulator` module.
* Sample upright objects poses on surface: `object.OnSurfaceSampler` module.
* Sample point light source: `lighting.LightSampler` module.
* Sample camera poses: `camera.CameraSampler` module.
Expand Down Expand Up @@ -274,24 +274,27 @@ To aggregate data and labels over multiple scenes, simply run the script multipl

* Load a random CC0Texture that was downloaded from https://cc0textures.com/

### Material Randomizer
### Entity Manipulator
```yaml
{
"module": "materials.MaterialRandomizer",
"module": "manipulators.EntityManipulator",
"config": {
"randomization_level": 1,
"mode": "once_for_all",
"manipulated_objects": {
"selector": {
"provider": "getter.Entity",
"conditions": {
"name": "ground_plane.*"
}
},
"mode": "once_for_all",
"materials_to_replace_with": {
"provider": "getter.Material",
"random_samples": 1,
"conditions": {
"cp_is_cc_texture": True
}
},
"cf_randomize_materials": {
"randomization_level": 1
}
}
},
Expand Down
15 changes: 9 additions & 6 deletions examples/bop_object_physics_positioning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ To aggregate data and labels over multiple scenes, simply run the script multipl
* Set custom properties for those planes: `manipulators.EntityManipulator` module.
* Switch to an light emission shader for the top plane: `materials.MaterialManipulator` module.
* Load CCTexture materials: `loader.CCMaterialLoader` module.
* Sample a material for the other planes: `materials.MaterialRandomizer` module.
* Sample a material for the other planes: `manupulators.EntityManipulator` module.
* Sample objects poses: `object.ObjectPoseSampler` module.
* Perform physics simulation: `object.PhysicsPositioning` module.
* Sample point light source: `lighting.LightSampler` module.
Expand Down Expand Up @@ -277,24 +277,27 @@ To aggregate data and labels over multiple scenes, simply run the script multipl

* Load a random CC0Texture that was downloaded from https://cc0textures.com/

### Material Randomizer
### Entity Manipulator
```yaml
{
"module": "materials.MaterialRandomizer",
"module": "manipulators.EntityManipulator",
"config": {
"randomization_level": 1,
"mode": "once_for_all",
"manipulated_objects": {
"selector": {
"provider": "getter.Entity",
"conditions": {
"name": "ground_plane.*"
}
},
"mode": "once_for_all",
"materials_to_replace_with": {
"provider": "getter.Material",
"random_samples": 1,
"conditions": {
"cp_is_cc_texture": True
}
},
"cf_randomize_materials": {
"randomization_level": 1
}
}
},
Expand Down
80 changes: 43 additions & 37 deletions examples/front_3d_with_improved_mat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ python scripts/visHdf5Files.py examples/front_3d_with_improved_mat/output/0.hdf5
* Sets the category_id of the background to 0: `manipulators.WorldManipulator`
* Adds cameras to the scene: `camera.Front3DCameraSampler`
* Loads the cc Materials: `loader.CCMaterialLoader`
* Several material Randomizers are used to replace the floor, baseboards and walls materials with cc materials: `materials.MaterialRandomizer`
* Several material Randomizers are used to replace the floor, baseboards and walls materials with cc materials: `manupulators.EntityManipulator`
* Renders rgb, normals: `renderer.RgbRenderer` module.
* Renders semantic segmentation: `renderer.SegMapRenderer` module.
* Writes the output to .hdf5 containers: `writer.Hdf5Writer` module, removes unnecessary channels for the `"distance"`
Expand All @@ -64,55 +64,61 @@ The `folder_path` if the script was used, should be `"resources/cctextures"`
This module loads the assets which names contain a string listed in `"used_assets"`.
These will be later used to replace the materials in the 3D-Front scenes.

####
#### Entity Manipulator

```yaml
{
"module": "materials.MaterialRandomizer",
"config": {
"randomization_level": 0.95,
"manipulated_objects": {
"provider": "getter.Entity",
"conditions": {
"name": "Floor.*"
{
"module": "manipulators.EntityManipulator",
"config": {
"selector": {
"provider": "getter.Entity",
"conditions": {
"name": "Floor.*"
}
},
"materials_to_replace_with": {
"provider": "getter.Material",
"random_samples": 1,
"conditions": {
"cp_is_cc_texture": True
}
},
"cf_randomize_materials": {
"randomization_level": 0.95
}
}
},
"materials_to_replace_with": {
"provider": "getter.Material",
"conditions": {
"cp_is_cc_texture": True # this will return all loaded cc textures
}
}
}
}
```

This is one of the `materials.MaterialRandomizer` it swaps the materials of the selected objects, with the materials which are used to replace them.
It will replace 95% of all materials, which are selected via the `getter.Entity`.
This is one of the `manipulators.EntityManipulator` which swaps the materials of the selected objects, with the materials which are used to replace them.
It will replace 95% of all materials of object, which are selected via the `getter.Entity`.
The materials which are used to replace the existing ones all have to be from the CCMaterialLoader, which adds to each loaded material the custom property of `"cp_is_cc_texture"`.

A further example is:

```yaml
{
"module": "materials.MaterialRandomizer",
"config": {
"randomization_level": 0.1,
"manipulated_objects": {
"provider": "getter.Entity",
"conditions": {
"name": "Wall.*"
{
"module": "manipulators.EntityManipulator",
"config": {
"selector": {
"provider": "getter.Entity",
"conditions": {
"name": "Wall.*"
}
},
"materials_to_replace_with": {
"provider": "getter.Material",
"random_samples": 1,
"conditions": {
"cp_is_cc_texture": True,
"cp_asset_name": "Marble.*"
}
},
"cf_randomize_materials": {
"randomization_level": 0.1
}
}
},
"materials_to_replace_with": {
"provider": "getter.Material",
"conditions": {
"cp_is_cc_texture": True, # this will return all loaded cc textures
"cp_asset_name": "Marble.*"
}
}
}
}
```

Here the materials of all walls are replaced, but instead of using all loaded materials only the cc materials, which names start with `"Marble"`.
Expand Down
30 changes: 19 additions & 11 deletions examples/material_randomizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<img src="rendering_switched.png" alt="alt text" width=430>
</div>

In this example we demonstrate how to switch materials
In this example we demonstrate how to switch materials.

## Usage

Expand All @@ -32,27 +32,35 @@ python scripts/visHdf5Files.py examples/material_randomizer/output/*.hdf5
* Loads `scene.obj`: `loader.ObjectLoader` module.
* Creates a point light: `lighting.LightLoader` module.
* Sets two camera positions: `camera.CameraLoader` module.
* Selects materials based in the: `materials.MaterialRandomizer` module.
* Selects materials based in the: `manipulators.EntityManipulator` module.
* Renders rgb: `renderer.RgbRenderer` module.
* Writes the output to .hdf5 containers: `writer.Hdf5Writer` module.

## Config file

### ObjectManipulator
### Entity Manipulator

```yaml
{
"module": "materials.MaterialRandomizer",
"config": {
"randomization_level": 0.5,
}
},
{
"module": "manipulators.EntityManipulator",
"config": {
"selector": {
"provider": "getter.Entity",
"conditions": {
"type": "MESH"
}
},
"cf_randomize_materials": {
"randomization_level": 0.5
}
}
},
```

The focus of this example is the MaterialRandomizer module, which allow us to change the material of the objects randomly.
The focus of this example is the fucntionality of the `manupulators.EntityManipulator` module, which allows us to change the material of the objects randomly.
* Sets the `randomization_level` to 0.5, which means that a material has the change of 0.5 to be replaced with another one.

It is also possible to use selectors to select the group of objects, which materials should be changed and another selector to select the materials, which should be used to replace them.
Select the pool of objects for which we randimize materials with certain probability, and select material substitute. If no `getter.Material` is called, a random material from all of the materials will be used as substitution.

Check [object_manipulation](../object_manipulation) for more information about selectors.

Expand Down
33 changes: 22 additions & 11 deletions examples/scenenet_with_cctextures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,24 +138,35 @@ This module only sets up the materials which can then be used by other modules.
### MaterialRandomizer

```yaml
"module": "materials.MaterialRandomizer",
"config": {
"randomization_level": 0.4,
"materials_to_replace_with": {
"provider": "getter.Material",
"conditions": {
"cp_is_cc_texture": True # this will return all loaded cc textures
}
}
}
{
"module": "manipulators.EntityManipulator",
"config": {
"selector": {
"provider": "getter.Entity",
"conditions": {
"type": "MESH"
}
},
"materials_to_replace_with": {
"provider": "getter.Material",
"random_samples": 1,
"conditions": {
"cp_is_cc_texture": True # this will return one random loaded cc textures
}
},
"cf_randomize_materials": {
"randomization_level": 0.4
}
}
},
```

This builds up on the [material_randomizer](../material_randomizer) example.

We also use the `randomization_level` and set it `0.4`.

Furthermore, we select all the materials, we want to use for the replacing, as there are only SceneNet objects loaded, we do not specify, which objects materials we want to replace.
Each material loaded by CCMaterialLoader set the `is_cc_texture` custom property to true.
Each material loaded by CCMaterialLoader set the `cp_is_cc_texture` custom property to true.

### SceneNetLighting

Expand Down

0 comments on commit 12f7a63

Please sign in to comment.