SOMHunter Core
search-context.h
Go to the documentation of this file.
1 /* This file is part of SOMHunter.
2  *
3  * Copyright (C) 2021 Frantisek Mejzlik <frankmejzlik@protonmail.com>
4  * Mirek Kratochvil <exa.exa@gmail.com>
5  * Patrik Vesely <prtrikvesely@gmail.com>
6  *
7  * SOMHunter is free software: you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License as published by the Free
9  * Software Foundation, either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * SOMHunter is distributed in the hope that it will be useful, but WITHOUT ANY
13  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * SOMHunter. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef SEARCH_CONTEXT_H_
22 #define SEARCH_CONTEXT_H_
23 
24 #include <optional>
25 #include <string>
26 #include <vector>
27 
28 #include "common.h"
29 #include "utils.hpp"
30 
31 #include "dataset-frames.h"
32 #include "query-types.h"
33 #include "scores.h"
34 
35 namespace sh {
36 class DatasetFrames;
37 class DatasetFeatures;
38 
44 struct SearchContext {
45  // *** METHODS ***
46 public:
47  SearchContext() = delete;
48  SearchContext(size_t ID, const Settings& _logger_settings, const DatasetFrames& _dataset_frames);
49  bool operator==(const SearchContext& other) const;
50  // ---
51 
52  void reset() {
54  reset_filters();
55  }
56  void reset_filters() { filters = Filters{}; }
57 
58  // *** MEMBER VARIABLES ***
59 public:
60  std::size_t ID;
61 
62  // VBS logging
64 
65  // Current display context
66  std::vector<VideoFramePointer> current_display;
68 
69  // Relevance scores
71 
72  // Size of temporal query
73  size_t temporal_size;
74 
75  // Used temporal queries
76  std::vector<TemporalQuery> last_temporal_queries;
77 
78  // Relevance feedback context
80 
83 
84  // Filepath to screenshot repesenting this screen
85  std::string screenshot_fpth{};
86 
87  std::string label;
88 
91 
93  std::vector<VideoFrame> curr_targets;
94 
96 };
97 
98 }; // namespace sh
99 
100 #endif // SEARCH_CONTEXT_H_
Definition: dataset-frames.h:162
Definition: scores.h:34
void reset_mask()
Definition: scores.h:103
Definition: common-types.h:33
std::set< FrameId > ShownFramesCont
Definition: common-types.h:88
std::set< FrameId > LikesCont
Definition: common-types.h:86
DisplayType
Definition: common-types.h:102
Container for all the available filters for the rescore.
Definition: query-types.h:103
The type representing the whole query.
Definition: query-types.h:470
Represents exactly one momentary state of a search session.
Definition: search-context.h:44
LikesCont likes
Definition: search-context.h:79
bool operator==(const SearchContext &other) const
Definition: search-context.cpp:37
std::vector< TemporalQuery > last_temporal_queries
Definition: search-context.h:76
std::vector< VideoFrame > curr_targets
Target we were looking for.
Definition: search-context.h:93
ShownFramesCont shown_images
Frames that were seen since the last rescore.
Definition: search-context.h:82
void reset()
Definition: search-context.h:52
ScoreModel scores
Definition: search-context.h:70
std::string label
Definition: search-context.h:87
UsedTools used_tools
Definition: search-context.h:63
void reset_filters()
Definition: search-context.h:56
std::size_t ID
Definition: search-context.h:60
Filters filters
Filters based on metadata (hour, weekday).
Definition: search-context.h:90
size_t temporal_size
Definition: search-context.h:73
SearchContext()=delete
Query _prev_query
Definition: search-context.h:95
DisplayType curr_disp_type
Definition: search-context.h:67
std::string screenshot_fpth
Definition: search-context.h:85
std::vector< VideoFramePointer > current_display
Definition: search-context.h:66
Parsed current config of the core.
Definition: settings.h:190
Definition: common-types.h:178