DROID-SLAM复现(服务器端复现,yaml创建env,)

环境配置

代码地址:https://github.com/princeton-vl/DROID-SLAM

git 代码

官方方法,直接拉取:

git clone --recursive https://github.com/princeton-vl/DROID-SLAM.git

如果从github拉取很慢,可以直接从gitee上拉取同步的代码,那样会快很多,从gitee导入仓库这里就能找到gitee同步的仓库
DROID-SLAM复现(服务器端复现,yaml创建env,)_第1张图片
拉取代码

git clone https://gitee.com/ssmem/DROID-SLAM

创建环境

我在服务器端,无法可视化界面,就选择如下的yaml文件进行conda环境创建:

conda env create -f environment_novis.yaml

直接使用原本的yaml文件不行,我在github的issue里找到了修改为适合自己这个的方法,修改environment_novis.yaml其中的内容为:

name: droidenv
channels:
  - rusty1s
  - pytorch
  - nvidia
  - conda-forge
  - defaults
dependencies:
  - _libgcc_mutex=0.1=conda_forge
  - _openmp_mutex=4.5=2_kmp_llvm
  - absl-py=1.4.0=pyhd8ed1ab_0
  - aiohttp=3.8.4=py39h72bdee0_0
  - aiosignal=1.3.1=pyhd8ed1ab_0
  - alsa-lib=1.2.8=h166bdaf_0
  - aom=3.5.0=h27087fc_0
  - async-timeout=4.0.2=pyhd8ed1ab_0
  - attr=2.5.1=h166bdaf_1
  - attrs=23.1.0=pyh71513ae_1
  - blas=2.116=mkl
  - blas-devel=3.9.0=16_linux64_mkl
  - blinker=1.6.2=pyhd8ed1ab_0
  - brotli=1.0.9=h166bdaf_8
  - brotli-bin=1.0.9=h166bdaf_8
  - brotlipy=0.7.0=py39hb9d737c_1005
  - bzip2=1.0.8=h7f98852_4
  - c-ares=1.19.0=hd590300_0
  - ca-certificates=2023.5.7=hbcca054_0
  - cachetools=5.3.0=pyhd8ed1ab_0
  - cairo=1.16.0=ha61ee94_1014
  - certifi=2023.5.7=pyhd8ed1ab_0
  - cffi=1.15.1=py39he91dace_3
  - charset-normalizer=2.1.1=pyhd8ed1ab_0
  - click=8.1.3=unix_pyhd8ed1ab_2
  - colorama=0.4.6=pyhd8ed1ab_0
  - contourpy=1.0.7=py39h4b4f3f3_0
  - cryptography=40.0.2=py39h079d5ae_0
  - cudatoolkit=11.3.1=ha36c431_9
  - cycler=0.11.0=pyhd8ed1ab_0
  - dbus=1.13.6=h5008d03_3
  - expat=2.5.0=hcb278e6_1
  - ffmpeg=5.1.2=gpl_h8dda1f0_106
  - fftw=3.3.10=nompi_hc118613_107
  - font-ttf-dejavu-sans-mono=2.37=hab24e00_0
  - font-ttf-inconsolata=3.000=h77eed37_0
  - font-ttf-source-code-pro=2.038=h77eed37_0
  - font-ttf-ubuntu=0.83=hab24e00_0
  - fontconfig=2.14.2=h14ed4e7_0
  - fonts-conda-ecosystem=1=0
  - fonts-conda-forge=1=0
  - fonttools=4.39.4=py39hd1e30aa_0
  - freeglut=3.2.2=h9c3ff4c_1
  - freetype=2.12.1=hca18f0e_1
  - frozenlist=1.3.3=py39hb9d737c_0
  - gettext=0.21.1=h27087fc_0
  - glib=2.76.2=hfc55251_0
  - glib-tools=2.76.2=hfc55251_0
  - gmp=6.2.1=h58526e2_0
  - gnutls=3.7.8=hf3e180e_0
  - google-auth=2.18.1=pyh1a96a4e_0
  - google-auth-oauthlib=1.0.0=pyhd8ed1ab_0
  - graphite2=1.3.13=h58526e2_1001
  - grpcio=1.54.2=py39h227be39_2
  - gst-plugins-base=1.22.0=h4243ec0_2
  - gstreamer=1.22.0=h25f0c4b_2
  - gstreamer-orc=0.4.33=h166bdaf_0
  - harfbuzz=6.0.0=h8e241bc_0
  - hdf5=1.14.0=nompi_hb72d44e_103
  - icu=70.1=h27087fc_0
  - idna=3.4=pyhd8ed1ab_0
  - importlib-metadata=6.6.0=pyha770c72_0
  - importlib-resources=5.12.0=pyhd8ed1ab_0
  - importlib_resources=5.12.0=pyhd8ed1ab_0
  - jack=1.9.22=h11f4161_0
  - jasper=2.0.33=h0ff4b12_1
  - jpeg=9e=h0b41bf4_3
  - keyutils=1.6.1=h166bdaf_0
  - kiwisolver=1.4.4=py39hf939315_1
  - krb5=1.20.1=h81ceb04_0
  - lame=3.100=h166bdaf_1003
  - lcms2=2.15=hfd0df8a_0
  - ld_impl_linux-64=2.40=h41732ed_0
  - lerc=4.0.0=h27087fc_0
  - libabseil=20230125.2=cxx17_h59595ed_2
  - libaec=1.0.6=hcb278e6_1
  - libblas=3.9.0=16_linux64_mkl
  - libbrotlicommon=1.0.9=h166bdaf_8
  - libbrotlidec=1.0.9=h166bdaf_8
  - libbrotlienc=1.0.9=h166bdaf_8
  - libcap=2.67=he9d0100_0
  - libcblas=3.9.0=16_linux64_mkl
  - libclang=15.0.7=default_h7634d5b_2
  - libclang13=15.0.7=default_h9986a30_2
  - libcups=2.3.3=h36d4200_3
  - libcurl=8.1.0=h409715c_0
  - libdb=6.2.32=h9c3ff4c_0
  - libdeflate=1.17=h0b41bf4_0
  - libdrm=2.4.114=h166bdaf_0
  - libedit=3.1.20191231=he28a2e2_2
  - libev=4.33=h516909a_1
  - libevent=2.1.10=h28343ad_4
  - libexpat=2.5.0=hcb278e6_1
  - libffi=3.4.2=h7f98852_5
  - libflac=1.4.2=h27087fc_0
  - libgcc-ng=12.2.0=h65d4601_19
  - libgcrypt=1.10.1=h166bdaf_0
  - libgfortran-ng=12.2.0=h69a702a_19
  - libgfortran5=12.2.0=h337968e_19
  - libglib=2.76.2=hebfc3b9_0
  - libglu=9.0.0=he1b5a44_1001
  - libgpg-error=1.46=h620e276_0
  - libgrpc=1.54.2=hb20ce57_2
  - libhwloc=2.9.1=hd6dc26d_0
  - libiconv=1.17=h166bdaf_0
  - libidn2=2.3.4=h166bdaf_0
  - liblapack=3.9.0=16_linux64_mkl
  - liblapacke=3.9.0=16_linux64_mkl
  - libllvm15=15.0.7=hadd5161_1
  - libnghttp2=1.52.0=h61bc06f_0
  - libnsl=2.0.0=h7f98852_0
  - libogg=1.3.4=h7f98852_1
  - libopencv=4.7.0=py39h2ca4621_1
  - libopus=1.3.1=h7f98852_1
  - libpciaccess=0.17=h166bdaf_0
  - libpng=1.6.39=h753d276_0
  - libpq=15.3=hbcd7760_1
  - libprotobuf=3.21.12=h3eb15da_0
  - libsndfile=1.2.0=hb75c966_0
  - libsqlite=3.42.0=h2797004_0
  - libssh2=1.10.0=hf14f497_3
  - libstdcxx-ng=12.2.0=h46fd767_19
  - libsystemd0=253=h8c4010b_1
  - libtasn1=4.19.0=h166bdaf_0
  - libtiff=4.5.0=h6adf6a1_2
  - libtool=2.4.7=h27087fc_0
  - libudev1=253=h0b41bf4_1
  - libunistring=0.9.10=h7f98852_0
  - libuuid=2.38.1=h0b41bf4_0
  - libuv=1.44.2=h166bdaf_0
  - libva=2.18.0=h0b41bf4_0
  - libvorbis=1.3.7=h9c3ff4c_0
  - libvpx=1.11.0=h9c3ff4c_3
  - libwebp-base=1.3.0=h0b41bf4_0
  - libxcb=1.13=h7f98852_1004
  - libxkbcommon=1.5.0=h79f4944_1
  - libxml2=2.10.3=hca2bb57_4
  - libzlib=1.2.13=h166bdaf_4
  - llvm-openmp=16.0.4=h4dfa4b3_0
  - lz4-c=1.9.4=hcb278e6_0
  - markdown=3.4.3=pyhd8ed1ab_0
  - markupsafe=2.1.2=py39h72bdee0_0
  - matplotlib=3.7.1=py39hf3d152e_0
  - matplotlib-base=3.7.1=py39he190548_0
  - metis=5.1.0=h58526e2_1006
  - mkl=2022.1.0=h84fe81f_915
  - mkl-devel=2022.1.0=ha770c72_916
  - mkl-include=2022.1.0=h84fe81f_915
  - mpfr=4.2.0=hb012696_0
  - mpg123=1.31.3=hcb278e6_0
  - multidict=6.0.4=py39h72bdee0_0
  - munkres=1.1.4=pyh9f0ad1d_0
  - mysql-common=8.0.32=hf1915f5_2
  - mysql-libs=8.0.32=hca2cd23_2
  - ncurses=6.3=h27087fc_1
  - nettle=3.8.1=hc379101_1
  - nspr=4.35=h27087fc_0
  - nss=3.89=he45b914_0
  - numpy=1.24.3=py39h6183b62_0
  - oauthlib=3.2.2=pyhd8ed1ab_0
  - opencv=4.7.0=py39hf3d152e_1
  - openh264=2.3.1=hcb278e6_2
  - openjpeg=2.5.0=hfec8fc6_2
  - openssl=3.1.0=hd590300_3
  - p11-kit=0.24.1=hc5aa10d_0
  - packaging=23.1=pyhd8ed1ab_0
  - pcre2=10.40=hc3806b6_0
  - pillow=9.4.0=py39h2320bf1_1
  - pip=23.1.2=pyhd8ed1ab_0
  - pixman=0.40.0=h36c2ea0_0
  - platformdirs=3.5.1=pyhd8ed1ab_0
  - ply=3.11=py_1
  - pooch=1.7.0=pyha770c72_3
  - protobuf=4.21.12=py39h227be39_0
  - pthread-stubs=0.4=h36c2ea0_1001
  - pulseaudio=16.1=hcb278e6_3
  - pulseaudio-client=16.1=h5195f5e_3
  - pulseaudio-daemon=16.1=ha8d29e2_3
  - py-opencv=4.7.0=py39hcca971b_1
  - pyasn1=0.4.8=py_0
  - pyasn1-modules=0.2.7=py_0
  - pycparser=2.21=pyhd8ed1ab_0
  - pyjwt=2.7.0=pyhd8ed1ab_0
  - pyopenssl=23.1.1=pyhd8ed1ab_0
  - pyparsing=3.0.9=pyhd8ed1ab_0
  - pyqt=5.15.7=py39h5c7b992_3
  - pyqt5-sip=12.11.0=py39h227be39_3
  - pysocks=1.7.1=pyha2e5f31_6
  - python=3.9.16=h2782a2a_0_cpython
  - python-dateutil=2.8.2=pyhd8ed1ab_0
  - python_abi=3.9=3_cp39
  - pytorch=1.10.2=py3.9_cuda11.3_cudnn8.2.0_0
  - pytorch-mutex=1.0=cuda
  - pytorch-scatter=2.0.9=py39_torch_1.10.0_cu113
  - pyu2f=0.1.5=pyhd8ed1ab_0
  - pyyaml=6.0=py39hb9d737c_5
  - qt-main=5.15.8=h5d23da1_6
  - re2=2023.03.02=h8c504da_0
  - readline=8.2=h8228510_1
  - requests=2.29.0=pyhd8ed1ab_0
  - requests-oauthlib=1.3.1=pyhd8ed1ab_0
  - rsa=4.9=pyhd8ed1ab_0
  - scipy=1.10.1=py39h6183b62_3
  - setuptools=67.7.2=pyhd8ed1ab_0
  - sip=6.7.9=py39h3d6467e_0
  - six=1.16.0=pyh6c4a22f_0
  - suitesparse=5.10.1=h9e50725_1
  - svt-av1=1.4.1=hcb278e6_0
  - tbb=2021.9.0=hf52228f_0
  - tensorboard=2.13.0=pyhd8ed1ab_0
  - tensorboard-data-server=0.7.0=py39h079d5ae_0
  - tk=8.6.12=h27826a3_0
  - toml=0.10.2=pyhd8ed1ab_0
  - tomli=2.0.1=pyhd8ed1ab_0
  - torchaudio=0.10.2=py39_cu113
  - torchvision=0.11.3=py39_cu113
  - tornado=6.3.2=py39hd1e30aa_0
  - tqdm=4.65.0=pyhd8ed1ab_1
  - typing-extensions=4.5.0=hd8ed1ab_0
  - typing_extensions=4.5.0=pyha770c72_0
  - tzdata=2023c=h71feb2d_0
  - unicodedata2=15.0.0=py39hb9d737c_0
  - urllib3=1.26.15=pyhd8ed1ab_0
  - werkzeug=2.3.4=pyhd8ed1ab_0
  - wheel=0.40.0=pyhd8ed1ab_0
  - x264=1!164.3095=h166bdaf_2
  - x265=3.5=h924138e_3
  - xcb-util=0.4.0=h166bdaf_0
  - xcb-util-image=0.4.0=h166bdaf_0
  - xcb-util-keysyms=0.4.0=h166bdaf_0
  - xcb-util-renderutil=0.3.9=h166bdaf_0
  - xcb-util-wm=0.4.1=h166bdaf_0
  - xkeyboard-config=2.38=h0b41bf4_0
  - xorg-fixesproto=5.0=h7f98852_1002
  - xorg-inputproto=2.3.2=h7f98852_1002
  - xorg-kbproto=1.0.7=h7f98852_1002
  - xorg-libice=1.0.10=h7f98852_0
  - xorg-libsm=1.2.3=hd9c2040_1000
  - xorg-libx11=1.8.4=h0b41bf4_0
  - xorg-libxau=1.0.9=h7f98852_0
  - xorg-libxdmcp=1.1.3=h7f98852_0
  - xorg-libxext=1.3.4=h0b41bf4_2
  - xorg-libxfixes=5.0.3=h7f98852_1004
  - xorg-libxi=1.7.10=h7f98852_0
  - xorg-libxrender=0.9.10=h7f98852_1003
  - xorg-renderproto=0.11.1=h7f98852_1002
  - xorg-xextproto=7.3.0=h0b41bf4_1003
  - xorg-xproto=7.0.31=h7f98852_1007
  - xz=5.2.6=h166bdaf_0
  - yaml=0.2.5=h7f98852_2
  - yarl=1.9.1=py39hd1e30aa_0
  - zipp=3.15.0=pyhd8ed1ab_0
  - zlib=1.2.13=h166bdaf_4
  - zstd=1.5.2=h3eb15da_6
prefix: /.../.conda/envs/droidenv

这样就不会一直卡在solving environment了

继续安装

pip install evo --upgrade --no-binary evo
pip install gdown

编译扩展

python setup.py install

测试

下载模型droid.pth

找到 tools/download_sample_data.sh 脚本里的数据集,下载需要的数据集,解压后放在data里

运行 abandonedfactory 数据集下的测试,在服务器下运行,不可视化

python demo.py --imagedir=data/abandonedfactory --calib=calib/tartan.txt --stride=2 --disable_vis

想要保存重建的深度图,需要额外再加上 --reconstruction_path,运行

python demo.py --imagedir=data/abandonedfactory --calib=calib/tartan.txt --stride=2 --disable_vis --reconstruction_path ./result

这样结果就会存在reconstructions/result里面

你可能感兴趣的:(代码复现,python)