blob: f6a3efe713d7b786b725a1b550b6f8706d3e43b2 [file] [log] [blame]
Kshitij Sisodiaaa4bcb12022-05-06 09:13:03 +01001#----------------------------------------------------------------------------
Éanna Ó Catháin8f958872021-09-15 09:32:30 +01002# Copyright (c) 2021 Arm Limited. All rights reserved.
3# SPDX-License-Identifier: Apache-2.0
Kshitij Sisodiaaa5e1f62021-09-24 14:42:08 +01004#
Éanna Ó Catháin8f958872021-09-15 09:32:30 +01005# 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
Kshitij Sisodiaaa5e1f62021-09-24 14:42:08 +01008#
Éanna Ó Catháin8f958872021-09-15 09:32:30 +01009# http://www.apache.org/licenses/LICENSE-2.0
Kshitij Sisodiaaa5e1f62021-09-24 14:42:08 +010010#
Éanna Ó Catháin8f958872021-09-15 09:32:30 +010011# 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.
Kshitij Sisodiaaa4bcb12022-05-06 09:13:03 +010016#----------------------------------------------------------------------------
Kshitij Sisodiaaa5e1f62021-09-24 14:42:08 +010017
Kshitij Sisodiaaa4bcb12022-05-06 09:13:03 +010018# Append the API to use for this use case
19list(APPEND ${use_case}_API_LIST "vww")
Éanna Ó Catháin8f958872021-09-15 09:32:30 +010020
21USER_OPTION(${use_case}_FILE_PATH "Directory with custom image files, or path to a single image file, to use in the evaluation application"
22 ${CMAKE_CURRENT_SOURCE_DIR}/resources/${use_case}/samples/
23 PATH_OR_FILE)
24
25USER_OPTION(${use_case}_IMAGE_SIZE "Square image size in pixels. Images will be resized to this size."
26 128
27 STRING)
28
29USER_OPTION(${use_case}_LABELS_TXT_FILE "Labels' txt file for the chosen model"
30 ${CMAKE_CURRENT_SOURCE_DIR}/resources/${use_case}/labels/visual_wake_word_labels.txt
31 FILEPATH)
32
33USER_OPTION(${use_case}_ACTIVATION_BUF_SZ "Activation buffer size for the chosen model"
34 0x00200000
35 STRING)
36
Kshitij Sisodiaaa5e1f62021-09-24 14:42:08 +010037if (ETHOS_U_NPU_ENABLED)
Kshitij Sisodia3be26232021-10-29 12:29:06 +010038 set(DEFAULT_MODEL_PATH ${DEFAULT_MODEL_DIR}/vww4_128_128_INT8_vela_${ETHOS_U_NPU_CONFIG_ID}.tflite)
Éanna Ó Catháin8f958872021-09-15 09:32:30 +010039else()
40 set(DEFAULT_MODEL_PATH ${DEFAULT_MODEL_DIR}/vww4_128_128_INT8.tflite)
41endif()
42
43USER_OPTION(${use_case}_MODEL_TFLITE_PATH "NN models file to be used in the evaluation application. Model files must be in tflite format."
44 ${DEFAULT_MODEL_PATH}
45 FILEPATH)
46
47# Generate model file
48generate_tflite_code(
49 MODEL_PATH ${${use_case}_MODEL_TFLITE_PATH}
50 DESTINATION ${SRC_GEN_DIR}
51)
52
53# Generate labels file
54set(${use_case}_LABELS_CPP_FILE Labels)
55generate_labels_code(
56 INPUT "${${use_case}_LABELS_TXT_FILE}"
57 DESTINATION_SRC ${SRC_GEN_DIR}
58 DESTINATION_HDR ${INC_GEN_DIR}
59 OUTPUT_FILENAME "${${use_case}_LABELS_CPP_FILE}"
60)
61
62# Generate input files
63generate_images_code("${${use_case}_FILE_PATH}"
64 ${SRC_GEN_DIR}
65 ${INC_GEN_DIR}
66 "${${use_case}_IMAGE_SIZE}")