blob: 4c64433ebb3bb75b144dc3df409540ea40246f33 [file] [log] [blame]
Michael Levit06fcf752022-01-12 11:53:46 +02001/*
2 * Copyright (c) 2022 Arm Limited. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17#ifndef YOLO_FASTEST_MODEL_HPP
18#define YOLO_FASTEST_MODEL_HPP
19
20#include "Model.hpp"
21
Isabella Gottardi3107aa22022-01-27 16:39:37 +000022extern const int originalImageSize;
23extern const int channelsImageDisplayed;
24extern const float anchor1[];
25extern const float anchor2[];
26
Michael Levit06fcf752022-01-12 11:53:46 +020027namespace arm {
28namespace app {
29
30 class YoloFastestModel : public Model {
31
32 public:
33 /* Indices for the expected model - based on input tensor shape */
34 static constexpr uint32_t ms_inputRowsIdx = 1;
35 static constexpr uint32_t ms_inputColsIdx = 2;
36 static constexpr uint32_t ms_inputChannelsIdx = 3;
37
38 protected:
39 /** @brief Gets the reference to op resolver interface class. */
40 const tflite::MicroOpResolver& GetOpResolver() override;
41
42 /** @brief Adds operations to the op resolver instance. */
43 bool EnlistOperations() override;
44
Michael Levit06fcf752022-01-12 11:53:46 +020045 private:
46 /* Maximum number of individual operations that can be enlisted. */
47 static constexpr int ms_maxOpCnt = 8;
48
49 /* A mutable op resolver instance. */
50 tflite::MicroMutableOpResolver<ms_maxOpCnt> m_opResolver;
51 };
52
53} /* namespace app */
54} /* namespace arm */
55
56#endif /* YOLO_FASTEST_MODEL_HPP */