Skip to content

Instantly share code, notes, and snippets.

@etrulls
Created February 4, 2020 10:24
Show Gist options
  • Save etrulls/ce1ceff98a0c115fa3d9967b17219535 to your computer and use it in GitHub Desktop.
Save etrulls/ce1ceff98a0c115fa3d9967b17219535 to your computer and use it in GitHub Desktop.
import numpy as np
from third_party.colmap.scripts.python.read_write_model import read_model, qvec2rotmat
src = '../rebuttal/results-colmap/'
considered = [5, 10, 25, 50, 100, 150, 200, 250, 300, 400, 500, 600]
cameras = {}
images = {}
names = {}
for cur in considered:
print(cur)
_cameras, _images, _points = read_model(path=src + 'split-{:04d}/dense/0/sparse'.format(cur), ext='.bin')
cameras[cur] = _cameras
images[cur] = _images
names[cur] = [_images[i].name.split('/')[-1] for i in _images]
s = set(names[considered[0]])
for n in considered[1:]:
s &= set(names[n])
common = list(s)
print('Found {} images in common'.format(len(common)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment