How can I directly save images (rgb, depth, seg etc.) as the output of BlenderProc rather than HDF file which will involve some post processing to extract images from the HDF file?
We chose the hdf5 file as our standard output format as it has some advantage over the single output files. If you still want to save the images directly, you need to write a SingleImageWriter that copies the images from /dev/shm. You could use this as a starting point:
https://github.com/DLR-RM/BlenderProc/blob/master/src/writer/CocoAnnotationsWriter.py
Actually, you do not even need to write an extra module here. If you set the config parameter output_is_temp to false then all intermediate results will be written to the output directory. You can then just leave away the HDF5 writer (see also here: https://github.com/DLR-RM/BlenderProc/issues/23#issuecomment-632617258)
You can set output_is_temp to False inside main.Initializer
{
"module": "main.Initializer",
"config":{
"global": {
# "output_is_temp": False, #By default True, which will not store training images
"output_dir": "
}
}
},
Or,
Use CocoAnnotationsWriter: You will get a image with coco annotation.
{
"module": "writer.CocoAnnotationsWriter",
"config": {
"mask_encoding_format": "polygon",
"append_to_existing_output": True # you can append new data to existing one.
}
}
Most helpful comment
Actually, you do not even need to write an extra module here. If you set the config parameter
output_is_temptofalsethen all intermediate results will be written to the output directory. You can then just leave away the HDF5 writer (see also here: https://github.com/DLR-RM/BlenderProc/issues/23#issuecomment-632617258)