vincentstimper / icp Goto Github PK
View Code? Open in Web Editor NEWTensorflow implementation of the iterative closest point (ICP) algorithm determining a translation and scaling along specified axes
License: MIT License
Tensorflow implementation of the iterative closest point (ICP) algorithm determining a translation and scaling along specified axes
License: MIT License
Hello @VincentStimper , thank you for your repository. I would like to understand how to use your code to align one mesh to another.
I tried loading the mesh and turning the vertex coordinates into arrays via a python package named pyVista. Then I tried to feed them to your algorithm. This is how i call the algorithm:
import pyvista as pv
template_mesh = pv.PolyData("template_norm.obj") # reference mesh
scene_mesh = pv.PolyData("scene_norm.obj") # mesh to be aligned (different scale and origin)
scale, offset = icp(np.array(scene_mesh.points, dtype="float64"), np.array(template_mesh.points, dtype="float64"), dim_offset="all", dim_scale="all", num_iter=50, use_gpu=False)
results:
Scale: [nan nan nan]
Offset: [nan nan nan]
I tried to use your code and my data is huge, but not that huge to exhaust the resource. I am getting the following error, can you help??
2020-03-26 20:08:52.756851: I tensorflow/core/common_runtime/bfc_allocator.cc:964] total_region_allocated_bytes_: 7977644800 memory_limit_: 7977644852 available bytes: 52 curr_region_allocation_bytes_: 15955290112
2020-03-26 20:08:52.756880: I tensorflow/core/common_runtime/bfc_allocator.cc:970] Stats:
Limit: 7977644852
InUse: 33248000
MaxInUse: 49112832
NumAllocs: 23
MaxAllocSize: 23797504
2020-03-26 20:08:52.756913: W tensorflow/core/common_runtime/bfc_allocator.cc:429] *___________________________________________________________________________________________________
2020-03-26 20:08:52.756986: W tensorflow/core/framework/op_kernel.cc:1655] OP_REQUIRES failed at matmul_op.cc:480 : Resource exhausted: OOM when allocating tensor with shape[47350,991553] and type double on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
Traceback (most recent call last):
File "Registration_ICP.py", line 104, in
icp_scale, icp_offset = icp.icp(dgt_points.T, sgt_points.T, dim_offset='all', dim_scale='all', num_iter=50, use_gpu = True)
File "/home/anam/self_localization/self_localization/self_localization/Codes/Registration_Codes/icp/icp/core.py", line 46, in icp
dist = src_squ - 2 * tf.matmul(src, dst, transpose_b=True) + tf.transpose(dst_squ)
File "/home/anam/anaconda3/envs/my_tf_env/lib/python3.7/site-packages/tensorflow_core/python/util/dispatch.py", line 180, in wrapper
return target(*args, **kwargs)
File "/home/anam/anaconda3/envs/my_tf_env/lib/python3.7/site-packages/tensorflow_core/python/ops/math_ops.py", line 2798, in matmul
a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name)
File "/home/anam/anaconda3/envs/my_tf_env/lib/python3.7/site-packages/tensorflow_core/python/ops/gen_math_ops.py", line 5616, in mat_mul
_ops.raise_from_not_ok_status(e, name)
File "/home/anam/anaconda3/envs/my_tf_env/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 6606, in raise_from_not_ok_status
six.raise_from(core._status_to_exception(e.code, message), None)
File "", line 3, in raise_from
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[47350,991553] and type double on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc [Op:MatMul] name: MatMul/
Hi, just wondering if I can get gradients from the scale matrix.
Thanks
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.