10 #include "pipelines/vocab_tree.h"
15 namespace reconstruction {
16 namespace vocab_tree {
20 static const std::unordered_map<std::string, std::string>
23 "Path to database in which to store the extracted data"},
24 {
"vocab_tree_path",
"The vocabulary tree path."},
26 "The desired number of visual words, i.e. the number of leaf "
27 "node clusters. Note that the actual number of visual words "
30 "The number of checks in the nearest neighbor search."},
32 "The branching factor of the hierarchical k-means tree."},
34 "The number of iterations for the clustering."},
35 {
"max_num_images",
"The maximum number of images."},
36 {
"database_image_list_path",
"The database image list path."},
37 {
"query_image_list_path",
"The query image list path."},
38 {
"output_index_path",
"The output index path."},
40 "The maximum number of most similar images to retrieve."},
42 "The number of nearest neighbor visual words that each "
43 "feature descriptor is assigned to."},
44 {
"num_images_after_verification",
45 "Whether to perform spatial verification after image "
47 {
"max_num_features",
"The maximum number of features."}};
50 m.def(
"build_vocab_tree", &BuildVocabTree,
51 py::call_guard<py::gil_scoped_release>(),
52 "Function for the building of vocabulary tree",
"database_path"_a,
53 "vocab_tree_path"_a,
"num_visual_words"_a = 256 * 256,
54 "num_checks"_a = 256,
"branching"_a = 256,
"num_iterations"_a = 11,
55 "max_num_images"_a = -1);
59 m.def(
"retrieve_vocab_tree", &RetrieveVocabTree,
60 py::call_guard<py::gil_scoped_release>(),
61 "Function for the retrieve of vocabulary tree",
"database_path"_a,
62 "vocab_tree_path"_a,
"output_index_path"_a =
"",
63 "query_image_list_path"_a =
"",
"database_image_list_path"_a =
"",
64 "max_num_images"_a = -1,
"num_neighbors"_a = 5,
"num_checks"_a = 256,
65 "num_images_after_verification"_a = 0,
"max_num_features"_a = -1);
71 py::module m_submodule =
72 m.def_submodule(
"vocab_tree",
"Reconstruction vocabulary tree.");
void FunctionDocInject(py::module &pybind_module, const std::string &function_name, const std::unordered_map< std::string, std::string > &map_parameter_body_docs)
static const std::unordered_map< std::string, std::string > map_shared_argument_docstrings
void pybind_vocab_tree_methods(py::module &m)
void pybind_vocab_tree(py::module &m)
Generic file read and write utility for python interface.