luost26 / dmrdenoise Goto Github PK
View Code? Open in Web Editor NEW:snowman: Differentiable Manifold Reconstruction for Point Cloud Denoising (ACM MM 2020)
License: MIT License
:snowman: Differentiable Manifold Reconstruction for Point Cloud Denoising (ACM MM 2020)
License: MIT License
The point cloud I want to denoise contains about 8k points. However, it seems you code does not support point clouds with less than 10K points. What can I do if I want to use your code to denoise my data?
when i run python denoise.py --input<> --output<> --ckpt ./pretrained/supervised/epoch=153.ckpt
i got this error
i run this program on google colab
ubuntu 18.04
[INFO] Loading: ./pretrained/supervised/epoch=153.ckpt
Traceback (most recent call last):
File "denoise.py", line 202, in
auto_denoise(args)
File "denoise.py", line 140, in auto_denoise
pc = np.loadtxt(args.input).astype(np.float32)
File "/usr/local/envs/DMRDenoise/lib/python3.6/site-packages/numpy/lib/npyio.py", line 1092, in loadtxt
first_line = next(fh)
File "/usr/local/envs/DMRDenoise/lib/python3.6/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
how to slove this problem
Hi,
Thanks for your great work and detailed code.
I want to test the point-to-surface results, and I find it needs normals as input.
Could you please tell me how you obtain the normals (used in the p2s loss function) ?
Thanks a lot.
Dear author, may I ask how the visualization in Figure 4 of your paper is displayed? Looking forward to your reply, thank you very much
Hi@luost26
In the process of down sampling, I didn't find the feature of the point and the parameter of the score function to cross multiply.
I only found Gpool Function, which is similar to pooling.
Can it help me to point out where the corresponding steps should be?
(DMRDenoise) cx@cx-System-Product-Name:~/NewDisk/xxl/DMRDenoise-master/ops/emd$ python setup.py install
running install
running bdist_egg
running egg_info
writing emd.egg-info/PKG-INFO
writing dependency_links to emd.egg-info/dependency_links.txt
writing top-level names to emd.egg-info/top_level.txt
reading manifest file 'emd.egg-info/SOURCES.txt'
writing manifest file 'emd.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
building 'emd' extension
Emitting ninja build file /home/cx/NewDisk/xxl/DMRDenoise-master/ops/emd/build/temp.linux-x86_64-3.6/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/2] /usr/bin/nvcc -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/include -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/include/TH -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/include/THC -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/include/python3.6m -c -c /home/cx/NewDisk/xxl/DMRDenoise-master/ops/emd/emd_cuda.cu -o /home/cx/NewDisk/xxl/DMRDenoise-master/ops/emd/build/temp.linux-x86_64-3.6/emd_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=emd -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75 -std=c++14
FAILED: /home/cx/NewDisk/xxl/DMRDenoise-master/ops/emd/build/temp.linux-x86_64-3.6/emd_cuda.o
/usr/bin/nvcc -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/include -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/include/TH -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/include/THC -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/include/python3.6m -c -c /home/cx/NewDisk/xxl/DMRDenoise-master/ops/emd/emd_cuda.cu -o /home/cx/NewDisk/xxl/DMRDenoise-master/ops/emd/build/temp.linux-x86_64-3.6/emd_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=emd -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75 -std=c++14
nvcc fatal : Path to libdevice library not specified
[2/2] c++ -MMD -MF /home/cx/NewDisk/xxl/DMRDenoise-master/ops/emd/build/temp.linux-x86_64-3.6/emd.o.d -pthread -B /home/cx/NewDisk/anaconda3/envs/DMRDenoise/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/include -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/include/TH -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/include/THC -I/home/cx/NewDisk/anaconda3/envs/DMRDenoise/include/python3.6m -c -c /home/cx/NewDisk/xxl/DMRDenoise-master/ops/emd/emd.cpp -o /home/cx/NewDisk/xxl/DMRDenoise-master/ops/emd/build/temp.linux-x86_64-3.6/emd.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=emd -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1423, in _run_ninja_build
check=True)
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 13, in
'build_ext': BuildExtension
File "/home/cx/.local/lib/python3.6/site-packages/setuptools/init.py", line 165, in setup
return distutils.core.setup(**attrs)
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/cx/.local/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/home/cx/.local/lib/python3.6/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/cx/.local/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 174, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/home/cx/.local/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 160, in call_command
self.run_command(cmdname)
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/cx/.local/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/distutils/command/install_lib.py", line 107, in build
self.run_command('build_ext')
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/cx/.local/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 87, in run
_build_ext.run(self)
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 603, in build_extensions
build_ext.build_extensions(self)
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/home/cx/.local/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 208, in build_extension
_build_ext.build_extension(self, ext)
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
depends=ext.depends)
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 437, in unix_wrap_ninja_compile
with_cuda=with_cuda)
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1163, in _write_ninja_file_and_compile_objects
error_prefix='Error compiling objects for extension')
File "/home/cx/NewDisk/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1436, in _run_ninja_build
raise RuntimeError(message)
RuntimeError: Error compiling objects for extension
How to solve this problem?
Thanks for your sharing code very much! I have one question that when training where is the 'Epoch progressbar percentage loss and v_num 'comes from that shows in commander? I checked the code several times but with no result. begging for your reply. Thks a lot!
Thanks for your contribution, I am very interested in your study.
I wonder how to create custom dataset to train the model from my .xyz files.
HI @luost26
When I run train.py, it reports as follow
Traceback (most recent call last):
File "train.py", line 56, in
main(hparams)
File "train.py", line 21, in main
module = PointCloudDenoising(hparams)
File "/home/qiuf/DMRDenoise/models/denoise.py", line 23, in init
self.hparams = hparams
File "/home/qiuf/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/nn/modules/module.py", line 826, in setattr
object.setattr(self, name, value)
AttributeError: can't set attribute
I have no idea how to solve it? could you please provide some advice?
THANKS for your great work!
Thanks for the wonderful job.
However, as a beginner, there is a question that confuses me.
There are only the following four folders in the compressed package dataset_test.zip
. Could you please share the clean data input_full_test_50k
without noise?
input_full_test_50k_0.010
input_full_test_50k_0.020
input_full_test_50k_0.025
input_full_test_50k_0.030
Hi,
I am interested in your work and want to test the data I obtained from my experimental environments.
Is there any pretrained model for an immediate test?
Thank you
Dear author
Thanks for sharing the code. I'm currently try to implemente you DMR model in my own dataset. In your ACM MM2020 paper, the training loss is calculated according to the downsampled and the upsampled point cloud. But in your implementation, the loss may calculated only according to the final upsampled point cloud. The part of the code in 'models/denoise.py' line 114 is as follwos:
def training_step(self, batch, batch_idx):
denoised = self.forward(batch['pos'])
noiseless = batch['clean']
normals = batch['normal']
loss = self.model.get_loss(gts=noiseless, preds=denoised, normals=normals, inputs=batch['pos'])
output = {
'loss': loss,
'log': {
'loss_train/loss': loss.sum(),
}
}
return output
where this part of code is used for one train forward iteration and the variable 'loss' is the training loss. However, when I turn to the defination of function 'self.model.getloss()' in line 119 as follows:
def get_loss(self, gts, normals, inputs, **kwargs):
loss = self.loss_rec(preds=self.preds, gts=gts, normals=normals, inputs=inputs, epoch=self.epoch)
if self.loss_ds is not None:
loss = loss + self.loss_ds(preds=self.preds, gts=gts, normals=normals, inputs=inputs, epoch=self.epoch)
return loss
where the loss is calculated using 'self.loss_rec()' and 'self.loss_ds'. The parameters of the function are the same and the only useful parameter is the 'preds' and 'gts' representing the predicted point cloud and the ground truth point cloud. But both of the parameter 'preds' is assigned by 'self.preds' where this is the final upsampled point cloud while the 'self.adjusted' in 'models/net.py' line 58 representing the downsampled point cloud. I wonder if the parameter 'preds' in 'self.loss_rec' should be assigned by 'self.adjusted'. So I would like to ask if there is anything that is inconsistent with the implementation in the paper or something that I didn't notice or misunderstood.
Hello,
I need to use input patch size, which is <1024(let's say 512, 256).
While I am using input patch size of 512, this is popping up, "Input Error! The size of the point clouds should be a multiple of 1024. error in nnd get grad: invalid configuration argument" but training is still going on.
Can you please suggest me to handle point clouds which have patch size<1024.
Also, it is taking point cloud normals as input, but I didn't see in the code using normals while training.
Thank you
Gopi
Hi nice to meet you luost!
I'm student who is majoring in computer science.
First of all, your works are very awsome.
I'm trying to run the pretrained model with my rtx 3090.
But the cuda toolkit (nvcc) version which you are suggesting doesn't match with my GPU, so i find out that my GPU needs cuda toolkit 11.0 <= , and i installed it instead of 10.0
here is the problem occurs...
pytorch-lightning version 0.7.6 which you are suggesting doesn't support cuda toolkik 11.0
so, i installed pytorch-lightning 1.4.5.
However, when i load your pretrained model "./pretrained/supervised/epoch=153.ckpt" on my command,
it has error...like this.
and I have searched and agonized over the problem, i guess that the cause is the version of pytorch-lightning.
Do you have any solution for my environment?
your denosing method is really remarkable.
I want to run the model so much....
their are my packages of venv!
Thank you!
I run your code and pretrained model without any changes to denoise point cloud with 65 536 points. I`ve tried with another number of points in point cloud. I get the following error. Please, could you tell me how i can fix it?
Traceback (most recent call last):
File "denoise.py", line 202, in
auto_denoise(args)
File "denoise.py", line 165, in auto_denoise
expand_knn=args.expand_knn
File "denoise.py", line 82, in run_denoise_middle_pointcloud
den, dow = run_denoise(splpc, patch_size, ckpt, device, random_state, expand_knn)
File "denoise.py", line 53, in run_denoise
pred = model(patch)
File "/opt/conda/envs/DMRDenoise/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/root/shared/elejke/olga/3d/DMRDenoise-master/models/denoise.py", line 56, in forward
return self.model(pos)
File "/opt/conda/envs/DMRDenoise/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/root/shared/elejke/olga/3d/DMRDenoise-master/models/net.py", line 54, in forward
feats.append(feat_unit(pos))
File "/opt/conda/envs/DMRDenoise/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/root/shared/elejke/olga/3d/DMRDenoise-master/models/blocks.py", line 48, in forward
return self.dynamic_graph_forward(x)
File "/root/shared/elejke/olga/3d/DMRDenoise-master/models/blocks.py", line 35, in dynamic_graph_forward
x = self.transformsi
File "/opt/conda/envs/DMRDenoise/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/root/shared/elejke/olga/3d/DMRDenoise-master/models/utils.py", line 164, in forward
return self.activation(self.linear(x))
File "/opt/conda/envs/DMRDenoise/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/opt/conda/envs/DMRDenoise/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 87, in forward
return F.linear(input, self.weight, self.bias)
File "/opt/conda/envs/DMRDenoise/lib/python3.6/site-packages/torch/nn/functional.py", line 1612, in linear
output = input.matmul(weight.t())
RuntimeError: size mismatch, m1: [1765 x 6], m2: [3 x 32] at /opt/conda/conda-bld/pytorch_1591914895258/work/aten/src/THC/generic/THCTensorMathBlas.cu:283
Hi!
Thanks for the amazing work.
I try to denoise a point cloud, and this is the error that is printed to the screen:
"..../denoise/DMRDenoise/models/conv.py", line 54, in forward
], dim=-1) # (B, N, K, d+c)
RuntimeError: Sizes of tensors must match except in dimension 2. Got 24 and 20".
Each time I run the program, the same error appears but with different dimensions.
do you have any idea what could cause this problem?
thank you very much in advance! :)
Alavona
Hi, I want to use point-to-surface distance, but I am confused with the formula and could not find the implementation code.
If I understand it correctly, the point q on surface S is refered to the cloest point to p on S, with the surface S is defined by vertices of mesh. In this way, the mesh data are necessary for calculating P2S distance. However, the mesh data currently is not released along with this repo.
Can you give me some detail about how this metric is calculated, or any similar implementaion code.
It would be better, if you can release the corresponding code and mesh.
Hi @luost26 ,Thank you for sharing this code.. I'm trying to test my own data and it is reported of this error:
44%|████████████████████████████████████████████████████▎ | 11/25 [00:01<00:02, 6.00it/s] 3%|███▏ | 3/113 [00:36<22:14, 12.13s/it] Traceback (most recent call last): File "denoise.py", line 202, in <module> auto_denoise(args) File "denoise.py", line 154, in auto_denoise expand_knn=args.expand_knn File "denoise.py", line 116, in run_denoise_large_pointcloud den, dow = run_denoise(patch - centers[i], patch_size, ckpt, device, random_state, expand_knn) File "denoise.py", line 53, in run_denoise pred = model(patch) File "/home/xxx/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in __call__ result = self.forward(*input, **kwargs) File "/home/xxx/DMRDenoise-master/models/denoise.py", line 56, in forward return self.model(pos) File "/home/xxx/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in __call__ result = self.forward(*input, **kwargs) File "/home/xxx/DMRDenoise-master/models/net.py", line 54, in forward feats.append(feat_unit(pos)) File "/home/xxx/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in __call__ result = self.forward(*input, **kwargs) File "/home/xxx/DMRDenoise-master/models/blocks.py", line 48, in forward return self.dynamic_graph_forward(x) File "/home/xxx/DMRDenoise-master/models/blocks.py", line 36, in dynamic_graph_forward x = self.convs[i](x, x) File "/home/xxx/anaconda3/envs/DMRDenoise/lib/python3.6/site-packages/torch/nn/modules/module.py", line 550, in __call__ result = self.forward(*input, **kwargs) File "/home/xxx/DMRDenoise-master/models/conv.py", line 54, in forward ], dim=-1) # (B, N, K, d+c) RuntimeError: Sizes of tensors must match except in dimension 2. Got 24 and 19
I wonder ,Whether there's any requirement for the test data? I used .txt file , with x, y, z coordinates per line. Thank you , Looking forward to your reply.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.