-
Notifications
You must be signed in to change notification settings - Fork 11
Installing LEAP without PyTorch
LEAP is mostly a C/C++/CUDA library and thus can be used without PyTorch and used for general tomographic reconstruction. The library can be used from other C/C++ software or from Python with the provided wrapper class.
CUDA toolkit 11.7 or newer (See section below about compiling without a GPU or on Mac)
Linux: gcc compiler
Windows: Visual Studio 2019 (be sure to check the box that says "Desktop development with C++")
If using the Python binding (leapctype.py), one only needs the standard Python packages, including numpy.
This LEAP API is bound to Python using ctypes (a standard Python package) with the file we provide called leapctype.py. To load and launch LEAP, use the following commands:
from leapctype import *
leapct = tomographicModels()
See demo_leapctype for a usage examples.
mv setup.py setup_torch.py
mv setup_ctype.py setup.py
pip install .
cd LEAP
sh ./etc/build.sh
module load gcc/8.3.0
module load cuda/11.7.0
cd LEAP
sh ./etc/build.sh
cd LEAP
.\etc\win_build.bat
After running the command above, one may use Visual Studio to make changes and re-compile by using the solution file here: LEAP\win_build\leap.sln
Be sure to switch from "Debug" to "Release"
If you are building on a Mac, you will have to install gcc. First, you need to swap the CMake file by renaming cpu_CMakeLists.txt to CMakeLists.txt (in the src folder). Then you can follow any of the install instructions above.
Please see our example scripts in the demo_leapctype directory.