This example shows how to synthetically recreate BOP scenes.
First make sure that you have downloaded a BOP dataset in the original folder structure. Also please clone the BOP toolkit.
In examples/bop_scene_replication/config.yaml add the path to your bop_toolkit clone to sys_paths
and set the blender_install_path
where Blender should be installed.
Execute in the BlenderProc main directory:
python run.py examples/bop_scene_replication/config.yaml <path_to_bop_data> examples/bop_replication/output
examples/bop_replication/config.yaml
: path to the pipeline configuration file.<path_to_bop_data>
: path to a BOP datasetexamples/bop_sampling/output
: path to the output directory.
Visualize the generated data and labels:
python scripts/visHdf5Files.py example/bop_replication/0.hdf5
- Loads BOP scene with object models, object poses, camera poses and camera intrinsics:
loader.BopLoader
module. - Creates a point light sampled inside a shell:
lighting.LightSampler
module. - Renders rgb:
renderer.RgbRenderer
module. - Renders instance segmentation masks:
renderer.SegMapRenderer
module. - Writes labels and images to compressed hdf5 files in output_dir:
writer.Hdf5Writer
module.
{
"name": "loader.BopLoader",
"config": {
"bop_dataset_path": "<args:0>",
"mm2m": True,
"split": "val",
"scene_id": 3,
"model_type": ""
}
},
If scene_id
is specified, BopLoader recreates the specified scene of the BOP dataset specified by bop_dataset_path
. All camera poses and intrinsics from the specified scene are also loaded.
Be careful to choose a split
that is actually present in the given BOP dataset and that has ground truth.
For some BOP datasets you can choose the model_type
, e.g. reconst
or cad
in T-LESS.
- bop_sampling: More on sampling objects, cameras and lights.