Banuba SDK
BNBRecognizer.h
Go to the documentation of this file.
1 // AUTOGENERATED FILE - DO NOT MODIFY!
2 // This file generated by Djinni from recognizer.djinni
3 
4 #import "BNBFaceSearchMode.h"
5 #import "BNBFeatureId.h"
6 #import "BNBFrameData.h"
7 #import "BNBRecognizerMode.h"
8 #import <Foundation/Foundation.h>
9 @class BNBRecognizer;
10 @protocol BNBFeature;
11 
12 
13 @interface BNBRecognizer : NSObject
14 
15 /**
16  * @param maxTokens If greater than 0: recognizer will run processing on push-ed() frame only if it can "consume" a token -
17  * and will wait for the token to become available if all maxTokens tokens have been used up.
18  * Consumed tokens are "produced" again one-by-one when pop-ping() processed frame(s).
19  * This mode prevents processing frames more often than a consumer(e.g. renderer) can use:
20  * potentially reducing energy consumption at the cost of higher latency.
21  * Only for asynchronous mode.
22  */
23 + (nullable BNBRecognizer *)create:(BNBRecognizerMode)mode
24  maxTokens:(nullable NSNumber *)maxTokens;
25 
26 + (int64_t)getFeatureId:(BNBFeatureId)feature;
27 
28 - (nullable id<BNBFeature>)getFeature:(BNBFeatureId)feature;
29 
30 - (void)setFeatures:(nonnull NSSet<NSNumber *> *)features;
31 
32 - (void)addFeature:(nullable id<BNBFeature>)feature
33  dependencies:(nonnull NSSet<NSNumber *> *)dependencies
34  needsGpu:(BOOL)needsGpu;
35 
36 - (void)removeFeature:(nullable id<BNBFeature>)feature;
37 
38 /** sets maximum allowed face results, if face tracking feature is present */
39 - (void)setMaxFaces:(int32_t)num;
40 
41 - (void)setOfflineMode:(BOOL)on;
42 
43 /**
44  * Set flag which enable NN's features. True by default, if device compatible with NN player
45  * When this flag is false, recognizer will skip NN-dependent features during set_features call.
46  * In case when device have no NN player support (is_device_nn_compatible return false),
47  * setting enable to true have no any effect
48  */
49 - (void)setNnEnable:(BOOL)enable;
50 
51 - (BOOL)getNnEnable;
52 
53 /** Check if device compatible with NN player. */
54 - (BOOL)isDeviceNnCompatible;
55 
56 /** Clear pipeline state and set face search mode */
57 - (void)setFaceSearchMode:(BNBFaceSearchMode)mode;
58 
59 - (void)process:(nullable BNBFrameData *)frameData;
60 
61 - (void)pushCameraFrame:(nullable BNBFrameData *)inputFrameData;
62 
63 - (BOOL)popFrameData:(nullable BNBFrameData *)outputFrameData;
64 
65 /** start the recognizer */
66 - (void)start;
67 
68 /** pause the recognizer */
69 - (void)pause;
70 
71 /** pause + clear */
72 - (void)stop;
73 
74 /** clear input and output buffers and pipeline state, also clean cached features */
75 - (void)clear;
76 
77 @end
-[BNBRecognizer start]
void start()
start the recognizer
-[BNBRecognizer stop]
void stop()
pause + clear
BNBRecognizer
Definition: BNBRecognizer.h:14
-[BNBRecognizer isDeviceNnCompatible]
BOOL isDeviceNnCompatible()
Check if device compatible with NN player.
BNBRecognizerMode.h
BNBFeature-p
Definition: BNBFeature.h:8
BNBFaceSearchMode.h
-[BNBRecognizer getNnEnable]
BOOL getNnEnable()
-[BNBRecognizer pause]
void pause()
pause the recognizer
BNBFrameData.h
BNBFrameData
getters throw exceptions when data are not available android NNs usually output gpu masks
Definition: BNBFrameData.h:28
-[BNBRecognizer clear]
void clear()
clear input and output buffers and pipeline state, also clean cached features
BNBFeatureId.h