GithubHelp home page GithubHelp logo

Training on my own dataset about pointnet HOT 4 CLOSED

charlesq34 avatar charlesq34 commented on August 16, 2024
Training on my own dataset

from pointnet.

Comments (4)

 avatar commented on August 16, 2024 4

Hi @charlesq34,
Thank you for your work. The code is really helpful.
What is the faceid field I see in the .h5 file? I have attached an image for your reference. I'm using a program called vitables to view the .h5 file.

screenshot from 2018-02-14 15-45-56

I understand that label value at location (0,0) is the label for data at the same location and the normal value corresponds to the value returned from LIDAR(as I understand). I do see these fields being added to the .h5 file in the data_prep_util.py file but I don't see the faceid field there

Also if I pass my data to the helper function provided in the data_prep_util.py file, the generated .h5 file can be used for training right?

from pointnet.

charlesq34 avatar charlesq34 commented on August 16, 2024 3

Hi @skymaze

You can set a MAX number of points during training, if there are less than MAX points, just replicate existing points should be fine -- since we use max that will not alter final result. If there are more than MAX, you can randomly subsample the points.

during test you can have a smaller batch size and even larger MAX to evaluate all points :)
or if there are too many you can compute result in two steps -- by firstly extracting point embedding and then aggregate.

Hope it helps!

Best,
Charles

from pointnet.

EndingCredits avatar EndingCredits commented on August 16, 2024

When batching presumably you need to mask the batch before pooling to ensure the extra missing points are not included?

I did something like this:

# Turns the input list into a single tensor, padding the outputs.
# Produces a mask of size batch_size x max_list_len x 1
def batchToArrays(input_list):
    max_len = 0
    out = []; seq_len = []; masks = []
    for i in input_list: max_len = max(len(i),max_len)
    for l in input_list:
        # Zero pad output
        out.append(np.pad(np.array(l,dtype=np.float32), ((0,max_len-len(l)),(0,0)), mode='constant'))
        # Create mask... (max_len x 1 vector with len(l) ones and rest zeros)
        # Extra dimension is left in for easy broadcasting
        masks.append(np.pad(np.array(np.ones((len(l),1)),dtype=np.float32), ((0,max_len-len(l)),(0,0)), mode='constant') )
return out, masks

and then:

def mask_and_pool(elems, mask, pool_type='max_pool'):
    # Use broadcasting to multiply
    masked_elems = tf.multiply(elems, mask)
    # Pool using max pooling
    embed = tf.reduce_max(masked_elems, axis=1)
return embed

My batch and num_points are set to None in the placeholder so I don't have to worry about the exact size, just about making sure everything has the same dimensions.

from pointnet.

charlesq34 avatar charlesq34 commented on August 16, 2024

Hi @EndingCredits

If that's max pooling then it won't matter in fact. Replicating points will not alter max pooled result.
If it's average pooling then you do need to add a mask.

from pointnet.

Related Issues (20)

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.