Skip to content

Minimalist implementation of PointNet in Pytorch for 3D classification.

Notifications You must be signed in to change notification settings

dranaivo/pointnet-classification

Repository files navigation

PointNet for classification

A very simple implementation of PointNet for point cloud classification. It is based on the repository Open3D-PointNet by open3d and the course LEARN DEEP POINT CLOUDS: Introduction to 3D Deep Learning by thinkautonomous.

Setup

# Install open3d
pip install open3d==0.12.0

# Install pytorch 1.7.0 
# Can be cpu or cuda

Dataset

It's the ShapeNetCore. It contains 3D models (point cloud), along with their corresponding class category (classification) and point annotation (part segmenation).

To download the dataset, execute:

$> sh download_dataset.sh

The structure of the dataset is as follows :

├── 02691156
│   ├── points
│   ├── points_label
│   └── seg_img
├── 02773838
│   ├── points
│   ├── points_label
│   └── seg_img
├── ...

Scripts

  • Training: For a (straightforward) training with default parameters, just launch python train_classification.py <PATH_TO_SHAPENETCORE>. Execute python train_classification.py --help to list all arguments.

  • Predict and visualize: Again, execute python predict.py --help to list all arguments. You will visualize :

    • A bar plot representing the probability of each class :
    • The colored point cloud :

Experiments

I trained a pointnet model using the configuration bellow :

# optimizer = optim.SGD(classifier.parameters(), lr=0.01, momentum=0.9)
python train_classification.py \
    --batch_size=8
    --num_workers=2
    --epochs=40

Learning curves

Blue is train, Red is test.

  • Accuracy :

The model achieves an accuracy of 98%, and overfit after 22 epochs.

  • Loss :

About

Minimalist implementation of PointNet in Pytorch for 3D classification.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published