| 1 |
import pycolmap |
| 2 |
|
| 3 |
|
| 4 |
def test_database_cache_options_default_init(): |
| 5 |
options = pycolmap.DatabaseCacheOptions() |
| 6 |
assert options is not None |
| 7 |
|
| 8 |
|
| 9 |
def test_database_cache_options_min_num_matches_readwrite(): |
| 10 |
options = pycolmap.DatabaseCacheOptions() |
| 11 |
options.min_num_matches = 20 |
| 12 |
assert options.min_num_matches == 20 |
| 13 |
|
| 14 |
|
| 15 |
def test_database_cache_options_ignore_watermarks_readwrite(): |
| 16 |
options = pycolmap.DatabaseCacheOptions() |
| 17 |
options.ignore_watermarks = True |
| 18 |
assert options.ignore_watermarks is True |
| 19 |
|
| 20 |
|
| 21 |
def test_database_cache_options_load_all_images_readwrite(): |
| 22 |
options = pycolmap.DatabaseCacheOptions() |
| 23 |
options.load_all_images = True |
| 24 |
assert options.load_all_images is True |
| 25 |
|
| 26 |
|
| 27 |
def test_database_cache_create(populated_database): |
| 28 |
database, _, _ = populated_database |
| 29 |
options = pycolmap.DatabaseCacheOptions() |
| 30 |
options.load_all_images = True |
| 31 |
cache = pycolmap.DatabaseCache.create(database, options) |
| 32 |
assert cache.num_cameras() > 0 |
| 33 |
assert cache.num_images() > 0 |
| 34 |
|
| 35 |
|
| 36 |
def test_database_cache_cameras_property(populated_database): |
| 37 |
database, _, _ = populated_database |
| 38 |
options = pycolmap.DatabaseCacheOptions() |
| 39 |
options.load_all_images = True |
| 40 |
cache = pycolmap.DatabaseCache.create(database, options) |
| 41 |
assert cache.cameras is not None |
| 42 |
|
| 43 |
|
| 44 |
def test_database_cache_images_property(populated_database): |
| 45 |
database, _, _ = populated_database |
| 46 |
options = pycolmap.DatabaseCacheOptions() |
| 47 |
options.load_all_images = True |
| 48 |
cache = pycolmap.DatabaseCache.create(database, options) |
| 49 |
assert cache.images is not None |