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

Model modifications #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kwea123
Copy link

@kwea123 kwea123 commented Aug 23, 2018

Several changes :

  1. Modify the models (both v1 and v2) so that they can take arbitrary batch size.
    Currently the batch size is fixed once you create the model, which is not practical when the number of objects varies across different frames. I modified the code so that it can infer the batch size from the tensors' shape automatically, i.e. arbitrary batch size is possible. To use this feature, simply set batch_size=None.

  2. Delete the duplicated +size_residuals at line 109 in file model_util.py as suggested in Size residuals added twice when calculating corners #43. This change requires the model to be retrained..

  3. Add object_point_cloud_xyz and mask_xyz_mean to end_points in both v1 and v2, to allow 3d box regression directly from extracted points. That is, suppose we already know that some points belong to an object (for example a car), we can directly regress a 3d box from these points, without passing by the segmentation part.
    Example usage (similar as in test.py):

feed_dict = {ep['object_point_cloud_xyz']: car_points_center_view, # the points belonging to a car, subtracted by its centroid, in center view in frustum
             ep['mask_xyz_mean']: car_centroid, # the centroid in center view in frustum
             ops['one_hot_vec_pl']: one_hot_vec,
             ops['is_training_pl']: False}

batch_centers, batch_heading_scores, batch_heading_residuals, \
batch_size_scores, batch_size_residuals = \
sess.run([ops['center'], ep['heading_scores'], ep['heading_residuals'],
          ep['size_scores'], ep['size_residuals']],
                feed_dict=feed_dict)

@kwea123
Copy link
Author

kwea123 commented Aug 31, 2018

Then I just realized, in get_3d_box_estimation_v2_net, aren't you just using the first 3 channels (xyz) to regress? In the paper, page 11 where you draw the models, it says 4 channels are used to regress the box. Why is there this discrepancy? Shouldn't the xyz_only in point_cloud_masking
be defaulted to False? Then some modification is needed in frustum pointnets models...

09/03 added: It seems that either xyz_only=True or False doesn't make much difference...

@gujiaqivadin
Copy link

Hello,kwea123!
Thanks for your code modification of arbitrary batch size for Frustum PointNet. I change the code as your commit in modev1/v2.py and model/pointnet_util.py, and try to run batch_size=None, but I found that in train.py, there is still some code related to BATCH_SIZE, like line106in train or line222 in train_one_epoch. So train.py also needs to be changed somewhere, can you share your changes to us?
Very appreciate for your code.

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

Successfully merging this pull request may close these issues.

2 participants