Skip to content

Commit a6ceb38

Browse files
authored
Merge branch 'openxrlab:main' into dev_nerf_viewer
2 parents a35f855 + 8a65361 commit a6ceb38

File tree

12 files changed

+115
-34
lines changed

12 files changed

+115
-34
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ concurrency:
2424

2525
jobs:
2626
build_cpp:
27-
runs-on: ubuntu-18.04
27+
runs-on: ubuntu-22.04
2828
defaults:
2929
run:
3030
shell: bash -l {0}
@@ -54,7 +54,7 @@ jobs:
5454
cd build
5555
wget -q https://openxrlab-share-mainland.oss-cn-hangzhou.aliyuncs.com/xrprimer/xrprimer.tar.gz
5656
tar -xzf xrprimer.tar.gz && rm xrprimer.tar.gz
57-
ln -sfn xrprimer/test test
57+
ln -sfn xrprimer/tests tests
5858
- name: Run unittests
5959
run: |
6060
source /root/miniconda3/etc/profile.d/conda.sh && conda activate openxrlab
@@ -75,7 +75,7 @@ jobs:
7575
# gcovr ${coverage_filter} -r . --object-directory=${CI_PROJECT_DIR}/build
7676
7777
build_py38:
78-
runs-on: ubuntu-18.04
78+
runs-on: ubuntu-22.04
7979
defaults:
8080
run:
8181
shell: bash -l {0}
@@ -103,7 +103,7 @@ jobs:
103103
cd python/tests
104104
wget -q https://openxrlab-share-mainland.oss-cn-hangzhou.aliyuncs.com/xrprimer/xrprimer.tar.gz
105105
tar -xzf xrprimer.tar.gz && rm xrprimer.tar.gz
106-
mv xrprimer/test/data ./
106+
mv xrprimer/tests/data ./
107107
rm -rf xrprimer && cd ../../
108108
- name: Install pytest plugin
109109
run: |

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ concurrency:
88

99
jobs:
1010
lint:
11-
runs-on: ubuntu-18.04
11+
runs-on: ubuntu-20.04
1212
steps:
1313
- uses: actions/checkout@v2
1414
- name: Set up Python 3.8

.github/workflows/publish-to-pypi.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
name: deploy
22

3-
on: push
3+
on:
4+
push:
5+
branches:
6+
- 'publish*'
7+
tags:
8+
- 'v*'
49

510
jobs:
611
build-n-publish:
7-
runs-on: ubuntu-18.04
8-
if: startsWith(github.event.ref, 'refs/tags')
12+
runs-on: ubuntu-22.04
913
container:
10-
image: openxrlab/xrprimer_ci:manylinux2014_x86_64_torch180_mmcv150
14+
image: openxrlab/xrprimer_ci:manylinux2014_x86_64_torch1110_mmcv170
1115
strategy:
1216
matrix:
1317
python-version: [3.6, 3.7, 3.8, 3.9, '3.10']
1418
steps:
1519
- uses: actions/checkout@v2
1620
- name: Build XRPrimer
1721
run: |
18-
source /workspace/init_env.sh && conda activate py-${{ matrix.python-version }}
22+
source /opt/miniconda/etc/profile.d/conda.sh && conda activate py-${{ matrix.python-version }}
1923
conan remote add openxrlab http://conan.openxrlab.org.cn/artifactory/api/conan/openxrlab
20-
python setup.py sdist bdist_wheel
24+
python setup.py bdist_wheel
2125
- name: Publish distribution to PyPI
2226
run: |
23-
source /workspace/init_env.sh && conda activate py-${{ matrix.python-version }}
24-
twine --h
25-
twine upload dist/* -u __token__ -p ${{ secrets.PYPI_PASSWORD }}
27+
for i in $( ls dist/*-linux_x86_64.whl ); do auditwheel repair $i; done
28+
du -sh wheelhouse/*
29+
for i in $( ls wheelhouse/*.whl ); do auditwheel show $i; done
30+
twine upload wheelhouse/* -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,3 +507,4 @@ inbox/*
507507
doxygen/
508508
3rdparty
509509
build_*/
510+
/wheelhouse

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exclude: .*/test/data/|.clang-format|(tests/catch.hpp)
1+
exclude: .*/tests/data/|.clang-format|(tests/catch.hpp)
22
repos:
33
- repo: https://github.com/pre-commit/mirrors-clang-format
44
rev: v14.0.1
@@ -28,7 +28,7 @@ repos:
2828
hooks:
2929
- id: trailing-whitespace
3030
args: [--markdown-linebreak-ext=md]
31-
exclude: .*/test/data/
31+
exclude: .*/tests/data/
3232
- id: check-yaml
3333
- id: end-of-file-fixer
3434
- id: requirements-txt-fixer

cpp/tests/test_calibrator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
TEST_CASE("test_calibrator", "MultiPinholeCamera") {
1010

1111
const std::string images_folder =
12-
"test/data/calib_pinhole_camera/input/images/";
12+
"tests/data/calib_pinhole_camera/input/images/";
1313
const std::string config_folder =
14-
"test/data/calib_pinhole_camera/input/config/";
14+
"tests/data/calib_pinhole_camera/input/config/";
1515

1616
std::vector<std::string> image_files;
1717
FileSysUtilsFindFilesInPath(images_folder, image_files);

cpp/tests/test_multi_camera_calibrator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
}
1313
"""
1414

15-
image_folder = 'test/data/calib_pinhole_camera/input/images/'
16-
camera_folder = 'test/data/calib_pinhole_camera/input/config/'
15+
image_folder = 'tests/data/calib_pinhole_camera/input/images/'
16+
camera_folder = 'tests/data/calib_pinhole_camera/input/config/'
1717

1818
if __name__ == '__main__':
1919

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#Download base image pypa/manylinux2014_x86_64
2+
FROM quay.io/pypa/manylinux2014_x86_64:latest
3+
4+
# Install wget
5+
RUN yum install wget atlas-devel \
6+
lapack-devel blas-devel \
7+
zlib \
8+
-y && \
9+
yum clean all
10+
# Install miniconda
11+
RUN wget -q \
12+
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
13+
&& bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/miniconda \
14+
&& rm -f Miniconda3-latest-Linux-x86_64.sh
15+
16+
# Prepare shared env
17+
RUN . /opt/miniconda/etc/profile.d/conda.sh && \
18+
conda activate base && \
19+
pip install conan==1.51.1 && \
20+
pip install twine && \
21+
pip cache purge
22+
RUN . /opt/miniconda/etc/profile.d/conda.sh && \
23+
conda activate base && \
24+
conda install cmake && \
25+
conda clean --all
26+
27+
# Link binaries to somewhere included in PATH
28+
RUN ln -s /opt/miniconda/bin/conan /opt/rh/devtoolset-10/root/usr/bin/conan && \
29+
ln -s /opt/miniconda/bin/twine /opt/rh/devtoolset-10/root/usr/bin/twine && \
30+
ln -s /opt/miniconda/bin/cmake /opt/rh/devtoolset-10/root/usr/bin/cmake
31+
32+
# Update in bashrc
33+
RUN echo "source /opt/miniconda/etc/profile.d/conda.sh" >> /root/.bashrc && \
34+
echo "conda deactivate" >> /root/.bashrc
35+
36+
ARG MMCV_VER
37+
ARG TORCH_VER
38+
ARG TORCHV_VER
39+
# Install py-3.6, py-3.7, py-3.8, py-3.9, py-3.10
40+
RUN . /opt/miniconda/etc/profile.d/conda.sh && \
41+
for i in 6 7 8 9 10; do \
42+
conda create -n "py-3.$i" python="3.$i" -y && \
43+
conda activate "py-3.$i" && \
44+
pip install --upgrade pip setuptools wheel && \
45+
pip install torch==$TORCH_VER torchvision==$TORCHV_VER && \
46+
pip install mmcv==$MMCV_VER && \
47+
pip cache purge && \
48+
conda clean --all; \
49+
done
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
MMCV_VER=1.7.0
3+
TORCH_VER=1.11.0
4+
TORCHV_VER=0.12.0
5+
MMCV_VER_DIGIT=${MMCV_VER//./}
6+
TORCH_VER_DIGIT=${TORCH_VER//./}
7+
TAG="openxrlab/xrprimer_ci:manylinux2014_x86_64_torch${TORCH_VER_DIGIT}_mmcv${MMCV_VER_DIGIT}"
8+
echo "tag to build: $TAG"
9+
BUILD_ARGS="--build-arg MMCV_VER=${MMCV_VER} --build-arg TORCH_VER=${TORCH_VER} --build-arg TORCHV_VER=${TORCHV_VER}"
10+
# build according to Dockerfile
11+
docker build -t $TAG -f dockerfiles/publish_manylinux/Dockerfile $BUILD_ARGS --progress=plain .

python/xrprimer/calibration/mview_fisheye_calibrator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ def __prepare_undistorted_frames__(
192192
distorted_cam=fisheye_param_list[view_idx],
193193
image_array=sview_img_arr)
194194
pinhole_param_list.append(pinhole_param)
195+
sview_img_list = [img_arr for img_arr in undist_img_arr]
195196
for img, frame_idx in zip(sview_img_list, sview_idx_list):
196197
path = os.path.join(
197198
self.work_dir,

0 commit comments

Comments
 (0)