diff --git a/Dockerfile b/Dockerfile index b2b00d1..7abee12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM nvcr.io/nvidia/pytorch:23.02-py3 +FROM nvcr.io/nvidia/pytorch:24.10-py3 ARG DEBIAN_FRONTEND=noninteractive ENV LANG=C.UTF-8 @@ -24,7 +24,7 @@ RUN mim install "mmcv>=2,<2.2.0" RUN mim install "mmdet>=3" RUN mim install "mmpose>=1.1.0" # Fix an error when importing mmpose -RUN pip3 install --upgrade --no-cache-dir numpy scipy +RUN pip3 install --upgrade --no-cache-dir "numpy<2" scipy RUN git clone --depth=1 --branch=main https://github.com/open-mmlab/mmpose.git # Download pretrained model diff --git a/swig/Makefile b/swig/Makefile index cea52c3..bc4ab3a 100644 --- a/swig/Makefile +++ b/swig/Makefile @@ -1,13 +1,14 @@ # Standard compile options for the C++ executable -FLAGS = -fPIC -O3 -march=native -Wall -Werror -flto -fopenmp -fopenmp-simd +FLAGS = -fPIC -O3 -march=native -Wall -Werror -flto=auto -fopenmp -fopenmp-simd # The Python interface through SWIG -PYTHONI = -I/usr/include/python3.8/ +PYTHON_VERSION = $(shell python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}");') +PYTHONI = -I/usr/include/python$(PYTHON_VERSION)/ PYTHONL = -Xlinker -export-dynamic # Default super-target all: - cd ../rpt/ && g++ $(FLAGS) -std=c++2a -I/usr/include/opencv4 -c *.cpp ; cd ../swig/ + cd ../rpt/ && g++ $(FLAGS) -std=c++2a -isystem /usr/include/opencv4/ -c *.cpp ; cd ../swig/ swig -c++ -python -keyword -o rpt_wrap.cxx rpt.i g++ $(FLAGS) $(PYTHONI) -c rpt_wrap.cxx -o rpt_wrap.o g++ $(FLAGS) $(PYTHONL) -shared ../rpt/*.o rpt_wrap.o -lopencv_core -lopencv_imgproc -lopencv_calib3d -o _rpt.so