Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed installation issues and static paths #18

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
72 changes: 72 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04

ENV TZ=US/Pacific
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update --fix-missing && \
apt-get install -y libgtk2.0-dev && \
apt-get install -y wget bzip2 ca-certificates curl git vim tmux g++ gcc build-essential cmake checkinstall gfortran libjpeg8-dev libtiff5-dev pkg-config yasm libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2-dev libv4l-dev qt5-default libgtk2.0-dev libtbb-dev libatlas-base-dev libfaac-dev libmp3lame-dev libtheora-dev libvorbis-dev libxvidcore-dev libopencore-amrnb-dev libopencore-amrwb-dev x264 v4l-utils libprotobuf-dev protobuf-compiler libgoogle-glog-dev libgflags-dev libgphoto2-dev libhdf5-dev doxygen libflann-dev libboost-all-dev proj-data libproj-dev libyaml-cpp-dev cmake-curses-gui

# RUN cd / && wget https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz &&\
# tar xvzf ./eigen-3.4.0.tar.gz &&\
# cd eigen-3.4.0 &&\
# mkdir build &&\
# cd build &&\
# cmake .. &&\
# make install

# RUN cd / &&\
# git clone https://github.com/opencv/opencv &&\
# cd opencv &&\
# git checkout 3.4.15 &&\
# cd / && git clone https://github.com/opencv/opencv_contrib.git &&\
# cd opencv_contrib &&\
# git checkout 3.4.15 &&\
# cd /opencv &&\
# mkdir build

# RUN cd /opencv/build &&\
# cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_CUDA_STUBS=OFF -DBUILD_DOCS=OFF -DWITH_MATLAB=OFF -Dopencv_dnn_BUILD_TORCH_IMPORTE=OFF -DCUDA_FAST_MATH=ON -DMKL_WITH_OPENMP=ON -DOPENCV_ENABLE_NONFREE=ON -DWITH_OPENMP=ON -DWITH_QT=ON -WITH_OPENEXR=ON -DENABLE_PRECOMPILED_HEADERS=OFF -DBUILD_opencv_cudacodec=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DWITH_TIFF=OFF -DWITH_WEBP=OFF -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -DCMAKE_CXX_FLAGS=-std=c++11 -DENABLE_CXX11=OFF -DBUILD_opencv_xfeatures2d=ON -DOPENCV_DNN_OPENCL=OFF -DWITH_CUDA=ON -DWITH_OPENCL=OFF &&\
# make -j6 &&\
# make install &&\
# cd /opencv/build && make install

RUN apt install -y libzmq3-dev freeglut3-dev

SHELL ["/bin/bash", "--login", "-c"]

RUN cd / && wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /miniconda.sh && \
/bin/bash /miniconda.sh -b -p /opt/conda &&\
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh &&\
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc &&\
/bin/bash -c "source ~/.bashrc" && \
/opt/conda/bin/conda update -n base -c defaults conda -y &&\
/opt/conda/bin/conda config --set ssl_verify no && \
/opt/conda/bin/conda config --add channels conda-forge

RUN cd / && git clone https://github.com/VenkatSBitra/PVO.git

RUN cd /PVO &&\
conda env create -y -f VO_Module/environment.yaml
# conda activate droidenv &&\

ENV PATH $PATH:/opt/conda/envs/droidenv/bin

# SHELL ["conda", "run", "-n", "droidenv", "/bin/bash", "-c"]
RUN conda init bash &&\
echo "conda activate droidenv" >> ~/.bashrc &&\
/bin/bash -c "source ~/.bashrc"

RUN pip install evo --upgrade --no-binary evo &&\
pip install gdown

# # RUN conda activate droidenv &&\
# # conda install -y pytorch==1.9.0 torchvision cudatoolkit=11.1 -c pytorch -c nvidia &&\
RUN python -m pip install 'git+https://github.com/facebookresearch/detectron2.git' &&\
cd /PVO && python -m pip install -e VPS_Module &&\
pip install git+https://github.com/cocodataset/panopticapi.git

RUN pip install ninja &&\
cd /PVO/VO_Module && python setup.py install

8 changes: 6 additions & 2 deletions VO_Module/droid_slam/data_readers/vkitti2.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,21 @@ def _build_dataset(self):
graph = self.build_frame_graph(poses, depths, intrinsics)

if self.flow_label:
print(scene, self.split_mode, VKitti2.split[self.split_mode])
fo_flows = sorted(
glob.glob(osp.join(scene, VKitti2.split[self.split_mode], 'frames/forwardFlow/Camera_0/*.png')))
ba_flows = sorted(
glob.glob(osp.join(scene, VKitti2.split[self.split_mode], 'frames/backwardFlow/Camera_0/*.png')))
# segments = sorted(
# glob.glob(osp.join(scene, VKitti2.split[self.split_mode], 'panoptic_gt_id/*.png')))
segments = sorted(
glob.glob(osp.join(scene, VKitti2.split[self.split_mode], 'panoptic_gt_id/*.png')))
glob.glob(osp.join("datasets/Virtual_KITTI2/ALL_15-deg-left", 'panoptic_gt_id/*.png')))
scene_info[scene] = {'images': images, 'depths': depths, 'fo_flows': fo_flows,
'ba_flows': ba_flows, 'poses': poses, 'intrinsics': intrinsics, 'segments' : segments}
else:
print(self.split_mode)
masks = sorted(
glob.glob(osp.join(scene, VKitti2.split[self.split_mode], 'frames/dynamicMask/Camera_0/*.npy')))
glob.glob(osp.join(scene, VKitti2.split[self.split_mode], 'frames/dynamicMask_00/Camera_0/*.npy')))
segments = sorted(
glob.glob(osp.join(scene, VKitti2.split[self.split_mode], 'panFPN_segm/*.png')))

Expand Down
2 changes: 1 addition & 1 deletion VO_Module/droid_slam/droid_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def forward(self, net, inp, corr, flow=None,
weight = weight.permute(0, 1, 3, 4, 2).contiguous()
delta_m = delta_m.permute(0, 1, 3, 4, 2).contiguous()

lay = torch.as_tensor(np.range(1, num+1).repeat(ht*wd).reshape(num,ht,wd)).unsqueeze(0)
lay = torch.as_tensor(np.arange(1, num+1).repeat(ht*wd).reshape(num,ht,wd)).unsqueeze(0)
# weight = self.do_filter(lay, weight, delta_dy, delta_m, segments)

net = net.view(*output_dim)
Expand Down
3 changes: 2 additions & 1 deletion VO_Module/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ dependencies:
- torchvision
- open3d
- pytorch
- cudatoolkit
# - cudatoolkit=11.7
- pytorch-cuda=11.8
- tensorboard
- scipy
- opencv
Expand Down
12 changes: 12 additions & 0 deletions VO_Module/thirdparty/eigen/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
Language: Cpp
BasedOnStyle: Google
ColumnLimit: 120
SortIncludes: false
AttributeMacros:
- EIGEN_STRONG_INLINE
- EIGEN_ALWAYS_INLINE
- EIGEN_DEVICE_FUNC
- EIGEN_DONT_INLINE
- EIGEN_DEPRECATED
- EIGEN_UNUSED
4 changes: 4 additions & 0 deletions VO_Module/thirdparty/eigen/.git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# First major clang-format MR (https://gitlab.com/libeigen/eigen/-/merge_requests/1429).
f38e16c193d489c278c189bc06b448a94adb45fb
# Formatting of tests, examples, benchmarks, et cetera (https://gitlab.com/libeigen/eigen/-/merge_requests/1432).
46e9cdb7fea25d7f7aef4332b9c3ead3857e213d
5 changes: 4 additions & 1 deletion VO_Module/thirdparty/eigen/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ core
core.*
*.bak
*~
*build*
*.build*
*.moc.*
*.moc
ui_*
Expand All @@ -36,3 +36,6 @@ lapack/reference
.settings
Makefile
!ci/build.gitlab-ci.yml
!scripts/buildtests.in
!Eigen/Core
!Eigen/src/Core
24 changes: 16 additions & 8 deletions VO_Module/thirdparty/eigen/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
# This file is part of Eigen, a lightweight C++ template library
# for linear algebra.
#
# Copyright (C) 2020 Arm Ltd. and Contributors
# Copyright (C) 2023, The Eigen Authors
#
# This Source Code Form is subject to the terms of the Mozilla
# Public License v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

stages:
- buildsmoketests
- smoketests
- checkformat
- build
- test

variables:
BUILDDIR: builddir
EIGEN_CI_CMAKE_GENEATOR: "Ninja"
# CMake build directory.
EIGEN_CI_BUILDDIR: .build
# Specify the CMake build target.
EIGEN_CI_BUILD_TARGET: ""
# If a test regex is specified, that will be selected.
# Otherwise, we will try a label if specified.
EIGEN_CI_TEST_REGEX: ""
EIGEN_CI_TEST_LABEL: ""

include:
- "/ci/smoketests.gitlab-ci.yml"
- "/ci/build.gitlab-ci.yml"
- "/ci/test.gitlab-ci.yml"
- "/ci/checkformat.gitlab-ci.yml"
- "/ci/common.gitlab-ci.yml"
- "/ci/build.linux.gitlab-ci.yml"
- "/ci/build.windows.gitlab-ci.yml"
- "/ci/test.linux.gitlab-ci.yml"
- "/ci/test.windows.gitlab-ci.yml"
Loading