Skip to content

Commit

Permalink
fix EMD readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin97 committed Dec 21, 2019
1 parent 6591add commit ee85ec0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Run `python3 val.py` to validate the model or `python3 train.py` to train the mo

### EMD

We provide an EMD implementation for point cloud comparison, which only needs $O(n)$ memory and thus enables dense point clouds (with 10,000 points or over) and large batch size. It is based on an approximated algorithm (auction algorithm) and cannot guarantee a (but near) bijection assignment. It employs a parameter $\epsilon$ which balances the error rate and the speed of convergence. Smaller $\epsilon$ achieves more accurate results, but needs a longer time for convergence. The time complexity is $O(n^2k)$, where $k$ is the number of iterations. We set a $\epsilon = 0.005, k = 50$ during training and a $\epsilon = 0.002, k = 10000$ during testing. Please refer to`emd/README.md` for more details.
We provide an EMD implementation for point cloud comparison, which only needs $O(n)$ memory and thus enables dense point clouds (with 10,000 points or over) and large batch size. It is based on an approximated algorithm (auction algorithm) and cannot guarantee a (but near) bijection assignment. It employs a parameter $\epsilon$ to balance the error rate and the speed of convergence. Smaller $\epsilon$ achieves more accurate results, but needs a longer time for convergence. The time complexity is $O(n^2k)$, where $k$ is the number of iterations. We set a $\epsilon = 0.005, k = 50$ during training and a $\epsilon = 0.002, k = 10000$ during testing. Please refer to`emd/README.md` for more details.

### Citation

Expand Down
23 changes: 7 additions & 16 deletions emd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,21 @@

Compared to the Chamfer Distance (CD), the Earth Mover's Distance (EMD) is more reliable to distinguish the visual quality of the point clouds. See our [paper](http://cseweb.ucsd.edu/~mil070/projects/AAAI2020/paper.pdf) for more details.

We provide an EMD implementation for point cloud comparison, which only needs $O(n)$ memory and thus enables dense point clouds (with 10,000 points or over) and large batch size. It is based on an approximated algorithm (auction algorithm) and cannot guarantee a (but near) bijection assignment. It employs a parameter $\epsilon$ which balances the error rate and the speed of convergence. Smaller $\epsilon$ achieves more accurate results, but needs a longer time for convergence. The time complexity is $O(n^2k)$, where $k$ is the number of iterations. We set a $\epsilon = 0.005, k = 50$ during training and a $\epsilon = 0.002, k = 10000$ during testing.
We provide an EMD implementation for point cloud comparison, which only needs $O(n)$ memory and thus enables dense point clouds (with 10,000 points or over) and large batch size. It is based on an approximated algorithm (auction algorithm) and cannot guarantee a (but near) bijection assignment. It employs a parameter $\epsilon$ to balance the error rate and the speed of convergence. Smaller $\epsilon$ achieves more accurate results, but needs a longer time for convergence. The time complexity is $O(n^2k)$, where $k$ is the number of iterations. We set a $\epsilon = 0.005, k = 50$ during training and a $\epsilon = 0.002, k = 10000$ during testing.

### Compile
`python3 setup.py install`
Run `python3 setup.py install`.

### Example
See `emd_module.py/test_emd()` for examples.

### Input

- **xyz1, xyz2**: float tensors with shape [#batch, #points, 3]
xyz1 is the predicted point cloud and xyz2 is the ground truth point cloud.
Two point clouds should have same size and be normalized to [0, 1]
The number of points should be a multiple of 1024.
The batch size should be no greater than 512.
Since we only calculate gradients for xyz1, please do not swap xyz1 and xyz2.
- **eps**: a float tensor
The parameter balances the error rate and the speed of convergence.
- **iters**: a int tensor
The number of iterations.
- **xyz1, xyz2**: float tensors with shape `[#batch, #points, 3]`. xyz1 is the predicted point cloud and xyz2 is the ground truth point cloud. Two point clouds should have same size and be normalized to [0, 1]. The number of points should be a multiple of 1024. The batch size should be no greater than 512. Since we only calculate gradients for xyz1, please do not swap xyz1 and xyz2.
- **eps**: a float tensor. The parameter balances the error rate and the speed of convergence.
- **iters**: a int tensor. The number of iterations.

### Output

- **dist**: a float tensor with shape [#batch, #points]
sqrt(dist) are the L2 distance between the pairs of points.
- **assignment**: a int tensor with shape [#batch, #points]
The index of the matched point in the ground truth point cloud.
- **dist**: a float tensor with shape `[#batch, #points]`. sqrt(dist) are the L2 distance between the pairs of points.
- **assignment**: a int tensor with shape `[#batch, #points]`. The index of the matched point in the ground truth point cloud.

0 comments on commit ee85ec0

Please sign in to comment.