1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef TENSORFLOW_LITE_EXAMPLES_LABEL_CLASSIFY_H
17 #define TENSORFLOW_LITE_EXAMPLES_LABEL_CLASSIFY_H
18 
19 #include <iostream>
20 
21 #include "tensorflow/lite/model_builder.h"
22 #include "tensorflow/lite/string_type.h"
23 #include "tensorflow/lite/c/c_api_types.h"
24 
25 namespace tflite {
26 namespace label_classify {
27 struct Settings {
28     tflite::FlatBufferModel* model;
29     bool verbose = false;
30     bool accel = false;
31     bool printResult = false;
32     TfLiteType inputType = kTfLiteFloat32;
33     int32_t loopCount = 1;
34     float inputMean = 127.5f;
35     float inputStd = 127.5f;
36     string modelName = "./mbv2.tflite";
37     string inputBmpName = "./grace_hopper.bmp";
38     string labelsFileName = "./labels.txt";
39     string inputShape = "";
40     int32_t numberOfThreads = 1;
41     int32_t numberOfResults = 5;
42     int32_t numberOfWarmupRuns = 0;
43 };
44 } // namespace label_classify
45 } // namespace tflite
46 
47 #endif // TENSORFLOW_LITE_EXAMPLES_LABEL_CLASSIFY_H
48