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

chore: upgrade to opencv 4 #98

Open
wants to merge 4 commits into
base: master
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@
# Requires nvidia gpu with driver 396.37 or higher


FROM nvidia/cudagl:9.2-devel-ubuntu18.04
FROM nvidia/cudagl:11.0-devel-ubuntu20.04

# Install cudnn
ENV CUDNN_VERSION 7.6.4.38
LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"

ENV NV_CUDNN_VERSION 8.0.5.39
ENV NV_CUDNN_PACKAGE "libcudnn8=$NV_CUDNN_VERSION-1+cuda11.0"
ENV NV_CUDNN_PACKAGE_DEV "libcudnn8-dev=$NV_CUDNN_VERSION-1+cuda11.0"
ENV NV_CUDNN_PACKAGE_NAME "libcudnn8"
RUN apt-get update && apt-get install -y --no-install-recommends \
libcudnn7=$CUDNN_VERSION-1+cuda9.2 \
libcudnn7-dev=$CUDNN_VERSION-1+cuda9.2 \
&& \
apt-mark hold libcudnn7 && \
${NV_CUDNN_PACKAGE} \
${NV_CUDNN_PACKAGE_DEV} \
&& apt-mark hold ${NV_CUDNN_PACKAGE_NAME} && \
rm -rf /var/lib/apt/lists/*


# Install a few libraries to support both EGL and OSMESA options
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y wget doxygen curl libjsoncpp-dev libepoxy-dev libglm-dev libosmesa6 libosmesa6-dev libglew-dev libopencv-dev python-opencv python3-setuptools python3-dev python3-pip
RUN pip3 install opencv-python==4.1.0.25 torch==1.1.0 torchvision==0.3.0 numpy==1.13.3 pandas==0.24.1 networkx==2.2
RUN apt-get update && apt-get install -y wget doxygen curl libjsoncpp-dev libepoxy-dev libglm-dev libosmesa6 libosmesa6-dev libglew-dev libopencv-dev python3-setuptools python3-dev python3-pip
RUN pip3 install opencv-python==4.5.3.56 torch==1.4.0 torchvision numpy==1.21.1 pandas==1.3.1 networkx==2.2

#install latest cmake
ADD https://cmake.org/files/v3.12/cmake-3.12.2-Linux-x86_64.sh /cmake-3.12.2-Linux-x86_64.sh
Expand Down
2 changes: 1 addition & 1 deletion src/lib/NavGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void NavGraph::Location::loadCubemapImages() {
}
if (includeDepth) {
// 16 bit grayscale images
cv::Mat depth = cv::imread(skyboxDir + viewpointId + "_skybox_depth_small.png", CV_LOAD_IMAGE_ANYDEPTH);
cv::Mat depth = cv::imread(skyboxDir + viewpointId + "_skybox_depth_small.png", cv::IMREAD_ANYDEPTH);
w = depth.cols/6;
h = depth.rows;
xposD = depth(cv::Rect(2*w, 0, w, h));
Expand Down
2 changes: 1 addition & 1 deletion src/test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ TEST_CASE( "RGB Image", "[Rendering]" ) {
auto imgfile = testcase["reference_image"].asString();
auto reference_image = cv::imread("webgl_imgs/"+imgfile);
auto state = sim.getState().at(n);
double err = cv::norm(reference_image, state->rgb, CV_L2);
double err = cv::norm(reference_image, state->rgb, cv::NORM_L2);
err /= reference_image.rows * reference_image.cols;
CHECK(err < 0.15);
// save for later comparison, these images can also be inspected by hand
Expand Down