Git Product home page Git Product logo

pytorch3dpointnet's Introduction

Hi there ๐Ÿ‘‹

pytorch3dpointnet's People

Contributors

samgalanakis avatar

Watchers

 avatar

pytorch3dpointnet's Issues

Question regarding pytorch3d and pointclouds

Hi @SamGalanakis,

I recently found your current test project where you are trying to use pytorch3d for implementing Pointnet. Thus, I would like to ask you a couple of questions if you know and possibly you are familiar with the pytorch3d Pointclouds class.

I would like to use pytorch3d with the Pointclouds class for solving based on one of their inserted features. Something like that:

    verts = [torch.Tensor(p).to(device) for p in pcds]

    illum = [torch.Tensor(x).to(device) for x in lx]

    trg_point_clouds = Pointclouds(points=verts, features=illum)

    src_point_clouds = Pointclouds(points=verts)

    # We want to learn to estimate the source point cloud vertices energy
    # The shape of the estimated energy values is equal to the total number of vertices in trg_mesh
    _illum = torch.full(trg_point_clouds.features_packed().shape, 0.0, device=device, requires_grad=True)

    # The optimizer
    optimizer = torch.optim.SGD([_illum], lr=1.0, momentum=0.9)

    n_iter = 2000
    epoch = tqdm(range(n_iter))

    loss_f = torch.nn.L1Loss()
    losses = []

    for i in epoch:
        # Initialize optimizer
        optimizer.zero_grad()

        # Update of features
        src_point_clouds.features_packed = _illum

        # We compare the two sets of pointclouds by computing the L1 loss
        loss = loss_f(trg_point_clouds, src_point_clouds)

        # Print the losses
        epoch.set_description('total_loss = %.6f' % loss)

        # Save the losses for plotting
        losses.append(loss)

        # Optimization step
        loss.backward()
        optimizer.step()

where pcds are my point clouds (Nx3 points) and lx the corresponding gt features (it is just an array Nx1) for which I want to optimize. The above doesn't really work and I am trying to figure out how to modify it.

In case, thank you for your time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.