Hello,
When I want to get groundtruth information and generate 2D Bounding Boxes with the “get_bounding_box_2d_tight” function inside the SyntheticDataHelper class it seems that with each iteration it uses more instanceIDs to set the bounding box. I will attach a screenshot that you see what I mean. I guess it has something to do with the instance mappings?
First iteration:
50th iteration:
def cam_place(self):
#Kameras platzieren
prim_path="/World/Cameras"
pos = np.array([0,0,1.6])
ori = np.array([1,0,0,0])
create_prim(prim_path=prim_path, prim_type="Xform", translation=pos, orientation=ori)
self._sensors = [
"rgb",
"depthLinear",
"boundingBox2DTight",
"boundingBox2DLoose",
"instanceSegmentation",
"semanticSegmentation",
"camera",
"pose",
]
pos_off_rgb = np.asarray([0,0,0])
prim_path = "/World/Cameras/RGB_Cam"
self.camera_paths.append(prim_path)
dict ={
'prim_path': prim_path,
'prim_type': 'Camera',
'position':pos+pos_off_rgb,
'orientation':ori,
}
create_prim(**dict)
self.sensor_settings=None
self.sensor_settings = dict.fromkeys(self.output_names)
for i in range(0,len(self.camera_paths)):
do_full_data = (i==0)
self.sensor_settings[self.output_names[i]] = {
"rgb": {"enabled": True},
"depth": {"enabled": do_full_data, "colorize": do_full_data, "npy": do_full_data},
"instance": {"enabled": do_full_data, "colorize": do_full_data, "npy": do_full_data},
"semantic": {"enabled": do_full_data, "colorize": do_full_data, "npy": do_full_data},
"bbox_2d_tight": {"enabled": do_full_data, "colorize": do_full_data, "npy": do_full_data},
"bbox_2d_loose": {"enabled": do_full_data, "colorize": do_full_data, "npy": do_full_data},
"camera": {"enabled": do_full_data, "npy": do_full_data},
"poses": {"enabled": do_full_data, "npy": do_full_data},
}
self._viewport_window.viewport_api.set_texture_resolution((1920,1200))
self.set_box_view(self.camera_paths[0])
self.init_sensor()
if self.data_writer is None:
self.data_dir = self.base_path+"output/"
self.data_writer = NumpyWriter(
self.data_dir,
4,
100,
self.sensor_settings
)
self.data_writer.start_threads()
self.get_groundtruth()
def get_groundtruth(self):
#self._viewport_window.get_drawable_hdr_resource()
gt = self._sd_helper.get_groundtruth(
self._sensors,
self._viewport_window.viewport_api,
verify_sensor_init=False,
)
return copy.deepcopy(gt)
for i in range(100):
app.update()
gt = self.get_groundtruth()
# 2D Tight BBox
if gt["state"]["boundingBox2DTight"]:
groundtruth["DATA"]["BBOX2DTIGHT"] = gt["boundingBox2DTight"]
groundtruth["METADATA"]["BBOX2DTIGHT"]["COLORIZE"] = True
groundtruth["METADATA"]["BBOX2DTIGHT"]["NPY"] = True
I printed the object mappings using the helpers lib and :
from omni.syntheticdata import helpers
self.generic_helper_lib = helpers
mappings = self.generic_helper_lib.get_instance_mappings()
print(mappings)
Mappings Iteration 1:
[( 1, '/World/objects/object_0/part', 1, 'ring', list([20]), '')
( 2, '/World/objects/object_1/part', 1, 'ring', list([53]), '')
( 3, '/World/objects/object_2/part', 1, 'ring', list([13]), '')
( 4, '/World/objects/object_3/part', 1, 'ring', list([16]), '')
( 5, '/World/objects/object_4/part', 1, 'ring', list([55]), '')
( 6, '/World/objects/object_5/part', 1, 'ring', list([59]), '')
( 7, '/World/objects/object_6/part', 1, 'ring', list([63]), '')
( 8, '/World/objects/object_7/part', 1, 'ring', list([17]), '')
( 9, '/World/objects/object_8/part', 1, 'ring', list([32]), '')
(10, '/World/objects/object_9/part', 1, 'ring', list([37]), '')
(11, '/World/objects/object_10/part', 1, 'ring', list([46]), '')
(12, '/World/objects/object_11/part', 1, 'ring', list([2]), '')
(13, '/World/objects/object_12/part', 1, 'ring', list([67]), '')
(14, '/World/objects/object_13/part', 1, 'ring', list([52]), '')
(15, '/World/objects/object_14/part', 1, 'ring', list([3]), '')
(16, '/World/objects/object_15/part', 1, 'ring', list([60]), '')
(17, '/World/objects/object_16/part', 1, 'ring', list([33]), '')
(18, '/World/objects/object_17/part', 1, 'ring', list([15]), '')
(19, '/World/objects/object_18/part', 1, 'ring', list([24]), '')
(20, '/World/objects/object_19/part', 1, 'ring', list([8]), '')
(21, '/World/objects/object_20/part', 1, 'ring', list([51]), '')
(22, '/World/objects/object_21/part', 1, 'ring', list([57]), '')
(23, '/World/objects/object_22/part', 1, 'ring', list([6]), '')
(24, '/World/objects/object_23/part', 1, 'ring', list([56]), '')
(25, '/World/objects/object_24/part', 1, 'ring', list([1]), '')
(26, '/World/objects/object_25/part', 1, 'ring', list([10]), '')
(27, '/World/objects/object_26/part', 1, 'ring', list([50]), '')
(28, '/World/objects/object_27/part', 1, 'ring', list([19]), '')
(29, '/World/objects/object_28/part', 1, 'ring', list([48]), '')
(30, '/World/objects/object_29/part', 1, 'ring', list([7]), '')]
Mappings Iteration 5
[( 1, '/World/objects/object_0/part', 1, 'ring', list([28, 20, 7, 65, 19, 45]), '')
( 2, '/World/objects/object_1/part', 1, 'ring', list([5, 53, 57, 22, 59, 47]), '')
( 3, '/World/objects/object_2/part', 1, 'ring', list([13, 65, 34, 10, 23, 8]), '')
( 4, '/World/objects/object_3/part', 1, 'ring', list([16, 4, 46, 66, 33]), '')
( 5, '/World/objects/object_4/part', 1, 'ring', list([55, 12, 67, 59, 5, 61]), '')
( 6, '/World/objects/object_5/part', 1, 'ring', list([27, 59, 8, 34, 44, 21]), '')
( 7, '/World/objects/object_6/part', 1, 'ring', list([63, 43, 11, 24, 32, 36]), '')
( 8, '/World/objects/object_7/part', 1, 'ring', list([25, 17, 54, 56, 26, 60]), '')
( 9, '/World/objects/object_8/part', 1, 'ring', list([32, 53, 61, 25, 46, 28]), '')
(10, '/World/objects/object_9/part', 1, 'ring', list([37, 66, 57, 17, 4, 62]), '')
(11, '/World/objects/object_10/part', 1, 'ring', list([14, 46, 42, 18, 1, 56]), '')
(12, '/World/objects/object_11/part', 1, 'ring', list([2, 30, 37, 43, 4]), '')
(13, '/World/objects/object_12/part', 1, 'ring', list([3, 67, 25, 64, 55, 36]), '')
(14, '/World/objects/object_13/part', 1, 'ring', list([52, 50, 58, 29, 7]), '')
(15, '/World/objects/object_14/part', 1, 'ring', list([19, 3, 14, 52, 28, 64]), '')
(16, '/World/objects/object_15/part', 1, 'ring', list([60, 45, 21, 41, 33, 6]), '')
(17, '/World/objects/object_16/part', 1, 'ring', list([33, 29, 27, 35, 15]), '')
(18, '/World/objects/object_17/part', 1, 'ring', list([55, 15, 64, 62, 2, 12]), '')
(19, '/World/objects/object_18/part', 1, 'ring', list([32, 24, 26, 42, 11, 67]), '')
(20, '/World/objects/object_19/part', 1, 'ring', list([8, 18, 58, 34, 6, 53]), '')
(21, '/World/objects/object_20/part', 1, 'ring', list([27, 51, 40, 44, 42, 1]), '')
(22, '/World/objects/object_21/part', 1, 'ring', list([9, 41, 57, 63, 23, 20]), '')
(23, '/World/objects/object_22/part', 1, 'ring', list([6, 13, 45, 12, 40, 48]), '')
(24, '/World/objects/object_23/part', 1, 'ring', list([40, 56, 41, 15, 51, 30]), '')
(25, '/World/objects/object_24/part', 1, 'ring', list([1, 36, 51, 54, 50]), '')
(26, '/World/objects/object_25/part', 1, 'ring', list([2, 10, 11, 43, 17, 9]), '')
(27, '/World/objects/object_26/part', 1, 'ring', list([50, 14, 22, 52, 63, 31]), '')
(28, '/World/objects/object_27/part', 1, 'ring', list([35, 19, 23, 47, 24, 21]), '')
(29, '/World/objects/object_28/part', 1, 'ring', list([48, 26, 47, 61, 13]), '')
(30, '/World/objects/object_29/part', 1, 'ring', list([31, 7, 9, 16, 30, 3]), '')]
So for the first iteration it all works perfect and the bounding boxes are alright, but the longer the script runs in iterations, the bigger the bounding boxes get and the more objects are inside one bounding box. Is there a possibility to wipe the instance mappings clean after each run, or any other possibility?
Thank you!