7 #include <utils/logger.hpp>
13 #if ENABLE_MULTITHREADING && ENABLE_OPENMP
16 #if ENABLE_MULTITHREADING && ENABLE_MPI
20 _INITIALIZE_EASYLOGGINGPP
22 int main(
int argc,
char *argv[]) {
23 #if ENABLE_MULTITHREADING && ENABLE_MPI
24 MPI::Init(argc, argv);
29 LINFO << oxford_dataset;
31 std::stringstream vocab_output_file;
32 vocab_output_file << oxford_dataset.
location() <<
"/vocabulary/" << num_clusters <<
".vocab";
34 std::shared_ptr<BagOfWords> bow = std::make_shared<BagOfWords>(vocab_output_file.str());
37 std::shared_ptr<InvertedIndex::TrainParams> train_params = std::make_shared<InvertedIndex::TrainParams>();
38 train_params->bag_of_words = bow;
39 ii.
train(oxford_dataset, train_params, oxford_dataset.all_images());
41 std::stringstream index_output_file;
42 index_output_file << oxford_dataset.location() <<
"/index/" << num_clusters <<
".index";
44 ii.save(index_output_file.str());
46 #if ENABLE_MULTITHREADING && ENABLE_MPI