b67f6081e19fecf9e408dcebd42fe778487f0072
[platform/core/api/mediavision.git] / mv_machine_learning / face_recognition / include / facenet.h
1 /**
2  * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __FACENET_H__
18 #define __FACENET_H__
19
20 #include <mv_common.h>
21 #include <mv_inference_type.h>
22 #include "mv_private.h"
23
24 #include "EngineConfig.h"
25 #include "inference_engine_common_impl.h"
26 #include "Inference.h"
27 #include "facenet_parser.h"
28 #include "face_recognition_type.h"
29 #include "Preprocess.h"
30
31 namespace mediavision
32 {
33 namespace machine_learning
34 {
35 class Facenet
36 {
37 protected:
38         std::unique_ptr<mediavision::inference::Inference> _inference;
39         std::unique_ptr<MediaVision::Common::EngineConfig> _config;
40         std::unique_ptr<MetaParser> _parser;
41         facenet_output_s _result;
42         inference_engine_tensor_buffer *_outputTensorBuffer {};
43         Preprocess _preprocess;
44         std::string _modelFilePath;
45         std::string _modelMetaFilePath;
46         std::string _facenetOutputTensorName;
47         int _backendType {};
48         int _targetDeviceType {};
49
50 public:
51         Facenet();
52         virtual ~Facenet() = default;
53         void parseMetaFile();
54         void configure();
55         void prepare();
56         void preprocess(mv_source_h &mv_src);
57         void inference(mv_source_h source);
58         facenet_output_s &result();
59 };
60
61 } // machine_learning
62 } // mediavision
63
64 #endif