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 "object_detection_3d_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> ObjectDetection3dAdapter<T, V>::ObjectDetection3dAdapter() : _source()
32 template<typename T, typename V> ObjectDetection3dAdapter<T, V>::~ObjectDetection3dAdapter()
35 template<typename T, typename V> void ObjectDetection3dAdapter<T, V>::create(int type)
37 switch (static_cast<object_detection_3d_task_type_e>(type)) {
38 case object_detection_3d_task_type_e::OBJECTRON:
39 _object_detection_3d = make_unique<Objectron>();
42 throw InvalidParameter("Invalid object detection task type.");
46 template<typename T, typename V> void ObjectDetection3dAdapter<T, V>::configure()
48 _object_detection_3d->parseMetaFile();
49 _object_detection_3d->configure();
52 template<typename T, typename V> void ObjectDetection3dAdapter<T, V>::prepare()
54 _object_detection_3d->prepare();
57 template<typename T, typename V> void ObjectDetection3dAdapter<T, V>::setInput(T &t)
62 template<typename T, typename V> void ObjectDetection3dAdapter<T, V>::perform()
64 _object_detection_3d->preprocess(_source.inference_src);
65 _object_detection_3d->inference(_source.inference_src);
68 template<typename T, typename V> V &ObjectDetection3dAdapter<T, V>::getOutput()
70 return _object_detection_3d->result();
73 template class ObjectDetection3dAdapter<object_detection_3d_input_s, object_detection_3d_result_s>;