<jupyter_start><jupyter_text>what happens in 'class Scene3D_SUNRGBD(Scene3D)'<jupyter_code>np.set_printoptions(precision=4)
np.set_printoptions(suppress=True)

from utils.sunrgbd_utils import get_NYU37_class_id, cvt2nyu37class_map, process_layout, get_world_R, transform_to_world,\
    cvt_R_ex_to_cam_R, check_bdb2d, process_bdb3d, process_bdb2d, get_inst_map, normalize_point, get_campact_layout

cam_R = cvt_R_ex_to_cam_R(sequence.R_ex) # transform objects from world system to camera system
# define a world system
world_R = get_world_R(cam_R) # almost identity matrix
print(cam_R)
print(world_R)

layout, layout_t = process_layout(sequence.manhattan_layout) # sequence.manhattan_layout: 8-point bbox; transform sunrgbd layout to toward-up-right form.
centroid = layout['centroid']
vectors = np.diag(layout['coeffs']).dot(layout['basis'])

bdb3ds_ws = process_bdb3d(sequence.bdb3d) # sequence.bdb3d: an array of length: num of objects

# key: transform everything to world system
layout, __bdb3d, __cam_R = transform_to_world(layout, bdb3ds_ws, cam_R, world_R)

fig = plt.figure()
ax = fig.gca(projection='3d')
ax.set_aspect("auto")
vis_axis(ax)

# bdb3d_layout_not_processed = get_corners_of_bb3d_no_index(layout['basis'], layout['coeffs'], layout['centroid'])
bdb3d_layout_not_processed = layout_t
vis_cube_plt(bdb3d_layout_not_processed, ax, 'b')

# comparing against: processed inside the function
bdb3d_layout = get_corners_of_bb3d_no_index(scene.layout['basis'], scene.layout['coeffs'], scene.layout['centroid'])
vis_cube_plt(bdb3d_layout, ax, 'r')

ax.view_init(elev=-66, azim=92)
sequence.manhattan_layout
__cam_R
bdb3ds_ws[0], __bdb3d[0]
cam_R, world_R
bdb3d_layout_not_processed
bdb3d_layout
print(scene.layout['basis'], layout['basis'])
print(scene.layout['coeffs'], layout['coeffs'])
print(scene.layout['centroid'], layout['centroid'])<jupyter_output>[ 1.4495  1.3125 -0.1969] [ 1.4522  1.3125 -0.1761]<jupyter_text>vis from 'scene'<jupyter_code>fig = plt.figure()

ax = fig.gca(projection='3d')
ax.set_aspect("auto")
vis_axis(ax)

# vis_cube_plt(data_frame.manhattan_layout, ax)
bdb3d_layout = get_corners_of_bb3d_no_index(scene.layout['basis'], scene.layout['coeffs'], scene.layout['centroid'])
vis_cube_plt(bdb3d_layout, ax, 'r')
ax.view_init(elev=-66, azim=92)

from utils.sunrgbd_utils import proj_from_point_to_2d

for bdb3d, color in zip(scene.bdb3d, color_list):
    bdb3d_corners = get_corners_of_bb3d_no_index(bdb3d['basis'], bdb3d['coeffs'], bdb3d['centroid']) # bbox y axis is absolute upright
    vis_cube_plt(bdb3d_corners, ax, color=color)
    
for bdb3d, color in zip(bdb3ds_ws, color_list):
    bdb3d_corners = get_corners_of_bb3d_no_index(bdb3d['basis'], bdb3d['coeffs'], bdb3d['centroid']) # bbox y axis is absolute upright
    vis_cube_plt(bdb3d_corners, ax)

fig.canvas.toolbar_visible = True

# display(fig)
sequence.bdb3d[0]
bdb3ds_ws
scene.layout
center_from_3D
data_frame.bdb3d[1]
# # draw sphere
# u, v = np.mgrid[0:2*np.pi:20j, 0:np.pi:10j]
# x = np.cos(u)*np.sin(v)
# y = np.sin(u)*np.sin(v)
# z = np.cos(v)
# ax.plot_wireframe(x, y, z, color="r")

# # draw a point
# ax.scatter([0], [0], [0], color="g", s=100)

# # draw a vector
# from matplotlib.patches import FancyArrowPatch
# from mpl_toolkits.mplot3d import proj3d


# class Arrow3D(FancyArrowPatch):

#     def __init__(self, xs, ys, zs, *args, **kwargs):
#         FancyArrowPatch.__init__(self, (0, 0), (0, 0), *args, **kwargs)
#         self._verts3d = xs, ys, zs

#     def draw(self, renderer):
#         xs3d, ys3d, zs3d = self._verts3d
#         xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
#         self.set_positions((xs[0], ys[0]), (xs[1], ys[1]))
#         FancyArrowPatch.draw(self, renderer)

# a = Arrow3D([0, 1], [0, 1], [0, 1], mutation_scale=20,
#             lw=1, arrowstyle="-|>", color="k")
# ax.add_artist(a)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14396085500901365, 'fraction_numerical': 0.036054596961112545, 'mean_word_length': 6.205936920222634, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '483342', 'license': 'MIT', 'n_tokens_mistral': 1703, 'n_tokens_neox': 1634, 'n_words': 285, 'path': 'inspect_vis_gt.ipynb', 'repo_name': 'Jerrypiglet/Total3DUnderstanding', 'size': '3883'}