Skip to content

Commit

Permalink
[Fix] Fix SUN RGB-D generation (#1120)
Browse files Browse the repository at this point in the history
  • Loading branch information
wHao-Wu committed Dec 22, 2021
1 parent 28d21e2 commit b79f9e6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/data_converter/sunrgbd_data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ def __init__(self, line):
self.ymax = data[2] + data[4]
self.box2d = np.array([self.xmin, self.ymin, self.xmax, self.ymax])
self.centroid = np.array([data[5], data[6], data[7]])
# data[9] is x_size (l), data[8] is y_size (w), data[10] is z_size (h)
# in our depth coordinate system,
self.width = data[8]
self.length = data[9]
self.height = data[10]
# data[9] is x_size (length), data[8] is y_size (width), data[10] is
# z_size (height) in our depth coordinate system,
# l corresponds to the size along the x axis
self.size = np.array([data[9], data[8], data[10]]) * 2
self.orientation = np.zeros((3, ))
Expand Down Expand Up @@ -193,7 +196,7 @@ def process_single_scene(sample_idx):
],
axis=0)
annotations['dimensions'] = 2 * np.array([
[obj.l, obj.w, obj.h] for obj in obj_list
[obj.length, obj.width, obj.height] for obj in obj_list
if obj.classname in self.cat2label.keys()
]) # lwh (depth) format
annotations['rotation_y'] = np.array([
Expand Down

0 comments on commit b79f9e6

Please sign in to comment.