2 * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #include "machine_learning_exception.h"
18 #include "facenet_adapter.h"
21 using namespace MediaVision::Common;
22 using namespace mediavision::machine_learning;
23 using namespace mediavision::machine_learning::exception;
27 namespace machine_learning
29 template<typename T, typename V> FacenetAdapter<T, V>::FacenetAdapter() : _source()
31 _facenet = make_unique<Facenet>();
34 template<typename T, typename V> FacenetAdapter<T, V>::~FacenetAdapter()
37 template<typename T, typename V> void FacenetAdapter<T, V>::create(int type)
39 throw InvalidOperation("Not support yet.");
42 template<typename T, typename V> void FacenetAdapter<T, V>::configure()
44 _facenet->parseMetaFile();
45 _facenet->configure();
48 template<typename T, typename V> void FacenetAdapter<T, V>::prepare()
53 template<typename T, typename V> void FacenetAdapter<T, V>::setInput(T &t)
58 template<typename T, typename V> void FacenetAdapter<T, V>::perform()
60 _facenet->preprocess(_source.inputs[0]);
61 _facenet->inference(_source.inputs[0]);
64 template<typename T, typename V> V &FacenetAdapter<T, V>::getOutput()
66 return _facenet->result();
69 template class FacenetAdapter<FacenetInput, FacenetOutput>;