Skip to content

Commit

Permalink
updated readme and small modification to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesq34 committed Jan 16, 2018
1 parent 23fa164 commit 52a3882
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ To train a model to classify point clouds sampled from ModelNet40 shapes:
cd classification
python train.py

Note that for the XYZ+normal experiments: (1) 5000 points are used and (2) a further random data dropout augmentation is used during training (see commented line after `augment_batch_data` in `train.py` and (3) the model architecture is updated such that the `nsample=128` in the first two set abstraction levels, which is suited for the larger point density in 5000-point samplings.

#### Object Part Segmentation

To train a model to segment object parts for ShapeNet models:
Expand Down
1 change: 1 addition & 0 deletions classification/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def train_one_epoch(sess, ops, train_writer):
end_idx = (batch_idx+1) * BATCH_SIZE
batch_data, batch_label = get_batch(TRAIN_DATASET, train_idxs, start_idx, end_idx)
aug_data = augment_batch_data(batch_data)
#aug_data = provider.random_point_dropout(aug_data)
feed_dict = {ops['pointclouds_pl']: aug_data,
ops['labels_pl']: batch_label,
ops['is_training_pl']: is_training,}
Expand Down
6 changes: 3 additions & 3 deletions utils/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def rotate_point_cloud_with_normal(batch_xyz_normal):
shape_pc = batch_xyz_normal[k,:,0:3]
shape_normal = batch_xyz_normal[k,:,3:6]
batch_xyz_normal[k,:,0:3] = np.dot(shape_pc.reshape((-1, 3)), rotation_matrix)
batch_xyz_normal[k,:,3:6] = np.dot(shape_normal.reshape((-1, 3)), np.linalg.inv(rotation_matrix.T))
batch_xyz_normal[k,:,3:6] = np.dot(shape_normal.reshape((-1, 3)), rotation_matrix)
return batch_xyz_normal

def rotate_perturbation_point_cloud_with_normal(batch_data, angle_sigma=0.06, angle_clip=0.18):
Expand All @@ -82,7 +82,7 @@ def rotate_perturbation_point_cloud_with_normal(batch_data, angle_sigma=0.06, an
shape_pc = batch_data[k,:,0:3]
shape_normal = batch_data[k,:,3:6]
rotated_data[k,:,0:3] = np.dot(shape_pc.reshape((-1, 3)), R)
rotated_data[k,:,3:6] = np.dot(shape_normal.reshape((-1, 3)), np.linalg.inv(R.T))
rotated_data[k,:,3:6] = np.dot(shape_normal.reshape((-1, 3)), R)
return rotated_data


Expand Down Expand Up @@ -123,7 +123,7 @@ def rotate_point_cloud_by_angle_with_normal(batch_data, rotation_angle):
shape_pc = batch_data[k, ...]
shape_normal = batch_data[k,:,3:6]
rotated_data[k, ...] = np.dot(shape_pc.reshape((-1, 3)), rotation_matrix)
rotated_data[k,:,3:6] = np.dot(shape_normal.reshape((-1,3)), np.linalg.inv(rotation_matrix.T))
rotated_data[k,:,3:6] = np.dot(shape_normal.reshape((-1,3)), rotation_matrix)
return rotated_data


Expand Down

0 comments on commit 52a3882

Please sign in to comment.