learning3d 0.0.2__tar.gz → 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {learning3d-0.0.2/src/learning3d.egg-info → learning3d-0.0.3}/PKG-INFO +1 -1
- {learning3d-0.0.2 → learning3d-0.0.3}/pyproject.toml +1 -1
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/__init__.py +1 -6
- learning3d-0.0.3/src/learning3d/ops/__init__.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/utils/__init__.py +1 -6
- {learning3d-0.0.2 → learning3d-0.0.3/src/learning3d.egg-info}/PKG-INFO +1 -1
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d.egg-info/SOURCES.txt +1 -37
- learning3d-0.0.2/pretrained/exp_prnet/args.txt +0 -35
- learning3d-0.0.2/src/learning3d/__init__.py +0 -2
- learning3d-0.0.2/src/learning3d/examples/test_flownet.py +0 -113
- learning3d-0.0.2/src/learning3d/examples/train_flownet.py +0 -259
- learning3d-0.0.2/src/learning3d/models/flownet3d.py +0 -446
- learning3d-0.0.2/src/learning3d/utils/lib/build/lib.linux-x86_64-3.5/pointnet2_cuda.cpython-35m-x86_64-linux-gnu.so +0 -0
- learning3d-0.0.2/src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/ball_query.o +0 -0
- learning3d-0.0.2/src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/ball_query_gpu.o +0 -0
- learning3d-0.0.2/src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/group_points.o +0 -0
- learning3d-0.0.2/src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/group_points_gpu.o +0 -0
- learning3d-0.0.2/src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/interpolate.o +0 -0
- learning3d-0.0.2/src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/interpolate_gpu.o +0 -0
- learning3d-0.0.2/src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/pointnet2_api.o +0 -0
- learning3d-0.0.2/src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/sampling.o +0 -0
- learning3d-0.0.2/src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/sampling_gpu.o +0 -0
- learning3d-0.0.2/src/learning3d/utils/lib/dist/pointnet2-0.0.0-py3.5-linux-x86_64.egg +0 -0
- learning3d-0.0.2/src/learning3d/utils/lib/pointnet2.egg-info/SOURCES.txt +0 -14
- learning3d-0.0.2/src/learning3d/utils/lib/pointnet2.egg-info/dependency_links.txt +0 -1
- learning3d-0.0.2/src/learning3d/utils/lib/pointnet2.egg-info/top_level.txt +0 -1
- learning3d-0.0.2/src/learning3d/utils/lib/pointnet2_modules.py +0 -160
- learning3d-0.0.2/src/learning3d/utils/lib/pointnet2_utils.py +0 -318
- learning3d-0.0.2/src/learning3d/utils/lib/pytorch_utils.py +0 -236
- learning3d-0.0.2/src/learning3d/utils/lib/setup.py +0 -23
- learning3d-0.0.2/src/learning3d/utils/lib/src/ball_query.cpp +0 -25
- learning3d-0.0.2/src/learning3d/utils/lib/src/ball_query_gpu.cu +0 -67
- learning3d-0.0.2/src/learning3d/utils/lib/src/ball_query_gpu.h +0 -15
- learning3d-0.0.2/src/learning3d/utils/lib/src/cuda_utils.h +0 -15
- learning3d-0.0.2/src/learning3d/utils/lib/src/group_points.cpp +0 -36
- learning3d-0.0.2/src/learning3d/utils/lib/src/group_points_gpu.cu +0 -86
- learning3d-0.0.2/src/learning3d/utils/lib/src/group_points_gpu.h +0 -22
- learning3d-0.0.2/src/learning3d/utils/lib/src/interpolate.cpp +0 -65
- learning3d-0.0.2/src/learning3d/utils/lib/src/interpolate_gpu.cu +0 -233
- learning3d-0.0.2/src/learning3d/utils/lib/src/interpolate_gpu.h +0 -36
- learning3d-0.0.2/src/learning3d/utils/lib/src/pointnet2_api.cpp +0 -25
- learning3d-0.0.2/src/learning3d/utils/lib/src/sampling.cpp +0 -46
- learning3d-0.0.2/src/learning3d/utils/lib/src/sampling_gpu.cu +0 -253
- learning3d-0.0.2/src/learning3d/utils/lib/src/sampling_gpu.h +0 -29
- {learning3d-0.0.2 → learning3d-0.0.3}/LICENSE +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/MANIFEST.in +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/README.md +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/data/modelnet40_ply_hdf5_2048/shape_names.txt +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/data/modelnet40_ply_hdf5_2048/test_files.txt +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/data/modelnet40_ply_hdf5_2048/train_files.txt +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/requirements.txt +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/setup.cfg +0 -0
- {learning3d-0.0.2/src/learning3d/ops → learning3d-0.0.3/src/learning3d}/__init__.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/data_utils/__init__.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/data_utils/dataloaders.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/data_utils/user_data.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/test_dcp.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/test_deepgmr.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/test_masknet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/test_masknet2.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/test_pcn.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/test_pcrnet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/test_pnlk.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/test_pointconv.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/test_pointnet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/test_prnet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/test_rpmnet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/train_PointNetLK.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/train_dcp.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/train_deepgmr.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/train_masknet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/train_pcn.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/train_pcrnet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/train_pointconv.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/train_pointnet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/train_prnet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/examples/train_rpmnet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/__init__.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/chamfer_distance.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/classification.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/correspondence_loss.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/cuda/chamfer_distance/__init__.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/cuda/chamfer_distance/chamfer_distance.cpp +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/cuda/chamfer_distance/chamfer_distance.cu +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/cuda/chamfer_distance/chamfer_distance.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/cuda/emd_torch/pkg/emd_loss_layer.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/cuda/emd_torch/pkg/include/cuda/emd.cuh +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/cuda/emd_torch/pkg/include/cuda_helper.h +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/cuda/emd_torch/pkg/include/emd.h +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/cuda/emd_torch/pkg/layer/__init__.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/cuda/emd_torch/pkg/layer/emd_loss_layer.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/cuda/emd_torch/pkg/src/cuda/emd.cu +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/cuda/emd_torch/pkg/src/emd.cpp +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/cuda/emd_torch/setup.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/emd.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/frobenius_norm.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/losses/rmse_features.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/classifier.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/dcp.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/deepgmr.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/dgcnn.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/masknet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/masknet2.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/pcn.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/pcrnet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/pointconv.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/pointnet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/pointnetlk.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/pooling.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/ppfnet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/prnet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/rpmnet.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/models/segmentation.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/ops/data_utils.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/ops/invmat.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/ops/quaternion.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/ops/se3.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/ops/sinc.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/ops/so3.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/ops/transform_functions.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/utils/pointconv_util.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/utils/ppfnet_util.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/utils/svd.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d/utils/transformer.py +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d.egg-info/dependency_links.txt +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d.egg-info/requires.txt +0 -0
- {learning3d-0.0.2 → learning3d-0.0.3}/src/learning3d.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: learning3d
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.3
|
4
4
|
Summary: Learning3D: A Modern Library for Deep Learning on 3D Point Clouds Data
|
5
5
|
Author-email: Vinit Sarode <vinitsarode5@gmail.com>
|
6
6
|
Project-URL: Homepage, https://github.com/vinits5/learning3d
|
@@ -15,9 +15,4 @@ from .rpmnet import RPMNet
|
|
15
15
|
from .pcn import PCN
|
16
16
|
from .deepgmr import DeepGMR
|
17
17
|
from .masknet import MaskNet
|
18
|
-
from .masknet2 import MaskNet2
|
19
|
-
|
20
|
-
try:
|
21
|
-
from .flownet3d import FlowNet3D
|
22
|
-
except:
|
23
|
-
print("Error raised in pointnet2 module for FlowNet3D Network!\nEither don't use pointnet2_utils or retry it's setup.")
|
18
|
+
from .masknet2 import MaskNet2
|
File without changes
|
@@ -1,9 +1,4 @@
|
|
1
1
|
from .svd import SVDHead
|
2
2
|
from .transformer import Transformer, Identity
|
3
3
|
from .ppfnet_util import angle_difference, square_distance, index_points, farthest_point_sample, query_ball_point, sample_and_group, sample_and_group_multi
|
4
|
-
from .pointconv_util import PointConvDensitySetAbstraction
|
5
|
-
|
6
|
-
try:
|
7
|
-
from .lib import pointnet2_utils
|
8
|
-
except:
|
9
|
-
print("Error raised in pointnet2 module in utils!\nEither don't use pointnet2_utils or retry it's setup.")
|
4
|
+
from .pointconv_util import PointConvDensitySetAbstraction
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: learning3d
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.3
|
4
4
|
Summary: Learning3D: A Modern Library for Deep Learning on 3D Point Clouds Data
|
5
5
|
Author-email: Vinit Sarode <vinitsarode5@gmail.com>
|
6
6
|
Project-URL: Homepage, https://github.com/vinits5/learning3d
|
@@ -6,7 +6,6 @@ requirements.txt
|
|
6
6
|
data/modelnet40_ply_hdf5_2048/shape_names.txt
|
7
7
|
data/modelnet40_ply_hdf5_2048/test_files.txt
|
8
8
|
data/modelnet40_ply_hdf5_2048/train_files.txt
|
9
|
-
pretrained/exp_prnet/args.txt
|
10
9
|
src/learning3d/__init__.py
|
11
10
|
src/learning3d.egg-info/PKG-INFO
|
12
11
|
src/learning3d.egg-info/SOURCES.txt
|
@@ -18,7 +17,6 @@ src/learning3d/data_utils/dataloaders.py
|
|
18
17
|
src/learning3d/data_utils/user_data.py
|
19
18
|
src/learning3d/examples/test_dcp.py
|
20
19
|
src/learning3d/examples/test_deepgmr.py
|
21
|
-
src/learning3d/examples/test_flownet.py
|
22
20
|
src/learning3d/examples/test_masknet.py
|
23
21
|
src/learning3d/examples/test_masknet2.py
|
24
22
|
src/learning3d/examples/test_pcn.py
|
@@ -31,7 +29,6 @@ src/learning3d/examples/test_rpmnet.py
|
|
31
29
|
src/learning3d/examples/train_PointNetLK.py
|
32
30
|
src/learning3d/examples/train_dcp.py
|
33
31
|
src/learning3d/examples/train_deepgmr.py
|
34
|
-
src/learning3d/examples/train_flownet.py
|
35
32
|
src/learning3d/examples/train_masknet.py
|
36
33
|
src/learning3d/examples/train_pcn.py
|
37
34
|
src/learning3d/examples/train_pcrnet.py
|
@@ -64,7 +61,6 @@ src/learning3d/models/classifier.py
|
|
64
61
|
src/learning3d/models/dcp.py
|
65
62
|
src/learning3d/models/deepgmr.py
|
66
63
|
src/learning3d/models/dgcnn.py
|
67
|
-
src/learning3d/models/flownet3d.py
|
68
64
|
src/learning3d/models/masknet.py
|
69
65
|
src/learning3d/models/masknet2.py
|
70
66
|
src/learning3d/models/pcn.py
|
@@ -89,36 +85,4 @@ src/learning3d/utils/__init__.py
|
|
89
85
|
src/learning3d/utils/pointconv_util.py
|
90
86
|
src/learning3d/utils/ppfnet_util.py
|
91
87
|
src/learning3d/utils/svd.py
|
92
|
-
src/learning3d/utils/transformer.py
|
93
|
-
src/learning3d/utils/lib/pointnet2_modules.py
|
94
|
-
src/learning3d/utils/lib/pointnet2_utils.py
|
95
|
-
src/learning3d/utils/lib/pytorch_utils.py
|
96
|
-
src/learning3d/utils/lib/setup.py
|
97
|
-
src/learning3d/utils/lib/build/lib.linux-x86_64-3.5/pointnet2_cuda.cpython-35m-x86_64-linux-gnu.so
|
98
|
-
src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/ball_query.o
|
99
|
-
src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/ball_query_gpu.o
|
100
|
-
src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/group_points.o
|
101
|
-
src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/group_points_gpu.o
|
102
|
-
src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/interpolate.o
|
103
|
-
src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/interpolate_gpu.o
|
104
|
-
src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/pointnet2_api.o
|
105
|
-
src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/sampling.o
|
106
|
-
src/learning3d/utils/lib/build/temp.linux-x86_64-3.5/src/sampling_gpu.o
|
107
|
-
src/learning3d/utils/lib/dist/pointnet2-0.0.0-py3.5-linux-x86_64.egg
|
108
|
-
src/learning3d/utils/lib/pointnet2.egg-info/SOURCES.txt
|
109
|
-
src/learning3d/utils/lib/pointnet2.egg-info/dependency_links.txt
|
110
|
-
src/learning3d/utils/lib/pointnet2.egg-info/top_level.txt
|
111
|
-
src/learning3d/utils/lib/src/ball_query.cpp
|
112
|
-
src/learning3d/utils/lib/src/ball_query_gpu.cu
|
113
|
-
src/learning3d/utils/lib/src/ball_query_gpu.h
|
114
|
-
src/learning3d/utils/lib/src/cuda_utils.h
|
115
|
-
src/learning3d/utils/lib/src/group_points.cpp
|
116
|
-
src/learning3d/utils/lib/src/group_points_gpu.cu
|
117
|
-
src/learning3d/utils/lib/src/group_points_gpu.h
|
118
|
-
src/learning3d/utils/lib/src/interpolate.cpp
|
119
|
-
src/learning3d/utils/lib/src/interpolate_gpu.cu
|
120
|
-
src/learning3d/utils/lib/src/interpolate_gpu.h
|
121
|
-
src/learning3d/utils/lib/src/pointnet2_api.cpp
|
122
|
-
src/learning3d/utils/lib/src/sampling.cpp
|
123
|
-
src/learning3d/utils/lib/src/sampling_gpu.cu
|
124
|
-
src/learning3d/utils/lib/src/sampling_gpu.h
|
88
|
+
src/learning3d/utils/transformer.py
|
@@ -1,35 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"exp_name": "exp_multi_gpu_v1",
|
3
|
-
"model": "prnet",
|
4
|
-
"emb_nn": "dgcnn",
|
5
|
-
"attention": "transformer",
|
6
|
-
"head": "svd",
|
7
|
-
"n_emb_dims": 512,
|
8
|
-
"n_blocks": 1,
|
9
|
-
"n_heads": 4,
|
10
|
-
"n_iters": 3,
|
11
|
-
"discount_factor": 0.9,
|
12
|
-
"n_ff_dims": 1024,
|
13
|
-
"n_keypoints": 512,
|
14
|
-
"temp_factor": 100,
|
15
|
-
"cat_sampler": "softmax",
|
16
|
-
"dropout": 0.0,
|
17
|
-
"batch_size": 16,
|
18
|
-
"test_batch_size": 8,
|
19
|
-
"epochs": 100,
|
20
|
-
"use_sgd": false,
|
21
|
-
"lr": 0.001,
|
22
|
-
"momentum": 0.9,
|
23
|
-
"no_cuda": false,
|
24
|
-
"seed": 1234,
|
25
|
-
"eval": false,
|
26
|
-
"cycle_consistency_loss": 0.1,
|
27
|
-
"feature_alignment_loss": 0.1,
|
28
|
-
"gaussian_noise": false,
|
29
|
-
"unseen": false,
|
30
|
-
"n_points": 1024,
|
31
|
-
"n_subsampled_points": 768,
|
32
|
-
"dataset": "modelnet40",
|
33
|
-
"rot_factor": 4,
|
34
|
-
"model_path": ""
|
35
|
-
}
|
@@ -1,113 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
|
4
|
-
|
5
|
-
import open3d as o3d
|
6
|
-
import os
|
7
|
-
import gc
|
8
|
-
import argparse
|
9
|
-
import torch
|
10
|
-
import torch.nn as nn
|
11
|
-
import torch.nn.functional as F
|
12
|
-
import torch.optim as optim
|
13
|
-
from torch.optim.lr_scheduler import MultiStepLR
|
14
|
-
from learning3d.models import FlowNet3D
|
15
|
-
from learning3d.data_utils import SceneflowDataset
|
16
|
-
import numpy as np
|
17
|
-
from torch.utils.data import DataLoader
|
18
|
-
from tensorboardX import SummaryWriter
|
19
|
-
from tqdm import tqdm
|
20
|
-
|
21
|
-
def display_open3d(template, source, transformed_source):
|
22
|
-
template_ = o3d.geometry.PointCloud()
|
23
|
-
source_ = o3d.geometry.PointCloud()
|
24
|
-
transformed_source_ = o3d.geometry.PointCloud()
|
25
|
-
template_.points = o3d.utility.Vector3dVector(template)
|
26
|
-
source_.points = o3d.utility.Vector3dVector(source + np.array([0,0.5,0.5]))
|
27
|
-
transformed_source_.points = o3d.utility.Vector3dVector(transformed_source)
|
28
|
-
template_.paint_uniform_color([1, 0, 0])
|
29
|
-
source_.paint_uniform_color([0, 1, 0])
|
30
|
-
transformed_source_.paint_uniform_color([0, 0, 1])
|
31
|
-
o3d.visualization.draw_geometries([template_, source_, transformed_source_])
|
32
|
-
|
33
|
-
def test_one_epoch(args, net, test_loader):
|
34
|
-
net.eval()
|
35
|
-
|
36
|
-
total_loss = 0
|
37
|
-
num_examples = 0
|
38
|
-
for i, data in enumerate(tqdm(test_loader)):
|
39
|
-
data = [d.to(args.device) for d in data]
|
40
|
-
pc1, pc2, color1, color2, flow, mask1 = data
|
41
|
-
pc1 = pc1.transpose(2,1).contiguous()
|
42
|
-
pc2 = pc2.transpose(2,1).contiguous()
|
43
|
-
color1 = color1.transpose(2,1).contiguous()
|
44
|
-
color2 = color2.transpose(2,1).contiguous()
|
45
|
-
flow = flow
|
46
|
-
mask1 = mask1.float()
|
47
|
-
|
48
|
-
batch_size = pc1.size(0)
|
49
|
-
num_examples += batch_size
|
50
|
-
flow_pred = net(pc1, pc2, color1, color2).permute(0,2,1)
|
51
|
-
loss_1 = torch.mean(mask1 * torch.sum((flow_pred - flow) * (flow_pred - flow), -1) / 2.0)
|
52
|
-
|
53
|
-
pc1, pc2 = pc1.permute(0,2,1), pc2.permute(0,2,1)
|
54
|
-
pc1_ = pc1 - flow_pred
|
55
|
-
print("Loss: ", loss_1)
|
56
|
-
display_open3d(pc1.detach().cpu().numpy()[0], pc2.detach().cpu().numpy()[0], pc1_.detach().cpu().numpy()[0])
|
57
|
-
total_loss += loss_1.item() * batch_size
|
58
|
-
|
59
|
-
return total_loss * 1.0 / num_examples
|
60
|
-
|
61
|
-
|
62
|
-
def test(args, net, test_loader):
|
63
|
-
test_loss = test_one_epoch(args, net, test_loader)
|
64
|
-
|
65
|
-
def main():
|
66
|
-
parser = argparse.ArgumentParser(description='Point Cloud Registration')
|
67
|
-
parser.add_argument('--model', type=str, default='flownet', metavar='N',
|
68
|
-
choices=['flownet'], help='Model to use, [flownet]')
|
69
|
-
parser.add_argument('--emb_dims', type=int, default=512, metavar='N',
|
70
|
-
help='Dimension of embeddings')
|
71
|
-
parser.add_argument('--num_points', type=int, default=2048,
|
72
|
-
help='Point Number [default: 2048]')
|
73
|
-
parser.add_argument('--test_batch_size', type=int, default=1, metavar='batch_size',
|
74
|
-
help='Size of batch)')
|
75
|
-
|
76
|
-
parser.add_argument('--gaussian_noise', type=bool, default=False, metavar='N',
|
77
|
-
help='Wheter to add gaussian noise')
|
78
|
-
parser.add_argument('--unseen', type=bool, default=False, metavar='N',
|
79
|
-
help='Whether to test on unseen category')
|
80
|
-
parser.add_argument('--dataset', type=str, default='SceneflowDataset',
|
81
|
-
choices=['SceneflowDataset'], metavar='N',
|
82
|
-
help='dataset to use')
|
83
|
-
parser.add_argument('--dataset_path', type=str, default='data_processed_maxcut_35_20k_2k_8192', metavar='N',
|
84
|
-
help='dataset to use')
|
85
|
-
parser.add_argument('--pretrained', type=str, default='learning3d/pretrained/exp_flownet/models/model.best.t7', metavar='N',
|
86
|
-
help='Pretrained model path')
|
87
|
-
parser.add_argument('--device', default='cuda:0', type=str,
|
88
|
-
metavar='DEVICE', help='use CUDA if available')
|
89
|
-
|
90
|
-
args = parser.parse_args()
|
91
|
-
if not torch.cuda.is_available():
|
92
|
-
args.device = torch.device('cpu')
|
93
|
-
else:
|
94
|
-
args.device = torch.device('cuda')
|
95
|
-
|
96
|
-
if args.dataset == 'SceneflowDataset':
|
97
|
-
test_loader = DataLoader(
|
98
|
-
SceneflowDataset(npoints=args.num_points, partition='test'),
|
99
|
-
batch_size=args.test_batch_size, shuffle=False, drop_last=False)
|
100
|
-
else:
|
101
|
-
raise Exception("not implemented")
|
102
|
-
|
103
|
-
net = FlowNet3D()
|
104
|
-
assert os.path.exists(args.pretrained), "Pretrained Model Doesn't Exists!"
|
105
|
-
net.load_state_dict(torch.load(args.pretrained, map_location='cpu'))
|
106
|
-
net = net.to(args.device)
|
107
|
-
|
108
|
-
test(args, net, test_loader)
|
109
|
-
print('FINISH')
|
110
|
-
|
111
|
-
|
112
|
-
if __name__ == '__main__':
|
113
|
-
main()
|
@@ -1,259 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
|
4
|
-
|
5
|
-
from __future__ import print_function
|
6
|
-
import os
|
7
|
-
import gc
|
8
|
-
import argparse
|
9
|
-
import torch
|
10
|
-
import torch.nn as nn
|
11
|
-
import torch.nn.functional as F
|
12
|
-
import torch.optim as optim
|
13
|
-
from torch.optim.lr_scheduler import MultiStepLR
|
14
|
-
from learning3d.models import FlowNet3D
|
15
|
-
from learning3d.data_utils import SceneflowDataset
|
16
|
-
import numpy as np
|
17
|
-
from torch.utils.data import DataLoader
|
18
|
-
from tensorboardX import SummaryWriter
|
19
|
-
from tqdm import tqdm
|
20
|
-
|
21
|
-
class IOStream:
|
22
|
-
def __init__(self, path):
|
23
|
-
self.f = open(path, 'a')
|
24
|
-
|
25
|
-
def cprint(self, text):
|
26
|
-
print(text)
|
27
|
-
self.f.write(text + '\n')
|
28
|
-
self.f.flush()
|
29
|
-
|
30
|
-
def close(self):
|
31
|
-
self.f.close()
|
32
|
-
|
33
|
-
|
34
|
-
def _init_(args):
|
35
|
-
if not os.path.exists('checkpoints'):
|
36
|
-
os.makedirs('checkpoints')
|
37
|
-
if not os.path.exists('checkpoints/' + args.exp_name):
|
38
|
-
os.makedirs('checkpoints/' + args.exp_name)
|
39
|
-
if not os.path.exists('checkpoints/' + args.exp_name + '/' + 'models'):
|
40
|
-
os.makedirs('checkpoints/' + args.exp_name + '/' + 'models')
|
41
|
-
|
42
|
-
def weights_init(m):
|
43
|
-
classname=m.__class__.__name__
|
44
|
-
if classname.find('Conv2d') != -1:
|
45
|
-
nn.init.kaiming_normal_(m.weight.data)
|
46
|
-
if classname.find('Conv1d') != -1:
|
47
|
-
nn.init.kaiming_normal_(m.weight.data)
|
48
|
-
|
49
|
-
def test_one_epoch(args, net, test_loader):
|
50
|
-
net.eval()
|
51
|
-
|
52
|
-
total_loss = 0
|
53
|
-
num_examples = 0
|
54
|
-
for i, data in tqdm(enumerate(test_loader), total=len(test_loader), smoothing=0.9):
|
55
|
-
pc1, pc2, color1, color2, flow, mask1 = data
|
56
|
-
pc1 = pc1.cuda().transpose(2,1).contiguous()
|
57
|
-
pc2 = pc2.cuda().transpose(2,1).contiguous()
|
58
|
-
color1 = color1.cuda().transpose(2,1).contiguous()
|
59
|
-
color2 = color2.cuda().transpose(2,1).contiguous()
|
60
|
-
flow = flow.cuda()
|
61
|
-
mask1 = mask1.cuda().float()
|
62
|
-
|
63
|
-
batch_size = pc1.size(0)
|
64
|
-
num_examples += batch_size
|
65
|
-
flow_pred = net(pc1, pc2, color1, color2).permute(0,2,1)
|
66
|
-
loss_1 = torch.mean(mask1 * torch.sum((flow_pred - flow) * (flow_pred - flow), -1) / 2.0)
|
67
|
-
|
68
|
-
pc1, pc2 = pc1.permute(0,2,1), pc2.permute(0,2,1)
|
69
|
-
pc1_ = pc1 + flow_pred
|
70
|
-
|
71
|
-
total_loss += loss_1.item() * batch_size
|
72
|
-
|
73
|
-
|
74
|
-
return total_loss * 1.0 / num_examples
|
75
|
-
|
76
|
-
|
77
|
-
def train_one_epoch(args, net, train_loader, opt):
|
78
|
-
net.train()
|
79
|
-
num_examples = 0
|
80
|
-
total_loss = 0
|
81
|
-
for i, data in tqdm(enumerate(train_loader), total=len(train_loader), smoothing=0.9):
|
82
|
-
pc1, pc2, color1, color2, flow, mask1 = data
|
83
|
-
pc1 = pc1.cuda().transpose(2,1).contiguous()
|
84
|
-
pc2 = pc2.cuda().transpose(2,1).contiguous()
|
85
|
-
color1 = color1.cuda().transpose(2,1).contiguous()
|
86
|
-
color2 = color2.cuda().transpose(2,1).contiguous()
|
87
|
-
flow = flow.cuda().transpose(2,1).contiguous()
|
88
|
-
mask1 = mask1.cuda().float()
|
89
|
-
|
90
|
-
batch_size = pc1.size(0)
|
91
|
-
opt.zero_grad()
|
92
|
-
num_examples += batch_size
|
93
|
-
flow_pred = net(pc1, pc2, color1, color2)
|
94
|
-
loss_1 = torch.mean(mask1 * torch.sum((flow_pred - flow) ** 2, 1) / 2.0)
|
95
|
-
|
96
|
-
pc1, pc2, flow_pred = pc1.permute(0,2,1), pc2.permute(0,2,1), flow_pred.permute(0,2,1)
|
97
|
-
pc1_ = pc1 + flow_pred
|
98
|
-
|
99
|
-
loss_1.backward()
|
100
|
-
|
101
|
-
opt.step()
|
102
|
-
total_loss += loss_1.item() * batch_size
|
103
|
-
|
104
|
-
# if (i+1) % 100 == 0:
|
105
|
-
# print("batch: %d, mean loss: %f" % (i, total_loss / 100 / batch_size))
|
106
|
-
# total_loss = 0
|
107
|
-
return total_loss * 1.0 / num_examples
|
108
|
-
|
109
|
-
|
110
|
-
def test(args, net, test_loader, boardio, textio):
|
111
|
-
|
112
|
-
test_loss = test_one_epoch(args, net, test_loader)
|
113
|
-
|
114
|
-
textio.cprint('==FINAL TEST==')
|
115
|
-
textio.cprint('mean test loss: %f'%test_loss)
|
116
|
-
|
117
|
-
|
118
|
-
def train(args, net, train_loader, test_loader, boardio, textio):
|
119
|
-
if args.use_sgd:
|
120
|
-
print("Use SGD")
|
121
|
-
opt = optim.SGD(net.parameters(), lr=args.lr * 100, momentum=args.momentum, weight_decay=1e-4)
|
122
|
-
else:
|
123
|
-
print("Use Adam")
|
124
|
-
opt = optim.Adam(net.parameters(), lr=args.lr, weight_decay=1e-4)
|
125
|
-
scheduler = MultiStepLR(opt, milestones=[75, 150, 200], gamma=0.1)
|
126
|
-
|
127
|
-
best_test_loss = np.inf
|
128
|
-
for epoch in range(args.epochs):
|
129
|
-
scheduler.step()
|
130
|
-
textio.cprint('==epoch: %d=='%epoch)
|
131
|
-
train_loss = train_one_epoch(args, net, train_loader, opt)
|
132
|
-
textio.cprint('mean train EPE loss: %f'%train_loss)
|
133
|
-
|
134
|
-
test_loss = test_one_epoch(args, net, test_loader)
|
135
|
-
textio.cprint('mean test EPE loss: %f'%test_loss)
|
136
|
-
|
137
|
-
if best_test_loss >= test_loss:
|
138
|
-
best_test_loss = test_loss
|
139
|
-
textio.cprint('best test loss till now: %f'%test_loss)
|
140
|
-
if torch.cuda.device_count() > 1:
|
141
|
-
torch.save(net.module.state_dict(), 'checkpoints/%s/models/model.best.t7' % args.exp_name)
|
142
|
-
else:
|
143
|
-
torch.save(net.state_dict(), 'checkpoints/%s/models/model.best.t7' % args.exp_name)
|
144
|
-
|
145
|
-
boardio.add_scalar('Train Loss', train_loss, epoch+1)
|
146
|
-
boardio.add_scalar('Test Loss', test_loss, epoch+1)
|
147
|
-
boardio.add_scalar('Best Test Loss', best_test_loss, epoch+1)
|
148
|
-
|
149
|
-
if torch.cuda.device_count() > 1:
|
150
|
-
torch.save(net.module.state_dict(), 'checkpoints/%s/models/model.%d.t7' % (args.exp_name, epoch))
|
151
|
-
else:
|
152
|
-
torch.save(net.state_dict(), 'checkpoints/%s/models/model.%d.t7' % (args.exp_name, epoch))
|
153
|
-
gc.collect()
|
154
|
-
|
155
|
-
|
156
|
-
def main():
|
157
|
-
parser = argparse.ArgumentParser(description='Point Cloud Registration')
|
158
|
-
parser.add_argument('--exp_name', type=str, default='exp_flownet', metavar='N',
|
159
|
-
help='Name of the experiment')
|
160
|
-
parser.add_argument('--model', type=str, default='flownet', metavar='N',
|
161
|
-
choices=['flownet'],
|
162
|
-
help='Model to use, [flownet]')
|
163
|
-
parser.add_argument('--emb_dims', type=int, default=512, metavar='N',
|
164
|
-
help='Dimension of embeddings')
|
165
|
-
parser.add_argument('--num_points', type=int, default=2048,
|
166
|
-
help='Point Number [default: 2048]')
|
167
|
-
parser.add_argument('--dropout', type=float, default=0.5, metavar='N',
|
168
|
-
help='Dropout ratio in transformer')
|
169
|
-
parser.add_argument('--batch_size', type=int, default=16, metavar='batch_size',
|
170
|
-
help='Size of batch)')
|
171
|
-
parser.add_argument('--test_batch_size', type=int, default=10, metavar='batch_size',
|
172
|
-
help='Size of batch)')
|
173
|
-
parser.add_argument('--epochs', type=int, default=250, metavar='N',
|
174
|
-
help='number of episode to train ')
|
175
|
-
parser.add_argument('--use_sgd', action='store_true', default=True,
|
176
|
-
help='Use SGD')
|
177
|
-
parser.add_argument('--lr', type=float, default=0.001, metavar='LR',
|
178
|
-
help='learning rate (default: 0.001, 0.1 if using sgd)')
|
179
|
-
parser.add_argument('--momentum', type=float, default=0.9, metavar='M',
|
180
|
-
help='SGD momentum (default: 0.9)')
|
181
|
-
parser.add_argument('--no_cuda', action='store_true', default=False,
|
182
|
-
help='enables CUDA training')
|
183
|
-
parser.add_argument('--seed', type=int, default=1234, metavar='S',
|
184
|
-
help='random seed (default: 1)')
|
185
|
-
parser.add_argument('--eval', action='store_true', default=False,
|
186
|
-
help='evaluate the model')
|
187
|
-
parser.add_argument('--cycle', type=bool, default=False, metavar='N',
|
188
|
-
help='Whether to use cycle consistency')
|
189
|
-
parser.add_argument('--gaussian_noise', type=bool, default=False, metavar='N',
|
190
|
-
help='Wheter to add gaussian noise')
|
191
|
-
parser.add_argument('--unseen', type=bool, default=False, metavar='N',
|
192
|
-
help='Whether to test on unseen category')
|
193
|
-
parser.add_argument('--dataset', type=str, default='SceneflowDataset',
|
194
|
-
choices=['SceneflowDataset'], metavar='N',
|
195
|
-
help='dataset to use')
|
196
|
-
parser.add_argument('--dataset_path', type=str, default='data_processed_maxcut_35_20k_2k_8192', metavar='N',
|
197
|
-
help='dataset to use')
|
198
|
-
parser.add_argument('--model_path', type=str, default='', metavar='N',
|
199
|
-
help='Pretrained model path')
|
200
|
-
parser.add_argument('--pretrained', type=str, default='', metavar='N',
|
201
|
-
help='Pretrained model path')
|
202
|
-
|
203
|
-
args = parser.parse_args()
|
204
|
-
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
|
205
|
-
# CUDA settings
|
206
|
-
torch.backends.cudnn.deterministic = True
|
207
|
-
torch.manual_seed(args.seed)
|
208
|
-
torch.cuda.manual_seed_all(args.seed)
|
209
|
-
np.random.seed(args.seed)
|
210
|
-
|
211
|
-
boardio = SummaryWriter(log_dir='checkpoints/' + args.exp_name)
|
212
|
-
_init_(args)
|
213
|
-
|
214
|
-
textio = IOStream('checkpoints/' + args.exp_name + '/run.log')
|
215
|
-
textio.cprint(str(args))
|
216
|
-
|
217
|
-
if args.dataset == 'SceneflowDataset':
|
218
|
-
train_loader = DataLoader(
|
219
|
-
SceneflowDataset(npoints=args.num_points, partition='train'),
|
220
|
-
batch_size=args.batch_size, shuffle=True, drop_last=True)
|
221
|
-
test_loader = DataLoader(
|
222
|
-
SceneflowDataset(npoints=args.num_points, partition='test'),
|
223
|
-
batch_size=args.test_batch_size, shuffle=False, drop_last=False)
|
224
|
-
else:
|
225
|
-
raise Exception("not implemented")
|
226
|
-
|
227
|
-
if args.model == 'flownet':
|
228
|
-
net = FlowNet3D().cuda()
|
229
|
-
net.apply(weights_init)
|
230
|
-
if args.pretrained:
|
231
|
-
net.load_state_dict(torch.load(args.pretrained), strict=False)
|
232
|
-
print("Pretrained Model Loaded Successfully!")
|
233
|
-
if args.eval:
|
234
|
-
if args.model_path is '':
|
235
|
-
model_path = 'checkpoints' + '/' + args.exp_name + '/models/model.best.t7'
|
236
|
-
else:
|
237
|
-
model_path = args.model_path
|
238
|
-
print(model_path)
|
239
|
-
if not os.path.exists(model_path):
|
240
|
-
print("can't find pretrained model")
|
241
|
-
return
|
242
|
-
net.load_state_dict(torch.load(model_path), strict=False)
|
243
|
-
if torch.cuda.device_count() > 1:
|
244
|
-
net = nn.DataParallel(net)
|
245
|
-
print("Let's use", torch.cuda.device_count(), "GPUs!")
|
246
|
-
else:
|
247
|
-
raise Exception('Not implemented')
|
248
|
-
if args.eval:
|
249
|
-
test(args, net, test_loader, boardio, textio)
|
250
|
-
else:
|
251
|
-
train(args, net, train_loader, test_loader, boardio, textio)
|
252
|
-
|
253
|
-
|
254
|
-
print('FINISH')
|
255
|
-
# boardio.close()
|
256
|
-
|
257
|
-
|
258
|
-
if __name__ == '__main__':
|
259
|
-
main()
|