Add auto_scaling parameter for scaling the mesh inside the unit sphere #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem statement
When the method
sample_sdf_near_surface(..)
is called, the mesh is first scaled to fit into a unit sphere. The scaling ratio is not fixed, as it depends on the object geometry - which means that different objects are scaled differently. While in the virtual domain this is not a problem, as we can extract geometry information from the simulator, a geometry-dependent scaling ratio is a problem in the real world, where we cannot extract geometry information from the object easily. Therefore, it is essential to have a way to keep the scaling ratio fixed for all the objects in our dataset. Moreover, having control over the scaling ratio could be beneficial in the virtual domain as well.Changes
This PR adds two parameters to the methods
sample_sdf_near_surface(..)
andscale_to_unit_sphere(..)
:auto_scaling
: whenTrue
, the mesh is automatically scaled to fit into a unit sphere. Thus, nothing changes from the current repository. WhenFalse
, the mesh is scaled according to the parameterscale_ratio
.scale_ratio
: this parameter is used to scale the original mesh when the methodscale_to_unit_sphere(..)
is called. This parameter allows to have control over the scaling procedure.Example
Both objects have been scaled by the same ratio, therefore we can use the DeepSDF method in downstream tasks in the real world.
I hope this makes sense, I am happy answer any questions you may have about this PR.