Pang-Yatian 336d42f562 | 2 years ago | |
---|---|---|
.. | ||
cuda | 2 years ago | |
.gitignore | 2 years ago | |
README.md | 2 years ago | |
__init__.py | 2 years ago | |
emd.py | 2 years ago | |
setup.py | 2 years ago | |
test_emd_loss.py | 2 years ago |
The code has been tested on Ubuntu 16.04, PyTorch 1.1.0, CUDA 9.0.
First compile using
python setup.py install
Then, copy the lib file out to the main directory,
cp build/lib.linux-x86_64-3.6/emd_cuda.cpython-36m-x86_64-linux-gnu.so .
Then, you can use it by simply
from emd import earth_mover_distance
d = earth_mover_distance(p1, p2, transpose=False) # p1: B x N1 x 3, p2: B x N2 x 3
Check test_emd_loss.py
for example.
The cuda code is originally written by Haoqiang Fan. The PyTorch wrapper is written by Kaichun Mo. Also, Jiayuan Gu provided helps.
MIT
No Description
Python Cuda Markdown C++ other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》