Banuba SDK
recognizer.hpp
Go to the documentation of this file.
1 /// \file
2 /// \addtogroup Recognizer
3 /// @{
4 ///
5 // AUTOGENERATED FILE - DO NOT MODIFY!
6 // This file was generated by Djinni from recognizer.djinni
7 
8 #pragma once
9 
12 #include <bnb/utils/defs.hpp>
13 #include <cstdint>
14 #include <memory>
15 #include <unordered_set>
16 
17 namespace bnb { namespace interfaces {
18 
19 class feature;
20 enum class recognizer_mode;
21 
22 class BNB_EXPORT recognizer {
23 public:
24  virtual ~recognizer() {}
25 
26  static std::shared_ptr<recognizer> create(recognizer_mode mode);
27 
28  static int64_t get_feature_id(::bnb::interfaces::feature_id feature);
29 
30  virtual std::shared_ptr<feature> get_feature(::bnb::interfaces::feature_id feature) = 0;
31 
32  virtual void set_features(const std::unordered_set<::bnb::interfaces::feature_id> & features) = 0;
33 
34  virtual void add_feature(const std::shared_ptr<feature> & feature, const std::unordered_set<::bnb::interfaces::feature_id> & dependencies) = 0;
35 
36  virtual void remove_feature(const std::shared_ptr<feature> & feature) = 0;
37 
38  /** sets maximum allowed face results, if face tracking feature is present */
39  virtual void set_max_faces(int32_t num) = 0;
40 
41  virtual void set_offline_mode(bool on) = 0;
42 
43  /**
44  * Set future frame filtrarion mode.
45  * Produce smoother recognition result (anti jitter), however adds inconsistency in push'ed/pop'ed frames (one frame lag)
46  * Applied only in push_camera_frame/pop_frame_data methods, when offline mode is disabled.
47  * Example: push frame 1 - pop frame 1, push frame 2 - pop frame 1, push frame 3 - pop frame 2, ...
48  */
49  virtual void set_use_future_filter(bool on) = 0;
50 
51  /**
52  * Set future frame interpolation mode.
53  * Produce faster recognition result (skip even frames), however adds inconsistency in push'ed/pop'ed frames (one frame lag)
54  * Applied only in push_camera_frame/pop_frame_data methods, when offline mode is disabled.
55  * Example: push frame 1 - pop frame 1, push frame 2 - pop frame 1, push frame 3 - pop frame 2, ...
56  */
57  virtual void set_use_future_interpolate(bool on) = 0;
58 
59  virtual void process(const std::shared_ptr<::bnb::interfaces::frame_data> & frame_data) = 0;
60 
61  virtual void push_camera_frame(const std::shared_ptr<::bnb::interfaces::frame_data> & input_frame_data) = 0;
62 
63  virtual bool pop_frame_data(const std::shared_ptr<::bnb::interfaces::frame_data> & output_frame_data) = 0;
64 
65  /** start the recognizer */
66  virtual void start() = 0;
67 
68  /** pause the recognizer */
69  virtual void pause() = 0;
70 
71  /** pause + clear */
72  virtual void stop() = 0;
73 
74  /** clear input and output buffers and pipeline state, also clean cached features */
75  virtual void clear() = 0;
76 };
77 
78 } } // namespace bnb::interfaces
79 /// @}
80 
frame_data.hpp
bnb::interfaces::recognizer
Definition: recognizer.hpp:22
bnb::interfaces::feature
Definition: feature.hpp:18
feature_id.hpp
bnb::interfaces::frame_data
getters throw exceptions when data are not available android NNs usually output gpu masks
Definition: frame_data.hpp:42