| 1 |
import pycolmap |
| 2 |
|
| 3 |
|
| 4 |
def test_image_score_class_exists(): |
| 5 |
score = pycolmap.ImageScore() |
| 6 |
assert score is not None |
| 7 |
|
| 8 |
|
| 9 |
def test_image_score_readonly_image_id(): |
| 10 |
score = pycolmap.ImageScore() |
| 11 |
assert isinstance(score.image_id, int) |
| 12 |
|
| 13 |
|
| 14 |
def test_image_score_readonly_score(): |
| 15 |
score = pycolmap.ImageScore() |
| 16 |
assert isinstance(score.score, (int, float)) |
| 17 |
|
| 18 |
|
| 19 |
def test_visual_index_index_options_init(): |
| 20 |
options = pycolmap.VisualIndex.IndexOptions() |
| 21 |
assert options is not None |
| 22 |
|
| 23 |
|
| 24 |
def test_visual_index_index_options_num_neighbors(): |
| 25 |
options = pycolmap.VisualIndex.IndexOptions() |
| 26 |
options.num_neighbors = 5 |
| 27 |
assert options.num_neighbors == 5 |
| 28 |
|
| 29 |
|
| 30 |
def test_visual_index_index_options_num_checks(): |
| 31 |
options = pycolmap.VisualIndex.IndexOptions() |
| 32 |
options.num_checks = 128 |
| 33 |
assert options.num_checks == 128 |
| 34 |
|
| 35 |
|
| 36 |
def test_visual_index_index_options_num_threads(): |
| 37 |
options = pycolmap.VisualIndex.IndexOptions() |
| 38 |
options.num_threads = 4 |
| 39 |
assert options.num_threads == 4 |
| 40 |
|
| 41 |
|
| 42 |
def test_visual_index_query_options_init(): |
| 43 |
options = pycolmap.VisualIndex.QueryOptions() |
| 44 |
assert options is not None |
| 45 |
|
| 46 |
|
| 47 |
def test_visual_index_query_options_max_num_images(): |
| 48 |
options = pycolmap.VisualIndex.QueryOptions() |
| 49 |
options.max_num_images = 50 |
| 50 |
assert options.max_num_images == 50 |
| 51 |
|
| 52 |
|
| 53 |
def test_visual_index_query_options_num_neighbors(): |
| 54 |
options = pycolmap.VisualIndex.QueryOptions() |
| 55 |
options.num_neighbors = 3 |
| 56 |
assert options.num_neighbors == 3 |
| 57 |
|
| 58 |
|
| 59 |
def test_visual_index_query_options_num_checks(): |
| 60 |
options = pycolmap.VisualIndex.QueryOptions() |
| 61 |
options.num_checks = 64 |
| 62 |
assert options.num_checks == 64 |
| 63 |
|
| 64 |
|
| 65 |
def test_visual_index_query_options_num_threads(): |
| 66 |
options = pycolmap.VisualIndex.QueryOptions() |
| 67 |
options.num_threads = 2 |
| 68 |
assert options.num_threads == 2 |
| 69 |
|
| 70 |
|
| 71 |
def test_visual_index_query_options_num_images_after_verification(): |
| 72 |
options = pycolmap.VisualIndex.QueryOptions() |
| 73 |
options.num_images_after_verification = 10 |
| 74 |
assert options.num_images_after_verification == 10 |
| 75 |
|
| 76 |
|
| 77 |
def test_visual_index_build_options_init(): |
| 78 |
options = pycolmap.VisualIndex.BuildOptions() |
| 79 |
assert options is not None |
| 80 |
|
| 81 |
|
| 82 |
def test_visual_index_build_options_num_visual_words(): |
| 83 |
options = pycolmap.VisualIndex.BuildOptions() |
| 84 |
options.num_visual_words = 1024 |
| 85 |
assert options.num_visual_words == 1024 |
| 86 |
|
| 87 |
|
| 88 |
def test_visual_index_build_options_num_iterations(): |
| 89 |
options = pycolmap.VisualIndex.BuildOptions() |
| 90 |
options.num_iterations = 5 |
| 91 |
assert options.num_iterations == 5 |
| 92 |
|
| 93 |
|
| 94 |
def test_visual_index_build_options_num_rounds(): |
| 95 |
options = pycolmap.VisualIndex.BuildOptions() |
| 96 |
options.num_rounds = 3 |
| 97 |
assert options.num_rounds == 3 |
| 98 |
|
| 99 |
|
| 100 |
def test_visual_index_build_options_num_checks(): |
| 101 |
options = pycolmap.VisualIndex.BuildOptions() |
| 102 |
options.num_checks = 256 |
| 103 |
assert options.num_checks == 256 |
| 104 |
|
| 105 |
|
| 106 |
def test_visual_index_build_options_num_threads(): |
| 107 |
options = pycolmap.VisualIndex.BuildOptions() |
| 108 |
options.num_threads = 8 |
| 109 |
assert options.num_threads == 8 |
| 110 |
|
| 111 |
|
| 112 |
def test_visual_index_create(): |
| 113 |
index = pycolmap.VisualIndex.create(128, 64) |
| 114 |
assert index is not None |
| 115 |
assert index.num_visual_words() == 0 |
| 116 |
assert index.num_images() == 0 |