blob: 9a732b76b7a4c23cfc77a0c077e05ffd6930b9a2 [file] [log] [blame]
Éanna Ó Catháin8f958872021-09-15 09:32:30 +01001# Copyright (c) 2021 Arm Limited. All rights reserved.
2# SPDX-License-Identifier: Apache-2.0
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
17USER_OPTION(${use_case}_FILE_PATH "Directory with custom image files, or path to a single image file, to use in the evaluation application"
18 ${CMAKE_CURRENT_SOURCE_DIR}/resources/${use_case}/samples/
19 PATH_OR_FILE)
20
21USER_OPTION(${use_case}_IMAGE_SIZE "Square image size in pixels. Images will be resized to this size."
22 128
23 STRING)
24
25USER_OPTION(${use_case}_LABELS_TXT_FILE "Labels' txt file for the chosen model"
26 ${CMAKE_CURRENT_SOURCE_DIR}/resources/${use_case}/labels/visual_wake_word_labels.txt
27 FILEPATH)
28
29USER_OPTION(${use_case}_ACTIVATION_BUF_SZ "Activation buffer size for the chosen model"
30 0x00200000
31 STRING)
32
33if (ETHOS_U55_ENABLED)
34 set(DEFAULT_MODEL_PATH ${DEFAULT_MODEL_DIR}/vww4_128_128_INT8_vela_H128.tflite)
35else()
36 set(DEFAULT_MODEL_PATH ${DEFAULT_MODEL_DIR}/vww4_128_128_INT8.tflite)
37endif()
38
39USER_OPTION(${use_case}_MODEL_TFLITE_PATH "NN models file to be used in the evaluation application. Model files must be in tflite format."
40 ${DEFAULT_MODEL_PATH}
41 FILEPATH)
42
43# Generate model file
44generate_tflite_code(
45 MODEL_PATH ${${use_case}_MODEL_TFLITE_PATH}
46 DESTINATION ${SRC_GEN_DIR}
47)
48
49# Generate labels file
50set(${use_case}_LABELS_CPP_FILE Labels)
51generate_labels_code(
52 INPUT "${${use_case}_LABELS_TXT_FILE}"
53 DESTINATION_SRC ${SRC_GEN_DIR}
54 DESTINATION_HDR ${INC_GEN_DIR}
55 OUTPUT_FILENAME "${${use_case}_LABELS_CPP_FILE}"
56)
57
58# Generate input files
59generate_images_code("${${use_case}_FILE_PATH}"
60 ${SRC_GEN_DIR}
61 ${INC_GEN_DIR}
62 "${${use_case}_IMAGE_SIZE}")