Skip to content

Commit

Permalink
Merge branch 'pytorch-1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
fxia22 committed Mar 6, 2019
2 parents 2ec315f + fab247e commit b36cc4e
Show file tree
Hide file tree
Showing 22 changed files with 957 additions and 585 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ shapenetcore_partanno_segmentation_benchmark_v0/
.idea*
cls/
seg/
*.egg-info/
53 changes: 47 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,66 @@
# PointNet.pytorch
This repo is implementation for PointNet(https://arxiv.org/abs/1612.00593) in pytorch. The model is in `pointnet.py`.
This repo is implementation for PointNet(https://arxiv.org/abs/1612.00593) in pytorch. The model is in `pointnet/model.py`.

It is tested with pytorch-1.0.

# Download data and running

```
git clone https://github.com/fxia22/pointnet.pytorch
cd pointnet.pytorch
pip install -e .
```

Download and build visualization tool
```
cd script
bash build.sh #build C++ code for visualization
bash download.sh #download dataset
python train_classification.py #train 3D model classification
python python train_segmentation.py # train 3D model segmentaion
```

python show_seg.py --model seg/seg_model_20.pth # show segmentation results
Training
```
cd utils
python train_classification.py --dataset <dataset path> --nepoch=<number epochs> --dataset_type <modelnet40 | shapenet>
python train_segmentation.py --dataset <dataset path> --nepoch=<number epochs>
```

Use `--feature_transform` to use feature transform.

# Performance
Without heavy tuning, PointNet can achieve 80-90% performance in classification and segmentaion on this [dataset](http://web.stanford.edu/~ericyi/project_page/part_annotation/index.html).

## Classification performance

On ModelNet40:

| | Overall Acc |
| :---: | :---: |
| Original implementation | 89.2 |
| this implementation(w/o feature transform) | 86.4 |
| this implementation(w/ feature transform) | 86.8 |

On [A subset of shapenet](http://web.stanford.edu/~ericyi/project_page/part_annotation/index.html)

| | Overall Acc |
| :---: | :---: |
| Original implementation | N/A |
| this implementation(w/o feature transform) | 98.1 |
| this implementation(w/ feature transform) | 96.8 |

## Segmentation performance

Segmentation on [A subset of shapenet](http://web.stanford.edu/~ericyi/project_page/part_annotation/index.html).

| Class(mIOU) | Airplane | Bag| Cap|Car|Chair|Earphone|Guitar|Knife|Lamp|Laptop|Motorbike|Mug|Pistol|Rocket|Skateboard|Table
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| Original implementation | 83.4 | 78.7 | 82.5| 74.9 |89.6| 73.0| 91.5| 85.9| 80.8| 95.3| 65.2| 93.0| 81.2| 57.9| 72.8| 80.6|
| this implementation(w/o feature transform) | 73.5 | 71.3 | 64.3 | 61.1 | 87.2 | 69.5 | 86.1|81.6| 77.4|92.7|41.3|86.5|78.2|41.2|61.0|81.1|

Note that this implementation trains each class separately, so classes with fewer data will have slightly lower performance than reference implementation.

Sample segmentation result:
![seg](https://raw.githubusercontent.com/fxia22/pointnet.pytorch/master/misc/show3d.png?token=AE638Oy51TL2HDCaeCF273X_-Bsy6-E2ks5Y_BUzwA%3D%3D)


# Links

- [Project Page](http://stanford.edu/~rqi/pointnet/)
Expand Down
1 change: 0 additions & 1 deletion build.sh

This file was deleted.

102 changes: 0 additions & 102 deletions datasets.py

This file was deleted.

40 changes: 40 additions & 0 deletions misc/modelnet_id.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
airplane 0
bathtub 1
bed 2
bench 3
bookshelf 4
bottle 5
bowl 6
car 7
chair 8
cone 9
cup 10
curtain 11
desk 12
door 13
dresser 14
flower_pot 15
glass_box 16
guitar 17
keyboard 18
lamp 19
laptop 20
mantel 21
monitor 22
night_stand 23
person 24
piano 25
plant 26
radio 27
range_hood 28
sink 29
sofa 30
stairs 31
stool 32
table 33
tent 34
toilet 35
tv_stand 36
vase 37
wardrobe 38
xbox 39
16 changes: 16 additions & 0 deletions misc/num_seg_classes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Airplane 4
Bag 2
Cap 2
Car 4
Chair 4
Earphone 3
Guitar 3
Knife 2
Lamp 4
Laptop 2
Motorbike 6
Mug 2
Pistol 3
Rocket 3
Skateboard 3
Table 3
Empty file added pointnet/__init__.py
Empty file.
Loading

0 comments on commit b36cc4e

Please sign in to comment.