Skip to content

Commit 5687ab2

Browse files
authored
Merge pull request #1211 from ducha-aiki/pycolmap
Add pycolmap
2 parents e2c624b + 37ea223 commit 5687ab2

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

Dockerfile.tmpl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ARG TORCHAUDIO_VERSION
3636
ARG TORCHTEXT_VERSION
3737
ARG TORCHVISION_VERSION
3838

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

222222
RUN pip install scipy && \
223223
pip install scikit-learn && \
224-
# Scikit-learn accelerated library for x86
224+
# Scikit-learn accelerated library for x86
225225
# TODO(b/262387811#4) Unpin when the package is fixed.
226226
pip install scikit-learn-intelex==2021.6.3 && \
227227
# HDF5 support
@@ -336,7 +336,7 @@ RUN pip install mpld3 && \
336336
pip install mock && \
337337
/tmp/clean-layer.sh
338338

339-
RUN pip install tensorpack && \
339+
RUN pip install tensorpack && \
340340
# Add google PAIR-code Facets
341341
cd /opt/ && git clone https://github.com/PAIR-code/facets && cd facets/ && jupyter nbextension install facets-dist/ --user && \
342342
export PYTHONPATH=$PYTHONPATH:/opt/facets/facets_overview/python/ && \
@@ -374,7 +374,7 @@ RUN pip install --upgrade cython && \
374374
# 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.
375375
pip uninstall -y google-cloud-bigquery-storage && \
376376
# After launch this should be installed from pip
377-
pip install git+https://github.com/googleapis/python-aiplatform.git@mb-release && \
377+
pip install git+https://github.com/googleapis/python-aiplatform.git@mb-release && \
378378
pip install ortools && \
379379
pip install scattertext && \
380380
# Pandas data reader
@@ -493,7 +493,7 @@ RUN pip install flashtext && \
493493
# b/254245259 catalyst requires accelerate but it breaks with the version 0.13.1
494494
pip install accelerate==0.12.0 && \
495495
pip install catalyst && \
496-
# b/206990323 osmx 1.1.2 requires numpy >= 1.21 which we don't want.
496+
# b/206990323 osmx 1.1.2 requires numpy >= 1.21 which we don't want.
497497
pip install osmnx==1.1.1 && \
498498
apt-get -y install libspatialindex-dev && \
499499
pip install pytorch-ignite && \
@@ -526,6 +526,7 @@ RUN pip install flashtext && \
526526
pip install tables && \
527527
pip install openpyxl && \
528528
pip install timm && \
529+
pip install pycolmap && \
529530
/tmp/clean-layer.sh
530531

531532
# Download base easyocr models.

tests/test_pycolmap.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import unittest
2+
3+
import numpy as np
4+
import cv2
5+
import pycolmap
6+
7+
class TestPycolmap(unittest.TestCase):
8+
def test_sift(self):
9+
img = cv2.cvtColor(cv2.imread('/input/tests/data/face.jpg'), cv2.COLOR_BGR2GRAY)
10+
img = img.astype(np.float32)/255.
11+
sift = pycolmap.Sift()
12+
keypoints, scores, descriptors = sift.extract(img)
13+
self.assertEqual(keypoints.shape, (64, 4))

0 commit comments

Comments
 (0)