diff --git a/3rdparty/Open3D.sh b/3rdparty/Open3D.sh deleted file mode 100644 index a7b3395..0000000 --- a/3rdparty/Open3D.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -# Install Open3D with GeneralizedICP support -# Based on Open3D/util/ci_utils.sh - -set -ex - -NPROC=${NPROC:-$(getconf _NPROCESSORS_ONLN)} # POSIX: MacOS + Linux - -# Patch for PSR -patch_psr() { - git apply --ignore-whitespace <::Initialize( FEMTreeNode& root , InputPo - pointStream.reset(); - } - if( outOfBoundPoints ) WARN( "Found out-of-bound points: " , outOfBoundPoints ); -- if( badData ) WARN( "Found bad data: " , badData ); -+ /* if( badData ) WARN( "Found bad data: " , badData ); */ - if( std::is_same< Real , float >::value ) - { - std::vector< size_t > badNodeCounts( ThreadPool::NumThreads() , 0 ); -diff --git a/Src/FEMTree.IsoSurface.specialized.inl b/Src/FEMTree.IsoSurface.specialized.inl -index 28b5ef0..88710e4 100644 ---- a/Src/FEMTree.IsoSurface.specialized.inl -+++ b/Src/FEMTree.IsoSurface.specialized.inl -@@ -1855,7 +1855,7 @@ public: - FEMTree< Dim , Real >::MemoryUsage(); - if( pointEvaluator ) delete pointEvaluator; - size_t badRootCount = _BadRootCount; -- if( badRootCount!=0 ) WARN( "bad average roots: " , badRootCount ); -+ /* if( badRootCount!=0 ) WARN( "bad average roots: " , badRootCount ); */ - return isoStats; - } - }; -EOF -} - -build_all() { - - echo "Using cmake: $(which cmake)" - cmake --version - - mkdir -p build - cd build - - cmakeOptions=( - -DCMAKE_BUILD_TYPE=Release - -DPYTHON_EXECUTABLE="$(which python)" - -DBUILD_LIBREALSENSE=OFF - -DBUILD_UNIT_TESTS=OFF - -DBUILD_BENCHMARKS=OFF - -DBUILD_EXAMPLES=OFF - -DENABLE_HEADLESS_RENDERING=ON - -DBUILD_GUI=OFF - -DUSE_SYSTEM_GLEW=OFF - -DUSE_SYSTEM_GLFW=OFF - ) - - echo Running cmake "${cmakeOptions[@]}" .. - cmake "${cmakeOptions[@]}" .. - echo "Build & install Open3D..." - make VERBOSE=1 -j"$NPROC" - make install -j"$NPROC" - make VERBOSE=1 install-pip-package -j"$NPROC" -} - -# install open3d with python bindings -git clone --depth 1 --recurse-submodules \ - https://github.com/nachovizzo/Open3D.git /tmp/Open3D -b nacho/generalized_icp && - cd /tmp/Open3D/ - -# Patch Poisson Surface Reconstruction so it doesn't fill up the console. -cd 3rdparty/PoissonRecon/PoissonRecon/ && patch_psr && cd - - -# Was impossible to pass the SUDO env variable to the script, so remove it :) -sed -i 's/sudo//' util/install_deps_ubuntu.sh - -# install Open3D dependencies -bash util/install_deps_ubuntu.sh assume-yes - -# Build and cleanup to save space -build_all -rm -rf /tmp/Open3D && rm -rf /var/lib/apt/lists/* diff --git a/3rdparty/cmake.sh b/3rdparty/cmake.sh deleted file mode 100644 index 7533928..0000000 --- a/3rdparty/cmake.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# Instructions from https://apt.kitware.com/ - -set -ex - -apt-get update && apt-get install --no-install-recommends -y \ - apt-transport-https \ - ca-certificates \ - gnupg \ - software-properties-common && - rm -rf /var/lib/apt/lists/* - -wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | - gpg --dearmor - | - tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null - -apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' -apt-get update && apt-get install --no-install-recommends -y \ - cmake && - rm -rf /var/lib/apt/lists/* diff --git a/3rdparty/patch_pykitti.sh b/3rdparty/patch_pykitti.sh index fefef32..1b9cae5 100644 --- a/3rdparty/patch_pykitti.sh +++ b/3rdparty/patch_pykitti.sh @@ -3,7 +3,7 @@ set -ex # Obtain the location of the pykitti package pykitti_dir=$( -python - <<-EOF +python3 - <<-EOF import sys import traceback diff --git a/docker/builder/Dockerfile b/docker/builder/Dockerfile index 41cf2fd..54561c5 100644 --- a/docker/builder/Dockerfile +++ b/docker/builder/Dockerfile @@ -16,32 +16,35 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ wget \ && rm -rf /var/lib/apt/lists/* -# Add python3 and pip aliases -RUN update-alternatives \ - --install /usr/bin/python python $(which python3) 20 \ - --slave /usr/bin/pip pip $(which pip3) - -# Install 3rdparty dependencies, split dependencies for separate docker overlays -COPY 3rdparty/embree.sh 3rdparty/ -RUN bash 3rdparty/embree.sh - -# Open3D needs cmake >= 3.18 -COPY 3rdparty/cmake.sh 3rdparty/ -RUN bash 3rdparty/cmake.sh +# Install Open3D system dependencies +RUN apt-get update && apt-get install --no-install-recommends -y \ + libgl1 \ + libgomp1 \ + && rm -rf /var/lib/apt/lists/* -# Install generalized_icp branch of Open3D until reaches the main branch -COPY 3rdparty/Open3D.sh 3rdparty/ -RUN bash 3rdparty/Open3D.sh +# Upgrade pip +RUN pip install --upgrade pip # Install Python dependencies -RUN pip install --upgrade \ +RUN pip install --no-cache-dir --upgrade \ black \ pybind11 \ setuptools +# Install modern version of Open3D +RUN pip install --upgrade --pre \ + https://files.pythonhosted.org/packages/10/02/4f777e87131b3e111f91e16c1782da707b8b6a5777dbbe11a19e0dc7d1a3/open3d-0.15.2-cp38-cp38-manylinux_2_27_x86_64.whl + # Install puma COPY . /puma -RUN cd /puma && pip install --upgrade . && rm -rf /puma +RUN cd /puma \ + && pip install --no-cache-dir --requirement requirements.txt \ + && pip install --no-cache-dir --upgrade . \ + && rm -rf /puma + +# Install 3rdparty dependencies, split dependencies for separate docker overlays +COPY 3rdparty/embree.sh 3rdparty/ +RUN bash 3rdparty/embree.sh # Patch pykitti to avoid pulling opencv-python dependency COPY 3rdparty/patch_pykitti.sh 3rdparty/ diff --git a/puma/registration/o3d_aliases.py b/puma/registration/o3d_aliases.py index 4fed513..6cab7c4 100644 --- a/puma/registration/o3d_aliases.py +++ b/puma/registration/o3d_aliases.py @@ -2,9 +2,4 @@ PointToPoint = o3d.pipelines.registration.TransformationEstimationPointToPoint PointToPlane = o3d.pipelines.registration.TransformationEstimationPointToPlane -try: - GICP = o3d.pipelines.registration.TransformationEstimationForGeneralizedICP -except AttributeError as error: - raise SystemExit( - "Open3D with GeneralizedICP support not installed, check INSTALL.md" - ) +GICP = o3d.pipelines.registration.TransformationEstimationForGeneralizedICP diff --git a/requirements.txt b/requirements.txt index 32876b9..aef9f76 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ PyYAML easydict matplotlib numpy +open3d>=0.14 pykitti tqdm trimesh