autonomousvision / differentiable_volumetric_rendering

This repository contains the code for the CVPR 2020 paper "Differentiable Volumetric Rendering: Learning Implicit 3D Representations without 3D Supervision"
http://www.cvlibs.net/publications/Niemeyer2020CVPR.pdf
MIT License
798 stars 90 forks source link

Windows compatibility #22

Closed mworchel closed 4 years ago

mworchel commented 4 years ago

Hi,

this PR fixes several issues (such as #15) when trying to run the code using a Windows machine. I tried to be as clear as possible with the commit messages but if something does not immediately make sense, don't hesitate to ask. The large diff in the main scripts is not as large as it seems (and more obvious if you disable whitespace comparisons). Essentially, I just wrapped the scripts in a

if __name__ == '__main__':

Otherwise, they will not run due to the way the multiprocessing lib is implemented under Windows (see https://stackoverflow.com/a/18205006)

The cause for the error in #15 seems to be that the type np.int64 corresponds to long long under Windows and not long as assumed by the code. I fixed it by using Cython's type cnp.int64_t instead of long, which should be resolved to the right type, independent of the platform.

m-niemeyer commented 4 years ago

Hey mworchel, that's great - thanks a lot for doing this. I don't have access to a Windows machine, but I assume you tested it so I will go ahead and merge your changes Thanks again for this contribution!

mworchel commented 4 years ago

Yes, I successfully tested it on two Windows machines.

Thanks for the merge!

m-niemeyer commented 4 years ago

That's great, thanks a lot again for your great work!