Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualization of graph neural network #80

Open
abhigoku10 opened this issue Mar 16, 2021 · 1 comment
Open

Visualization of graph neural network #80

abhigoku10 opened this issue Mar 16, 2021 · 1 comment

Comments

@abhigoku10
Copy link

@WeijingShi thanksfor sharing the source code i have a query
1.can we visualize the graph structure of PointGNN
2. how to change the number of layers of the network ie currently i am not sure how layer_configs gives one graphlevel:0 and three graphlevel:1 can you please explain this
Thanks in advance

@WeijingShi
Copy link
Owner

Hi @abhigoku10,

  1. Using Open3D's lineset, we can visualize the graph. It allows you to specify a set of RGB points and lines between them. For example:
def show_graph(src_points, des_points, edges):
    """
    :param src_points: [N, 3] src_points.
    :param des_points: [N, 3] des_points.
    :param edges: [M, 2],M pairs of connections src_points[edges[0]] -> des_points[edges[1]]
    :return: None
    """
    points = np.concatenate([src_points, des_points])
    edges[:, 1] += src_points.shape[0]
    line_set = open3d.LineSet()
    line_set.points = open3d.Vector3dVector(points)
    line_set.lines = open3d.Vector2iVector(edges)

    # add color if wanted
    # line_set.colors = np.zeros((edges.shape[0], 3), dtype=np.float32)
    
    def custom_draw_geometry_load_option(geometry_list):
        vis = open3d.Visualizer()
        vis.create_window()
        for geometry in geometry_list:
            vis.add_geometry(geometry)
        vis.run()
        vis.destroy_window()

    custom_draw_geometry_load_option([line_set])
  1. The first layer work on an input graph (graphlevel0) which is between the input points and the downsampled points. We pool the features from the input points to the downsampled points.
    Next are the GNN iterations. Three iterations all work on the same graph (graph level 1), where the downsampled points are connected to each other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants