Skip to content

Add pycolmap #1211

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

Merged
merged 1 commit into from
Jan 24, 2023
Merged
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
11 changes: 6 additions & 5 deletions Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ARG TORCHAUDIO_VERSION
ARG TORCHTEXT_VERSION
ARG TORCHVISION_VERSION

# Disable pesky logs like: KMP_AFFINITY: pid 6121 tid 6121 thread 0 bound to OS proc set 0
# Disable pesky logs like: KMP_AFFINITY: pid 6121 tid 6121 thread 0 bound to OS proc set 0
# See: https://stackoverflow.com/questions/57385766/disable-tensorflow-log-information
ENV KMP_WARNINGS=0
# Also make the KMP logs noverbose.
Expand Down Expand Up @@ -221,7 +221,7 @@ RUN pip install ibis-framework && \

RUN pip install scipy && \
pip install scikit-learn && \
# Scikit-learn accelerated library for x86
# Scikit-learn accelerated library for x86
# TODO(b/262387811#4) Unpin when the package is fixed.
pip install scikit-learn-intelex==2021.6.3 && \
# HDF5 support
Expand Down Expand Up @@ -336,7 +336,7 @@ RUN pip install mpld3 && \
pip install mock && \
/tmp/clean-layer.sh

RUN pip install tensorpack && \
RUN pip install tensorpack && \
# Add google PAIR-code Facets
cd /opt/ && git clone https://github.com/PAIR-code/facets && cd facets/ && jupyter nbextension install facets-dist/ --user && \
export PYTHONPATH=$PYTHONPATH:/opt/facets/facets_overview/python/ && \
Expand Down Expand Up @@ -374,7 +374,7 @@ RUN pip install --upgrade cython && \
# b/183041606#comment5: the Kaggle data proxy doesn't support these APIs. If the library is missing, it falls back to using a regular BigQuery query to fetch data.
pip uninstall -y google-cloud-bigquery-storage && \
# After launch this should be installed from pip
pip install git+https://github.com/googleapis/python-aiplatform.git@mb-release && \
pip install git+https://github.com/googleapis/python-aiplatform.git@mb-release && \
pip install ortools && \
pip install scattertext && \
# Pandas data reader
Expand Down Expand Up @@ -493,7 +493,7 @@ RUN pip install flashtext && \
# b/254245259 catalyst requires accelerate but it breaks with the version 0.13.1
pip install accelerate==0.12.0 && \
pip install catalyst && \
# b/206990323 osmx 1.1.2 requires numpy >= 1.21 which we don't want.
# b/206990323 osmx 1.1.2 requires numpy >= 1.21 which we don't want.
pip install osmnx==1.1.1 && \
apt-get -y install libspatialindex-dev && \
pip install pytorch-ignite && \
Expand Down Expand Up @@ -526,6 +526,7 @@ RUN pip install flashtext && \
pip install tables && \
pip install openpyxl && \
pip install timm && \
pip install pycolmap && \
/tmp/clean-layer.sh

# Download base easyocr models.
Expand Down
13 changes: 13 additions & 0 deletions tests/test_pycolmap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import unittest

import numpy as np
import cv2
import pycolmap

class TestPycolmap(unittest.TestCase):
def test_sift(self):
img = cv2.cvtColor(cv2.imread('/input/tests/data/face.jpg'), cv2.COLOR_BGR2GRAY)
img = img.astype(np.float32)/255.
sift = pycolmap.Sift()
keypoints, scores, descriptors = sift.extract(img)
self.assertEqual(keypoints.shape, (64, 4))