|
vocabtree
0.0.1
|
MatchesPage class keeps track of query images and their matches, and outputs an html page containing these matches for visualization purposes. More...
#include <matches_page.hpp>
Public Member Functions | |
| MatchesPage (uint32_t max_matches_per_page=16, uint32_t max_images_per_match=16) | |
| Ctor, max_matches_per_page specified the max number of rows per page, if this is set too high, the web browser might have problems loading the page. More... | |
| ~MatchesPage () | |
| void | add_match (uint32_t query_id, std::vector< uint64_t > &match_ids, const Dataset &dataset, std::shared_ptr< std::vector< int > > validated=nullptr) |
| Adds a match to the html_strings variable which will be written as html on write(). More... | |
| void | write (const std::string &folder) const |
| Writes out all the html match mages to the input specified folder. More... | |
Protected Member Functions | |
| std::string | stylesheet () const |
| std::string | header () const |
| Returns a string containing css stylesheet. More... | |
| std::string | footer () const |
| Returns a string containing the html header. More... | |
| std::string | navbar (uint32_t cur_page, uint32_t max_pages) const |
| Returns a string containing the html footer. More... | |
| std::string | pagename (uint32_t cur_page) const |
| Returns a string containing the navbar needed for pagination. More... | |
Protected Attributes | |
| std::vector< std::string > | html_strings |
| Returns a string containing the pagename (ex. matches_00001.html) More... | |
| uint32_t | max_matches_per_page_ |
| Holds the html strings for each match passed into add_match. More... | |
| uint32_t | max_images_per_match_ |
MatchesPage class keeps track of query images and their matches, and outputs an html page containing these matches for visualization purposes.
Definition at line 8 of file matches_page.hpp.
| MatchesPage::MatchesPage | ( | uint32_t | max_matches_per_page = 16, |
| uint32_t | max_images_per_match = 16 |
||
| ) |
Ctor, max_matches_per_page specified the max number of rows per page, if this is set too high, the web browser might have problems loading the page.
max_images_per_match specifies the max number of images in each row. If this is set too high, the web browser might have problems loading the page.
Definition at line 10 of file matches_page.cxx.
References max_images_per_match_, and max_matches_per_page_.
| MatchesPage::~MatchesPage | ( | ) |
Definition at line 15 of file matches_page.cxx.
| void MatchesPage::add_match | ( | uint32_t | query_id, |
| std::vector< uint64_t > & | match_ids, | ||
| const Dataset & | dataset, | ||
| std::shared_ptr< std::vector< int > > | validated = nullptr |
||
| ) |
Adds a match to the html_strings variable which will be written as html on write().
The query_id is the id of the image query. match_ids are the ids of the matches. Finally, dataset is used to figure out the image paths. If validated vector is provided, the web page will highlight validated matches, values should be zero if unvalidated,
0 if validated, and < 0 if failed validation. The validation vector can be smaller
than the size of match_ids, in which case it is assumed to correspond to beginning of match_ids.
Definition at line 19 of file matches_page.cxx.
References html_strings, Dataset::image(), Dataset::location(), and max_images_per_match_.
Referenced by bench_oxford(), benchmark_dataset(), and main().
|
protected |
Returns a string containing the html header.
Definition at line 113 of file matches_page.cxx.
Referenced by write().
|
protected |
Returns a string containing css stylesheet.
Definition at line 102 of file matches_page.cxx.
Referenced by write().
|
protected |
Returns a string containing the html footer.
Definition at line 121 of file matches_page.cxx.
Referenced by write().
|
protected |
Returns a string containing the navbar needed for pagination.
Definition at line 64 of file matches_page.cxx.
Referenced by write().
|
protected |
Definition at line 70 of file matches_page.cxx.
Referenced by write().
| void MatchesPage::write | ( | const std::string & | folder | ) | const |
Writes out all the html match mages to the input specified folder.
The first page will look something like folder/matches_00000.html.
Definition at line 40 of file matches_page.cxx.
References filesystem::create_file_directory(), filesystem::file_exists(), footer(), header(), html_strings, max_images_per_match_, max_matches_per_page_, navbar(), pagename(), s_stylesheet_name, stylesheet(), and filesystem::write_text().
Referenced by bench_oxford(), benchmark_dataset(), and main().
|
protected |
Returns a string containing the pagename (ex. matches_00001.html)
Definition at line 39 of file matches_page.hpp.
Referenced by add_match(), and write().
|
protected |
Definition at line 41 of file matches_page.hpp.
Referenced by add_match(), MatchesPage(), and write().
|
protected |
Holds the html strings for each match passed into add_match.
Definition at line 41 of file matches_page.hpp.
Referenced by MatchesPage(), and write().