1 /* 2 * Copyright 2019 The TensorFlow Authors. All Rights Reserved. 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 17 #ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_MAGIC_WAND_CONSTANTS_H_ 18 #define TENSORFLOW_LITE_MICRO_EXAMPLES_MAGIC_WAND_CONSTANTS_H_ 19 20 /* The expected accelerometer data sample frequency */ 21 const float kTargetHz = 25; 22 23 /* What gestures are supported. */ 24 constexpr int kGestureCount = 4; 25 constexpr int kWingGesture = 0; 26 constexpr int kRingGesture = 1; 27 constexpr int kSlopeGesture = 2; 28 constexpr int kNoGesture = 3; 29 30 /* These control the sensitivity of the detection algorithm. If you're seeing 31 * too many false positives or not enough true positives, you can try tweaking 32 * these thresholds. Often, increasing the size of the training set will give 33 * more robust results though, so consider retraining if you are seeing poor 34 * predictions. 35 */ 36 constexpr float kDetectionThreshold = 0.8f; 37 constexpr int kPredictionHistoryLength = 5; 38 constexpr int kPredictionSuppressionDuration = 25; 39 40 #endif /* TENSORFLOW_LITE_MICRO_EXAMPLES_MAGIC_WAND_CONSTANTS_H_ */ 41