mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 11:10:21 +08:00
Autotuned_index now prints all info into logger instead of couting it.
This commit is contained in:
parent
5042ab1f32
commit
dfdb09386f
@ -99,18 +99,22 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void buildIndex()
|
virtual void buildIndex()
|
||||||
{
|
{
|
||||||
|
std::ostringstream stream;
|
||||||
bestParams_ = estimateBuildParams();
|
bestParams_ = estimateBuildParams();
|
||||||
|
print_params(bestParams_, stream);
|
||||||
Logger::info("----------------------------------------------------\n");
|
Logger::info("----------------------------------------------------\n");
|
||||||
Logger::info("Autotuned parameters:\n");
|
Logger::info("Autotuned parameters:\n");
|
||||||
print_params(bestParams_);
|
Logger::info("%s", stream.str().c_str());
|
||||||
Logger::info("----------------------------------------------------\n");
|
Logger::info("----------------------------------------------------\n");
|
||||||
|
|
||||||
bestIndex_ = create_index_by_type(dataset_, bestParams_, distance_);
|
bestIndex_ = create_index_by_type(dataset_, bestParams_, distance_);
|
||||||
bestIndex_->buildIndex();
|
bestIndex_->buildIndex();
|
||||||
speedup_ = estimateSearchParams(bestSearchParams_);
|
speedup_ = estimateSearchParams(bestSearchParams_);
|
||||||
|
stream.str(std::string());
|
||||||
|
print_params(bestSearchParams_, stream);
|
||||||
Logger::info("----------------------------------------------------\n");
|
Logger::info("----------------------------------------------------\n");
|
||||||
Logger::info("Search parameters:\n");
|
Logger::info("Search parameters:\n");
|
||||||
print_params(bestSearchParams_);
|
Logger::info("%s", stream.str().c_str());
|
||||||
Logger::info("----------------------------------------------------\n");
|
Logger::info("----------------------------------------------------\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,17 +79,15 @@ T get_param(const IndexParams& params, std::string name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void print_params(const IndexParams& params)
|
inline void print_params(const IndexParams& params, std::ostringstream& stream)
|
||||||
{
|
{
|
||||||
IndexParams::const_iterator it;
|
IndexParams::const_iterator it;
|
||||||
|
|
||||||
for(it=params.begin(); it!=params.end(); ++it) {
|
for(it=params.begin(); it!=params.end(); ++it) {
|
||||||
std::cout << it->first << " : " << it->second << std::endl;
|
stream << it->first << " : " << it->second << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user