Model

In our system, the CAD model of each object in the scene can be easily replaced by user. The category of object remains the same for reasonable result. Since the mesh is the core asset of the database, we only explore its index in the database and do not allow users to access the raw data.

Domain randomization - Model sampler

MINERVAS provides replace_model method, which will provides following functionality:

The input the id of an Instance object and randomly replace the model of this object with a new model with the same semantic.

Function parameters

First nameRequired or notTypeDescription
idYesStringIdentifies the instance to be replaced

Example

Now, we show a DSL code which randomly replace the model of sofa and table.

class MeshSampler(EntityProcessor):
    def process(self):
        for instance in self.shader.world.instances:
            # table category_id: 1032
            # sofa category_id: 1068 
            if instance.type == 'ASSET' and instance.label in [1032, 1068]:
                self.shader.world.replace_model(id=instance.id)

mesh_sampler