blob: 4005297f5a173bc57736dad17bfc3acf61b0f4bf [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
Kshitij Sisodiaaa5e1f62021-09-24 14:42:08 +01003#
Éanna Ó Catháin8f958872021-09-15 09:32:30 +01004# 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
Kshitij Sisodiaaa5e1f62021-09-24 14:42:08 +01007#
Éanna Ó Catháin8f958872021-09-15 09:32:30 +01008# http://www.apache.org/licenses/LICENSE-2.0
Kshitij Sisodiaaa5e1f62021-09-24 14:42:08 +01009#
Éanna Ó Catháin8f958872021-09-15 09:32:30 +010010# 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.
Kshitij Sisodiaaa5e1f62021-09-24 14:42:08 +010015
Éanna Ó Catháin8f958872021-09-15 09:32:30 +010016
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
Kshitij Sisodiaaa5e1f62021-09-24 14:42:08 +010033if (ETHOS_U_NPU_ENABLED)
Isabella Gottardi118f73e2021-09-16 17:54:35 +010034 set(DEFAULT_MODEL_PATH ${DEFAULT_MODEL_DIR}/vww4_128_128_INT8_vela_${DEFAULT_NPU_CONFIG_ID}.tflite)
Éanna Ó Catháin8f958872021-09-15 09:32:30 +010035else()
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}")