From ac960b6b5a3b8a4cd69d59e63914a971e9bac8e2 Mon Sep 17 00:00:00 2001 From: Daniel Situnayake Date: Tue, 8 Oct 2019 14:16:19 -0700 Subject: [PATCH] Rename gesture_recognition example to magic_wand, and micro_vision example to person_detection PiperOrigin-RevId: 273603061 --- tensorflow/lite/experimental/micro/README.md | 10 ++- .../examples/gesture_recognition/Makefile.inc | 89 ------------------- .../{gesture_recognition => magic_wand}/BUILD | 24 ++--- .../micro/examples/magic_wand/Makefile.inc | 89 +++++++++++++++++++ .../README.md | 24 ++--- .../accelerometer_handler.cc | 2 +- .../accelerometer_handler.h | 6 +- .../accelerometer_handler_test.cc | 2 +- .../angle_micro_features_data.cc | 2 +- .../angle_micro_features_data.h | 6 +- .../arduino/accelerometer_handler.cc | 4 +- .../arduino/constants.cc | 2 +- .../arduino/main.cc | 0 .../arduino/output_handler.cc | 2 +- .../circle_micro_features_data.cc | 2 +- .../circle_micro_features_data.h | 6 +- .../constants.cc | 2 +- .../constants.h | 6 +- .../gesture_predictor.cc | 4 +- .../gesture_predictor.h | 6 +- .../gesture_predictor_test.cc | 4 +- .../magic_wand_model_data.cc} | 8 +- .../magic_wand_model_data.h} | 12 +-- .../magic_wand_test.cc} | 8 +- .../{micro_vision => magic_wand}/main.cc | 2 +- .../main_functions.cc | 12 +-- .../main_functions.h | 6 +- .../output_handler.cc | 2 +- .../output_handler.h | 6 +- .../output_handler_test.cc | 2 +- .../sparkfun_edge/accelerometer_handler.cc | 2 +- .../sparkfun_edge/output_handler.cc | 2 +- .../micro/examples/micro_vision/Makefile.inc | 68 -------------- .../micro_vision/himax_driver/Makefile.inc | 14 --- .../{micro_vision => person_detection}/BUILD | 2 +- .../examples/person_detection/Makefile.inc | 68 ++++++++++++++ .../README.md | 10 +-- .../apollo3evb/image_provider.cc | 12 +-- .../arduino/main.cc | 2 +- .../detection_responder.cc | 2 +- .../detection_responder.h | 6 +- .../detection_responder_test.cc | 2 +- .../himax_driver/HM01B0.c | 0 .../himax_driver/HM01B0.h | 6 +- .../HM01B0_RAW8_QVGA_8bits_lsb_5fps.h | 6 +- .../himax_driver/HM01B0_Walking1s_01.h | 6 +- .../himax_driver/HM01B0_Walking1s_01.txt | 0 .../himax_driver/HM01B0_debug.c | 0 .../himax_driver/HM01B0_debug.h | 6 +- .../himax_driver/HM01B0_optimized.c | 0 .../himax_driver/HM01B0_optimized.h | 6 +- .../himax_driver/Makefile.inc | 14 +++ .../himax_driver/platform_Sparkfun_Edge.h | 6 +- .../image_provider.cc | 4 +- .../image_provider.h | 6 +- .../image_provider_test.cc | 4 +- .../main.cc | 2 +- .../main_functions.cc | 10 +-- .../main_functions.h | 6 +- .../model_settings.cc | 2 +- .../model_settings.h | 6 +- .../no_person_image_data.h | 6 +- .../person_detect_model_data.h | 6 +- .../person_detection_test.cc} | 8 +- .../person_image_data.h | 6 +- .../sparkfun_edge/detection_responder.cc | 2 +- .../sparkfun_edge/image_provider.cc | 12 +-- .../utils/BUILD | 0 .../utils/raw_to_bitmap.py | 0 .../utils/raw_to_bitmap_test.py | 4 +- .../tools/ci_build/install_arduino_cli.sh | 2 +- .../tools/make/fix_arduino_subfolders.py | 4 +- .../tools/make/fix_arduino_subfolders_test.sh | 6 +- .../tools/make/third_party_downloads.inc | 4 +- .../g3doc/microcontrollers/get_started.md | 4 +- 75 files changed, 349 insertions(+), 345 deletions(-) delete mode 100644 tensorflow/lite/experimental/micro/examples/gesture_recognition/Makefile.inc rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/BUILD (81%) create mode 100644 tensorflow/lite/experimental/micro/examples/magic_wand/Makefile.inc rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/README.md (94%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/accelerometer_handler.cc (93%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/accelerometer_handler.h (78%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/accelerometer_handler_test.cc (94%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/angle_micro_features_data.cc (97%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/angle_micro_features_data.h (73%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/arduino/accelerometer_handler.cc (95%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/arduino/constants.cc (90%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/arduino/main.cc (100%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/arduino/output_handler.cc (95%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/circle_micro_features_data.cc (97%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/circle_micro_features_data.h (73%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/constants.cc (90%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/constants.h (77%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/gesture_predictor.cc (90%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/gesture_predictor.h (71%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/gesture_predictor_test.cc (92%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition/gesture_recognition_model_data.cc => magic_wand/magic_wand_model_data.cc} (99%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition/gesture_recognition_model_data.h => magic_wand/magic_wand_model_data.h} (63%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition/gesture_recognition_test.cc => magic_wand/magic_wand_test.cc} (94%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => magic_wand}/main.cc (92%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/main_functions.cc (91%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => magic_wand}/main_functions.h (79%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/output_handler.cc (93%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/output_handler.h (75%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/output_handler_test.cc (92%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/sparkfun_edge/accelerometer_handler.cc (98%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => magic_wand}/sparkfun_edge/output_handler.cc (97%) delete mode 100644 tensorflow/lite/experimental/micro/examples/micro_vision/Makefile.inc delete mode 100644 tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/Makefile.inc rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/BUILD (98%) create mode 100644 tensorflow/lite/experimental/micro/examples/person_detection/Makefile.inc rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/README.md (95%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/apollo3evb/image_provider.cc (90%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/arduino/main.cc (90%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/detection_responder.cc (92%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/detection_responder.h (83%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/detection_responder_test.cc (93%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/himax_driver/HM01B0.c (100%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/himax_driver/HM01B0.h (97%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/himax_driver/HM01B0_RAW8_QVGA_8bits_lsb_5fps.h (96%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/himax_driver/HM01B0_Walking1s_01.h (80%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/himax_driver/HM01B0_Walking1s_01.txt (100%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/himax_driver/HM01B0_debug.c (100%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/himax_driver/HM01B0_debug.h (83%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/himax_driver/HM01B0_optimized.c (100%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/himax_driver/HM01B0_optimized.h (83%) create mode 100644 tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/Makefile.inc rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/himax_driver/platform_Sparkfun_Edge.h (82%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/image_provider.cc (84%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/image_provider.h (87%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/image_provider_test.cc (89%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => person_detection}/main.cc (91%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/main_functions.cc (91%) rename tensorflow/lite/experimental/micro/examples/{gesture_recognition => person_detection}/main_functions.h (78%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/model_settings.cc (89%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/model_settings.h (82%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/no_person_image_data.h (79%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/person_detect_model_data.h (78%) rename tensorflow/lite/experimental/micro/examples/{micro_vision/micro_vision_test.cc => person_detection/person_detection_test.cc} (94%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/person_image_data.h (79%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/sparkfun_edge/detection_responder.cc (95%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/sparkfun_edge/image_provider.cc (91%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/utils/BUILD (100%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/utils/raw_to_bitmap.py (100%) rename tensorflow/lite/experimental/micro/examples/{micro_vision => person_detection}/utils/raw_to_bitmap_test.py (95%) diff --git a/tensorflow/lite/experimental/micro/README.md b/tensorflow/lite/experimental/micro/README.md index d9dac493f2d..4e22f37e2bd 100644 --- a/tensorflow/lite/experimental/micro/README.md +++ b/tensorflow/lite/experimental/micro/README.md @@ -54,15 +54,19 @@ The following examples are available: * Colab walkthrough of model training and conversion - [micro_speech](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/experimental/micro/examples/micro_speech) - * Uses a 20kb model to recognize keywords in spoken audio + * Uses a 20 KB model to recognize keywords in spoken audio * Application code for Arduino, SparkFun Edge, and STM32F746 * Python scripts for model training and conversion -- [micro_vision](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/experimental/micro/examples/micro_vision) - * Uses a 250kb model to recognize presence or absence of a person in images +- [person_detection](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/experimental/micro/examples/person_detection) + * Uses a 250 KB model to recognize presence or absence of a person in images captured by a camera * Application code for SparkFun Edge +- [magic_wand](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/experimental/micro/examples/magic_wand) + * Uses a 20 KB model to recognize gestures using accelerometer data + * Application code for Arduino and SparkFun Edge + ## Pre-generated Project Files One of the challenges of embedded software development is that there are a lot diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/Makefile.inc b/tensorflow/lite/experimental/micro/examples/gesture_recognition/Makefile.inc deleted file mode 100644 index ced07017a9b..00000000000 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/Makefile.inc +++ /dev/null @@ -1,89 +0,0 @@ -ifeq ($(TARGET), sparkfun_edge) - INCLUDES += \ - -I$(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_accelerometer/ \ - -I$(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_adc/ - - THIRD_PARTY_CC_SRCS += \ - $(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_accelerometer/tf_accelerometer.c \ - $(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_accelerometer/lis2dh12_reg.c \ - $(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_adc/tf_adc.c - - THIRD_PARTY_CC_HDRS += \ - $(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_accelerometer/tf_accelerometer.h \ - $(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_accelerometer/lis2dh12_reg.h \ - $(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_adc/tf_adc.h -endif - -ACCELEROMETER_HANDLER_TEST_SRCS := \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.cc \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler_test.cc - -ACCELEROMETER_HANDLER_TEST_HDRS := \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.h - -OUTPUT_HANDLER_TEST_SRCS := \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.cc \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler_test.cc - -OUTPUT_HANDLER_TEST_HDRS := \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.h - -GESTURE_PREDICTOR_TEST_SRCS := \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.cc \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor.cc \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor_test.cc - -GESTURE_PREDICTOR_TEST_HDRS := \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.h \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor.h \ - -GESTURE_RECOGNITION_TEST_SRCS := \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_test.cc \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_model_data.cc \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/angle_micro_features_data.cc \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/circle_micro_features_data.cc - -GESTURE_RECOGNITION_TEST_HDRS := \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_model_data.h \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/angle_micro_features_data.h \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/circle_micro_features_data.h - -GESTURE_RECOGNITION_SRCS := \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/main.cc \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/main_functions.cc \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.cc \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_model_data.cc \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.cc \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor.cc \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.cc - -GESTURE_RECOGNITION_HDRS := \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/main_functions.h \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.h \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_model_data.h \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.h \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor.h \ -tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.h - -# Find any platform-specific rules for this example. -include $(wildcard tensorflow/lite/experimental/micro/examples/gesture_recognition/*/Makefile.inc) - -# Tests the accelerometer handler -$(eval $(call microlite_test,gesture_accelerometer_handler_test,\ -$(ACCELEROMETER_HANDLER_TEST_SRCS),$(ACCELEROMETER_HANDLER_TEST_HDRS))) - -# Tests the output handler -$(eval $(call microlite_test,gesture_output_handler_test,\ -$(OUTPUT_HANDLER_TEST_SRCS),$(OUTPUT_HANDLER_TEST_HDRS))) - -# Tests the gesture predictor -$(eval $(call microlite_test,gesture_predictor_test,\ -$(GESTURE_PREDICTOR_TEST_SRCS),$(GESTURE_PREDICTOR_TEST_HDRS))) - -# Tests loading and running the gesture recognition model -$(eval $(call microlite_test,gesture_recognition_test,\ -$(GESTURE_RECOGNITION_TEST_SRCS),$(GESTURE_RECOGNITION_TEST_HDRS))) - -# Builds a standalone binary -$(eval $(call microlite_test,gesture_recognition,\ -$(GESTURE_RECOGNITION_SRCS),$(GESTURE_RECOGNITION_HDRS))) diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/BUILD b/tensorflow/lite/experimental/micro/examples/magic_wand/BUILD similarity index 81% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/BUILD rename to tensorflow/lite/experimental/micro/examples/magic_wand/BUILD index ec04566bea0..57c2daa3379 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/BUILD +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/BUILD @@ -11,12 +11,12 @@ load( ) cc_library( - name = "gesture_recognition_model_data", + name = "magic_wand_model_data", srcs = [ - "gesture_recognition_model_data.cc", + "magic_wand_model_data.cc", ], hdrs = [ - "gesture_recognition_model_data.h", + "magic_wand_model_data.h", ], ) @@ -33,12 +33,12 @@ cc_library( ) tflite_micro_cc_test( - name = "gesture_recognition_test", + name = "magic_wand_test", srcs = [ - "gesture_recognition_test.cc", + "magic_wand_test.cc", ], deps = [ - ":gesture_recognition_model_data", + ":magic_wand_model_data", ":sample_feature_data", "//tensorflow/lite:schema_fbs_version", "//tensorflow/lite/experimental/micro:micro_framework", @@ -140,7 +140,7 @@ tflite_micro_cc_test( ) cc_binary( - name = "gesture_recognition", + name = "magic_wand", srcs = [ "main.cc", "main_functions.cc", @@ -154,11 +154,11 @@ cc_binary( deps = [ "//tensorflow/lite:schema_fbs_version", "//tensorflow/lite/experimental/micro:micro_framework", - "//tensorflow/lite/experimental/micro/examples/gesture_recognition:accelerometer_handler", - "//tensorflow/lite/experimental/micro/examples/gesture_recognition:constants", - "//tensorflow/lite/experimental/micro/examples/gesture_recognition:gesture_predictor", - "//tensorflow/lite/experimental/micro/examples/gesture_recognition:gesture_recognition_model_data", - "//tensorflow/lite/experimental/micro/examples/gesture_recognition:output_handler", + "//tensorflow/lite/experimental/micro/examples/magic_wand:accelerometer_handler", + "//tensorflow/lite/experimental/micro/examples/magic_wand:constants", + "//tensorflow/lite/experimental/micro/examples/magic_wand:gesture_predictor", + "//tensorflow/lite/experimental/micro/examples/magic_wand:magic_wand_model_data", + "//tensorflow/lite/experimental/micro/examples/magic_wand:output_handler", "//tensorflow/lite/experimental/micro/kernels:all_ops_resolver", "//tensorflow/lite/schema:schema_fbs", ], diff --git a/tensorflow/lite/experimental/micro/examples/magic_wand/Makefile.inc b/tensorflow/lite/experimental/micro/examples/magic_wand/Makefile.inc new file mode 100644 index 00000000000..e1fcbe59be4 --- /dev/null +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/Makefile.inc @@ -0,0 +1,89 @@ +ifeq ($(TARGET), sparkfun_edge) + INCLUDES += \ + -I$(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_accelerometer/ \ + -I$(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_adc/ + + THIRD_PARTY_CC_SRCS += \ + $(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_accelerometer/tf_accelerometer.c \ + $(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_accelerometer/lis2dh12_reg.c \ + $(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_adc/tf_adc.c + + THIRD_PARTY_CC_HDRS += \ + $(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_accelerometer/tf_accelerometer.h \ + $(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_accelerometer/lis2dh12_reg.h \ + $(APOLLO3_SDK)/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_adc/tf_adc.h +endif + +ACCELEROMETER_HANDLER_TEST_SRCS := \ +tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.cc \ +tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler_test.cc + +ACCELEROMETER_HANDLER_TEST_HDRS := \ +tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.h + +OUTPUT_HANDLER_TEST_SRCS := \ +tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.cc \ +tensorflow/lite/experimental/micro/examples/magic_wand/output_handler_test.cc + +OUTPUT_HANDLER_TEST_HDRS := \ +tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.h + +GESTURE_PREDICTOR_TEST_SRCS := \ +tensorflow/lite/experimental/micro/examples/magic_wand/constants.cc \ +tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor.cc \ +tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor_test.cc + +GESTURE_PREDICTOR_TEST_HDRS := \ +tensorflow/lite/experimental/micro/examples/magic_wand/constants.h \ +tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor.h \ + +magic_wand_TEST_SRCS := \ +tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_test.cc \ +tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_model_data.cc \ +tensorflow/lite/experimental/micro/examples/magic_wand/angle_micro_features_data.cc \ +tensorflow/lite/experimental/micro/examples/magic_wand/circle_micro_features_data.cc + +magic_wand_TEST_HDRS := \ +tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_model_data.h \ +tensorflow/lite/experimental/micro/examples/magic_wand/angle_micro_features_data.h \ +tensorflow/lite/experimental/micro/examples/magic_wand/circle_micro_features_data.h + +magic_wand_SRCS := \ +tensorflow/lite/experimental/micro/examples/magic_wand/main.cc \ +tensorflow/lite/experimental/micro/examples/magic_wand/main_functions.cc \ +tensorflow/lite/experimental/micro/examples/magic_wand/constants.cc \ +tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_model_data.cc \ +tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.cc \ +tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor.cc \ +tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.cc + +magic_wand_HDRS := \ +tensorflow/lite/experimental/micro/examples/magic_wand/main_functions.h \ +tensorflow/lite/experimental/micro/examples/magic_wand/constants.h \ +tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_model_data.h \ +tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.h \ +tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor.h \ +tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.h + +# Find any platform-specific rules for this example. +include $(wildcard tensorflow/lite/experimental/micro/examples/magic_wand/*/Makefile.inc) + +# Tests the accelerometer handler +$(eval $(call microlite_test,gesture_accelerometer_handler_test,\ +$(ACCELEROMETER_HANDLER_TEST_SRCS),$(ACCELEROMETER_HANDLER_TEST_HDRS))) + +# Tests the output handler +$(eval $(call microlite_test,gesture_output_handler_test,\ +$(OUTPUT_HANDLER_TEST_SRCS),$(OUTPUT_HANDLER_TEST_HDRS))) + +# Tests the gesture predictor +$(eval $(call microlite_test,gesture_predictor_test,\ +$(GESTURE_PREDICTOR_TEST_SRCS),$(GESTURE_PREDICTOR_TEST_HDRS))) + +# Tests loading and running the gesture recognition model +$(eval $(call microlite_test,magic_wand_test,\ +$(magic_wand_TEST_SRCS),$(magic_wand_TEST_HDRS))) + +# Builds a standalone binary +$(eval $(call microlite_test,magic_wand,\ +$(magic_wand_SRCS),$(magic_wand_HDRS))) diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/README.md b/tensorflow/lite/experimental/micro/examples/magic_wand/README.md similarity index 94% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/README.md rename to tensorflow/lite/experimental/micro/examples/magic_wand/README.md index ea1d1048479..da3576ade93 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/README.md +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/README.md @@ -1,12 +1,12 @@ -# Gesture Recognition example +# Magic wand example This example shows how you can use TensorFlow Lite to run a 20 kilobyte neural -network model to recognize magic gestures. It's designed to run on systems with -very small amounts of memory such as microcontrollers. +network model to recognize gestures with an accelerometer. It's designed to run +on systems with very small amounts of memory, such as microcontrollers. -The example application reads data from the accelerometer on the SparkFun Edge -and indicates when it has detected a gesture, then outputs the gesture on -screen. +The example application reads data from the accelerometer on an Arduino Nano 33 +BLE Sense or SparkFun Edge board and indicates when it has detected a gesture, +then outputs the gesture to the serial port. ## Table of contents @@ -30,7 +30,7 @@ tensorflow/tensorflow/lite/experimental/micro/examples/ folder, then `cd` into the source directory from a terminal and run the following command: ```bash -make -f tensorflow/lite/experimental/micro/tools/make/Makefile test_gesture_recognition_test +make -f tensorflow/lite/experimental/micro/tools/make/Makefile test_magic_wand_test ``` This will take a few minutes, and downloads frameworks the code uses like @@ -63,7 +63,7 @@ The sample has been tested with the following devices: To use this sample application with Arduino, we've created an Arduino library that includes it as an example that you can open in the Arduino Desktop IDE. -Download the current nightly build of the library: [hello_world.zip](https://storage.googleapis.com/tensorflow-nightly/github/tensorflow/tensorflow/lite/experimental/micro/tools/make/gen/arduino_x86_64/prj/gesture_recognition/gesture_recognition.zip) +Download the current nightly build of the library: [hello_world.zip](https://storage.googleapis.com/tensorflow-nightly/github/tensorflow/tensorflow/lite/experimental/micro/tools/make/gen/arduino_x86_64/prj/magic_wand/magic_wand.zip) Next, import this zip file into the Arduino Desktop IDE by going to `Sketch -> Include Library -> Add .ZIP Library...`. @@ -127,7 +127,7 @@ Next, save the file. Patching is now complete. Once the library has been added, go to `File -> Examples`. You should see an example near the bottom of the list named `TensorFlowLite`. Select -it and click `gesture_recognition` to load the example. +it and click `magic_wand` to load the example. Use the Arduino Desktop IDE to build and upload the example. Once it is running, you should see the built-in LED on your device flashing. @@ -191,13 +191,13 @@ codelab to get an understanding of the workflow. Run the following command to build a binary for SparkFun Edge. ``` -make -f tensorflow/lite/experimental/micro/tools/make/Makefile TARGET=sparkfun_edge gesture_recognition_bin +make -f tensorflow/lite/experimental/micro/tools/make/Makefile TARGET=sparkfun_edge magic_wand_bin ``` The binary will be created in the following location: ``` -tensorflow/lite/experimental/micro/tools/make/gen/sparkfun_edge_cortex-m4/bin/gesture_recognition.bin +tensorflow/lite/experimental/micro/tools/make/gen/sparkfun_edge_cortex-m4/bin/magic_wand.bin ``` ### Sign the binary @@ -219,7 +219,7 @@ Next, run the following command to create a signed binary: ``` python3 tensorflow/lite/experimental/micro/tools/make/downloads/AmbiqSuite-Rel2.0.0/tools/apollo3_scripts/create_cust_image_blob.py \ ---bin tensorflow/lite/experimental/micro/tools/make/gen/sparkfun_edge_cortex-m4/bin/gesture_recognition.bin \ +--bin tensorflow/lite/experimental/micro/tools/make/gen/sparkfun_edge_cortex-m4/bin/magic_wand.bin \ --load-address 0xC000 \ --magic-num 0xCB \ -o main_nonsecure_ota \ diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.cc similarity index 93% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.cc index 69d4a394c2e..3b62f6a5bc2 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.h" int begin_index = 0; diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.h b/tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.h similarity index 78% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.h rename to tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.h index 77601b6dd7b..1fcacc39d84 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.h +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_ACCELEROMETER_HANDLER_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_ACCELEROMETER_HANDLER_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_ACCELEROMETER_HANDLER_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_ACCELEROMETER_HANDLER_H_ #define kChannelNumber 3 @@ -26,4 +26,4 @@ extern TfLiteStatus SetupAccelerometer(tflite::ErrorReporter* error_reporter); extern bool ReadAccelerometer(tflite::ErrorReporter* error_reporter, float* input, int length, bool reset_buffer); -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_ACCELEROMETER_HANDLER_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_ACCELEROMETER_HANDLER_H_ diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler_test.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler_test.cc similarity index 94% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler_test.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler_test.cc index 4b0874f5cd3..e956a0cee13 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler_test.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler_test.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.h" #include diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/angle_micro_features_data.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/angle_micro_features_data.cc similarity index 97% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/angle_micro_features_data.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/angle_micro_features_data.cc index 6e18f6a04ba..922f0797032 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/angle_micro_features_data.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/angle_micro_features_data.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/angle_micro_features_data.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/angle_micro_features_data.h" const int g_angle_micro_f2e59fea_nohash_1_length = 128; const int g_angle_micro_f2e59fea_nohash_1_dim = 3; diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/angle_micro_features_data.h b/tensorflow/lite/experimental/micro/examples/magic_wand/angle_micro_features_data.h similarity index 73% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/angle_micro_features_data.h rename to tensorflow/lite/experimental/micro/examples/magic_wand/angle_micro_features_data.h index 877047c055f..6060f128ed2 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/angle_micro_features_data.h +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/angle_micro_features_data.h @@ -13,11 +13,11 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_ANGLE_MICRO_FEATURES_DATA_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_ANGLE_MICRO_FEATURES_DATA_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_ANGLE_MICRO_FEATURES_DATA_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_ANGLE_MICRO_FEATURES_DATA_H_ extern const int g_angle_micro_f2e59fea_nohash_1_length; extern const int g_angle_micro_f2e59fea_nohash_1_dim; extern const float g_angle_micro_f2e59fea_nohash_1_data[]; -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_ANGLE_MICRO_FEATURES_DATA_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_ANGLE_MICRO_FEATURES_DATA_H_ diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/arduino/accelerometer_handler.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/arduino/accelerometer_handler.cc similarity index 95% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/arduino/accelerometer_handler.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/arduino/accelerometer_handler.cc index 45c3b2b993d..affaa1a1386 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/arduino/accelerometer_handler.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/arduino/accelerometer_handler.cc @@ -13,12 +13,12 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.h" #include #include -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/constants.h" // A buffer holding the last 200 sets of 3-channel values float save_data[600] = {0.0}; diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/arduino/constants.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/arduino/constants.cc similarity index 90% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/arduino/constants.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/arduino/constants.cc index a751fa30271..ed26536eb33 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/arduino/constants.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/arduino/constants.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/constants.h" // The number of expected consecutive inferences for each gesture type. // Established with the Arduino Nano 33 BLE Sense. diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/arduino/main.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/arduino/main.cc similarity index 100% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/arduino/main.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/arduino/main.cc diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/arduino/output_handler.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/arduino/output_handler.cc similarity index 95% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/arduino/output_handler.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/arduino/output_handler.cc index ebc4b77e11d..c24d0492a67 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/arduino/output_handler.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/arduino/output_handler.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.h" #include "Arduino.h" diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/circle_micro_features_data.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/circle_micro_features_data.cc similarity index 97% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/circle_micro_features_data.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/circle_micro_features_data.cc index e824c6964b8..24d44aabd5e 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/circle_micro_features_data.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/circle_micro_features_data.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/circle_micro_features_data.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/circle_micro_features_data.h" const int g_circle_micro_f9643d42_nohash_4_length = 128; const int g_circle_micro_f9643d42_nohash_4_dim = 3; diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/circle_micro_features_data.h b/tensorflow/lite/experimental/micro/examples/magic_wand/circle_micro_features_data.h similarity index 73% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/circle_micro_features_data.h rename to tensorflow/lite/experimental/micro/examples/magic_wand/circle_micro_features_data.h index 4a72fd8c52e..f9c69f90ef4 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/circle_micro_features_data.h +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/circle_micro_features_data.h @@ -13,11 +13,11 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_CIRCLE_MICRO_FEATURES_DATA_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_CIRCLE_MICRO_FEATURES_DATA_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_CIRCLE_MICRO_FEATURES_DATA_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_CIRCLE_MICRO_FEATURES_DATA_H_ extern const int g_circle_micro_f9643d42_nohash_4_length; extern const int g_circle_micro_f9643d42_nohash_4_dim; extern const float g_circle_micro_f9643d42_nohash_4_data[]; -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_CIRCLE_MICRO_FEATURES_DATA_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_CIRCLE_MICRO_FEATURES_DATA_H_ diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/constants.cc similarity index 90% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/constants.cc index 6bb4645489b..2de881db88e 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/constants.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/constants.h" // The number of expected consecutive inferences for each gesture type. // These defaults were established with the SparkFun Edge board. diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.h b/tensorflow/lite/experimental/micro/examples/magic_wand/constants.h similarity index 77% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.h rename to tensorflow/lite/experimental/micro/examples/magic_wand/constants.h index ad5bdcb5847..653a0967763 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.h +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/constants.h @@ -13,12 +13,12 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_CONSTANTS_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_CONSTANTS_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_CONSTANTS_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_CONSTANTS_H_ // The expected accelerometer data sample frequency const float kTargetHz = 25; // The number of expected consecutive inferences for each gesture type extern const int kConsecutiveInferenceThresholds[3]; -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_CONSTANTS_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_CONSTANTS_H_ diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor.cc similarity index 90% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor.cc index 42405435cc9..ea1cf3046af 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor.cc @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor.h" -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/constants.h" // How many times the most recent gesture has been matched in a row int continuous_count = 0; diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor.h b/tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor.h similarity index 71% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor.h rename to tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor.h index 435cdffc39f..8b100631b53 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor.h +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_GESTURE_PREDICTOR_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_GESTURE_PREDICTOR_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_GESTURE_PREDICTOR_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_GESTURE_PREDICTOR_H_ extern int PredictGesture(float* output); -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_GESTURE_PREDICTOR_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_GESTURE_PREDICTOR_H_ diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor_test.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor_test.cc similarity index 92% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor_test.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor_test.cc index 38d72ed0752..65d2d90ab3e 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor_test.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor_test.cc @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor.h" -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/constants.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/constants.h" #include "tensorflow/lite/experimental/micro/testing/micro_test.h" TF_LITE_MICRO_TESTS_BEGIN diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_model_data.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_model_data.cc similarity index 99% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_model_data.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_model_data.cc index c4d32497a54..ce368953ec7 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_model_data.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_model_data.cc @@ -14,10 +14,10 @@ limitations under the License. ==============================================================================*/ // Automatically created from a TensorFlow Lite flatbuffer using the command: -// xxd -i gesture_recognition_model.tflite > gesture_recognition_model_data.cc +// xxd -i magic_wand_model.tflite > magic_wand_model_data.cc // See the README for a full description of the creation process. -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_model_data.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_model_data.h" // We need to keep the data array aligned on some architectures. #ifdef __has_attribute @@ -31,7 +31,7 @@ limitations under the License. #define DATA_ALIGN_ATTRIBUTE #endif -const unsigned char g_gesture_recognition_model_data[] DATA_ALIGN_ATTRIBUTE = { +const unsigned char g_magic_wand_model_data[] DATA_ALIGN_ATTRIBUTE = { 0x18, 0x00, 0x00, 0x00, 0x54, 0x46, 0x4c, 0x33, 0x00, 0x00, 0x0e, 0x00, 0x18, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x14, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x4c, 0x00, 0x00, @@ -1666,4 +1666,4 @@ const unsigned char g_gesture_recognition_model_data[] DATA_ALIGN_ATTRIBUTE = { 0x00, 0x03, 0x06, 0x00, 0x06, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x11, 0x06, 0x00, 0x08, 0x00, 0x07, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04}; -const int g_gesture_recognition_model_data_len = 19600; +const int g_magic_wand_model_data_len = 19600; diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_model_data.h b/tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_model_data.h similarity index 63% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_model_data.h rename to tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_model_data.h index f81b2f306cb..6199c191b86 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_model_data.h +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_model_data.h @@ -16,12 +16,12 @@ limitations under the License. // This is a standard TensorFlow Lite model file that has been converted into a // C data array, so it can be easily compiled into a binary for devices that // don't have a file system. It was created using the command: -// xxd -i gesture_recognition_model.tflite > gesture_recognition_model_data.cc +// xxd -i magic_wand_model.tflite > magic_wand_model_data.cc -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_GESTURE_RECOGNITION_MODEL_DATA_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_GESTURE_RECOGNITION_MODEL_DATA_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_MAGIC_WAND_MODEL_DATA_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_MAGIC_WAND_MODEL_DATA_H_ -extern const unsigned char g_gesture_recognition_model_data[]; -extern const int g_gesture_recognition_model_data_len; +extern const unsigned char g_magic_wand_model_data[]; +extern const int g_magic_wand_model_data_len; -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_GESTURE_RECOGNITION_MODEL_DATA_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_MAGIC_WAND_MODEL_DATA_H_ diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_test.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_test.cc similarity index 94% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_test.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_test.cc index 54abea2af50..cdd51cb4c84 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_test.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_test.cc @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/angle_micro_features_data.h" -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/circle_micro_features_data.h" -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_model_data.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/angle_micro_features_data.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/circle_micro_features_data.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_model_data.h" #include "tensorflow/lite/experimental/micro/micro_mutable_op_resolver.h" #include "tensorflow/lite/experimental/micro/micro_error_reporter.h" #include "tensorflow/lite/experimental/micro/micro_interpreter.h" @@ -45,7 +45,7 @@ TF_LITE_MICRO_TEST(LoadModelAndPerformInference) { // Map the model into a usable data structure. This doesn't involve any // copying or parsing, it's a very lightweight operation. const tflite::Model* model = - ::tflite::GetModel(g_gesture_recognition_model_data); + ::tflite::GetModel(g_magic_wand_model_data); if (model->version() != TFLITE_SCHEMA_VERSION) { error_reporter->Report( "Model provided is schema version %d not equal " diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/main.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/main.cc similarity index 92% rename from tensorflow/lite/experimental/micro/examples/micro_vision/main.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/main.cc index 807752e36cd..468eeb5591c 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/main.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/main.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/micro_vision/main_functions.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/main_functions.h" // This is the default main used on systems that have the standard C entry // point. Other devices (for example FreeRTOS or ESP32) that have different diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/main_functions.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/main_functions.cc similarity index 91% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/main_functions.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/main_functions.cc index 4d7f42cc5a0..fd63a7e4034 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/main_functions.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/main_functions.cc @@ -13,12 +13,12 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/main_functions.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/main_functions.h" -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.h" -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_predictor.h" -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/gesture_recognition_model_data.h" -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/gesture_predictor.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/magic_wand_model_data.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.h" #include "tensorflow/lite/experimental/micro/micro_error_reporter.h" #include "tensorflow/lite/experimental/micro/micro_interpreter.h" #include "tensorflow/lite/experimental/micro/micro_mutable_op_resolver.h" @@ -64,7 +64,7 @@ void setup() { // Map the model into a usable data structure. This doesn't involve any // copying or parsing, it's a very lightweight operation. - model = tflite::GetModel(g_gesture_recognition_model_data); + model = tflite::GetModel(g_magic_wand_model_data); if (model->version() != TFLITE_SCHEMA_VERSION) { error_reporter->Report( "Model provided is schema version %d not equal " diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/main_functions.h b/tensorflow/lite/experimental/micro/examples/magic_wand/main_functions.h similarity index 79% rename from tensorflow/lite/experimental/micro/examples/micro_vision/main_functions.h rename to tensorflow/lite/experimental/micro/examples/magic_wand/main_functions.h index 63e52341edc..d445f7b4633 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/main_functions.h +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/main_functions.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_MAIN_FUNCTIONS_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_MAIN_FUNCTIONS_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_MAIN_FUNCTIONS_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_MAIN_FUNCTIONS_H_ // Initializes all data needed for the example. The name is important, and needs // to be setup() for Arduino compatibility. @@ -25,4 +25,4 @@ void setup(); // compatibility. void loop(); -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_MAIN_FUNCTIONS_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_MAIN_FUNCTIONS_H_ diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.cc similarity index 93% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.cc index 1449d67753e..1e3f7a38467 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.h" void HandleOutput(tflite::ErrorReporter* error_reporter, int kind) { // light (red: wing, blue: ring, green: slope) diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.h b/tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.h similarity index 75% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.h rename to tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.h index 2685a79077e..b4a2befe28f 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.h +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.h @@ -13,12 +13,12 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_OUTPUT_HANDLER_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_OUTPUT_HANDLER_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_OUTPUT_HANDLER_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_OUTPUT_HANDLER_H_ #include "tensorflow/lite/c/c_api_internal.h" #include "tensorflow/lite/experimental/micro/micro_error_reporter.h" void HandleOutput(tflite::ErrorReporter* error_reporter, int kind); -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_OUTPUT_HANDLER_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MAGIC_WAND_OUTPUT_HANDLER_H_ diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler_test.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/output_handler_test.cc similarity index 92% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler_test.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/output_handler_test.cc index aad13df9b06..a45767b191e 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler_test.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/output_handler_test.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.h" #include "tensorflow/lite/experimental/micro/testing/micro_test.h" #include "tensorflow/lite/experimental/micro/testing/test_utils.h" diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/sparkfun_edge/accelerometer_handler.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/sparkfun_edge/accelerometer_handler.cc similarity index 98% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/sparkfun_edge/accelerometer_handler.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/sparkfun_edge/accelerometer_handler.cc index 0147556a3ab..4a6047c2f8d 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/sparkfun_edge/accelerometer_handler.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/sparkfun_edge/accelerometer_handler.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/accelerometer_handler.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/accelerometer_handler.h" // These are headers from Ambiq's Apollo3 SDK. #include "am_bsp.h" // NOLINT diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/sparkfun_edge/output_handler.cc b/tensorflow/lite/experimental/micro/examples/magic_wand/sparkfun_edge/output_handler.cc similarity index 97% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/sparkfun_edge/output_handler.cc rename to tensorflow/lite/experimental/micro/examples/magic_wand/sparkfun_edge/output_handler.cc index c208bbeaf8c..082fb1c8952 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/sparkfun_edge/output_handler.cc +++ b/tensorflow/lite/experimental/micro/examples/magic_wand/sparkfun_edge/output_handler.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/output_handler.h" +#include "tensorflow/lite/experimental/micro/examples/magic_wand/output_handler.h" #include "tensorflow/lite/experimental/micro/tools/make/downloads/AmbiqSuite-Rel2.0.0/boards/SparkFun_TensorFlow_Apollo3_BSP/bsp/am_bsp.h" #include "tensorflow/lite/experimental/micro/tools/make/downloads/AmbiqSuite-Rel2.0.0/boards/SparkFun_TensorFlow_Apollo3_BSP/examples/example1_edge_test/src/tf_accelerometer/tf_accelerometer.h" diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/Makefile.inc b/tensorflow/lite/experimental/micro/examples/micro_vision/Makefile.inc deleted file mode 100644 index e9194ab90f2..00000000000 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/Makefile.inc +++ /dev/null @@ -1,68 +0,0 @@ -$(eval $(call add_third_party_download,$(PERSON_MODEL_URL),$(PERSON_MODEL_MD5),person_model_grayscale,)) - -MICRO_VISION_MODEL_SRCS := \ -tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.cc \ -$(MAKEFILE_DIR)/downloads/person_model_grayscale/person_detect_model_data.cc - -MICRO_VISION_MODEL_HDRS := \ -tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.h \ -tensorflow/lite/experimental/micro/examples/micro_vision/person_detect_model_data.h - -MICRO_VISION_TEST_SRCS := \ -tensorflow/lite/experimental/micro/examples/micro_vision/micro_vision_test.cc \ -$(MAKEFILE_DIR)/downloads/person_model_grayscale/no_person_image_data.cc \ -$(MAKEFILE_DIR)/downloads/person_model_grayscale/person_image_data.cc \ -$(MICRO_VISION_MODEL_SRCS) - -MICRO_VISION_TEST_HDRS := \ -tensorflow/lite/experimental/micro/examples/micro_vision/no_person_image_data.h \ -tensorflow/lite/experimental/micro/examples/micro_vision/person_image_data.h \ -$(MICRO_VISION_MODEL_HDRS) - -IMAGE_PROVIDER_TEST_SRCS := \ -tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.cc \ -tensorflow/lite/experimental/micro/examples/micro_vision/image_provider_test.cc \ -tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.cc - -IMAGE_PROVIDER_TEST_HDRS := \ -tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.h \ -tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.h - -DETECTION_RESPONDER_TEST_SRCS := \ -tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder.cc \ -tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder_test.cc - -DETECTION_RESPONDER_TEST_HDRS := \ -tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder.h - -MICRO_VISION_SRCS := \ -tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder.cc \ -tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.cc \ -tensorflow/lite/experimental/micro/examples/micro_vision/main.cc \ -tensorflow/lite/experimental/micro/examples/micro_vision/main_functions.cc \ -$(MICRO_VISION_MODEL_SRCS) - -MICRO_VISION_HDRS := \ -tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder.h \ -tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.h \ -tensorflow/lite/experimental/micro/examples/micro_vision/main_functions.h \ -$(MICRO_VISION_MODEL_HDRS) - -# Find any platform-specific rules for this example. -include $(wildcard tensorflow/lite/experimental/micro/examples/micro_vision/*/Makefile.inc) - -# Tests loading and running a vision model. -$(eval $(call microlite_test,micro_vision_test,\ -$(MICRO_VISION_TEST_SRCS),$(MICRO_VISION_TEST_HDRS))) - -# Tests the image provider module. -$(eval $(call microlite_test,image_provider_test,\ -$(IMAGE_PROVIDER_TEST_SRCS),$(IMAGE_PROVIDER_TEST_HDRS))) - -# Tests the detection responder module. -$(eval $(call microlite_test,detection_responder_test,\ -$(DETECTION_RESPONDER_TEST_SRCS),$(DETECTION_RESPONDER_TEST_HDRS))) - -# Builds a standalone object recognition binary. -$(eval $(call microlite_test,micro_vision,\ -$(MICRO_VISION_SRCS),$(MICRO_VISION_HDRS))) diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/Makefile.inc b/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/Makefile.inc deleted file mode 100644 index 46ee30ece3c..00000000000 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/Makefile.inc +++ /dev/null @@ -1,14 +0,0 @@ -ifeq ($(TARGET),$(filter $(TARGET),apollo3evb sparkfun_edge)) - MICRO_VISION_SRCS += \ - tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0.c \ - tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_debug.c \ - tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_optimized.c - - MICRO_VISION_HDRS += \ - tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0.h \ - tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_debug.h \ - tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_optimized.h \ - tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_RAW8_QVGA_8bits_lsb_5fps.h \ - tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_Walking1s_01.h \ - tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/platform_Sparkfun_Edge.h -endif diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/BUILD b/tensorflow/lite/experimental/micro/examples/person_detection/BUILD similarity index 98% rename from tensorflow/lite/experimental/micro/examples/micro_vision/BUILD rename to tensorflow/lite/experimental/micro/examples/person_detection/BUILD index 5de72a31859..892f9c6f2ea 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/BUILD +++ b/tensorflow/lite/experimental/micro/examples/person_detection/BUILD @@ -100,7 +100,7 @@ tflite_micro_cc_test( ) cc_binary( - name = "micro_vision", + name = "person_detection", srcs = [ "main.cc", "main_functions.cc", diff --git a/tensorflow/lite/experimental/micro/examples/person_detection/Makefile.inc b/tensorflow/lite/experimental/micro/examples/person_detection/Makefile.inc new file mode 100644 index 00000000000..9ba305996c3 --- /dev/null +++ b/tensorflow/lite/experimental/micro/examples/person_detection/Makefile.inc @@ -0,0 +1,68 @@ +$(eval $(call add_third_party_download,$(PERSON_MODEL_URL),$(PERSON_MODEL_MD5),person_model_grayscale,)) + +person_detection_MODEL_SRCS := \ +tensorflow/lite/experimental/micro/examples/person_detection/model_settings.cc \ +$(MAKEFILE_DIR)/downloads/person_model_grayscale/person_detect_model_data.cc + +person_detection_MODEL_HDRS := \ +tensorflow/lite/experimental/micro/examples/person_detection/model_settings.h \ +tensorflow/lite/experimental/micro/examples/person_detection/person_detect_model_data.h + +person_detection_TEST_SRCS := \ +tensorflow/lite/experimental/micro/examples/person_detection/person_detection_test.cc \ +$(MAKEFILE_DIR)/downloads/person_model_grayscale/no_person_image_data.cc \ +$(MAKEFILE_DIR)/downloads/person_model_grayscale/person_image_data.cc \ +$(person_detection_MODEL_SRCS) + +person_detection_TEST_HDRS := \ +tensorflow/lite/experimental/micro/examples/person_detection/no_person_image_data.h \ +tensorflow/lite/experimental/micro/examples/person_detection/person_image_data.h \ +$(person_detection_MODEL_HDRS) + +IMAGE_PROVIDER_TEST_SRCS := \ +tensorflow/lite/experimental/micro/examples/person_detection/image_provider.cc \ +tensorflow/lite/experimental/micro/examples/person_detection/image_provider_test.cc \ +tensorflow/lite/experimental/micro/examples/person_detection/model_settings.cc + +IMAGE_PROVIDER_TEST_HDRS := \ +tensorflow/lite/experimental/micro/examples/person_detection/image_provider.h \ +tensorflow/lite/experimental/micro/examples/person_detection/model_settings.h + +DETECTION_RESPONDER_TEST_SRCS := \ +tensorflow/lite/experimental/micro/examples/person_detection/detection_responder.cc \ +tensorflow/lite/experimental/micro/examples/person_detection/detection_responder_test.cc + +DETECTION_RESPONDER_TEST_HDRS := \ +tensorflow/lite/experimental/micro/examples/person_detection/detection_responder.h + +person_detection_SRCS := \ +tensorflow/lite/experimental/micro/examples/person_detection/detection_responder.cc \ +tensorflow/lite/experimental/micro/examples/person_detection/image_provider.cc \ +tensorflow/lite/experimental/micro/examples/person_detection/main.cc \ +tensorflow/lite/experimental/micro/examples/person_detection/main_functions.cc \ +$(person_detection_MODEL_SRCS) + +person_detection_HDRS := \ +tensorflow/lite/experimental/micro/examples/person_detection/detection_responder.h \ +tensorflow/lite/experimental/micro/examples/person_detection/image_provider.h \ +tensorflow/lite/experimental/micro/examples/person_detection/main_functions.h \ +$(person_detection_MODEL_HDRS) + +# Find any platform-specific rules for this example. +include $(wildcard tensorflow/lite/experimental/micro/examples/person_detection/*/Makefile.inc) + +# Tests loading and running a vision model. +$(eval $(call microlite_test,person_detection_test,\ +$(person_detection_TEST_SRCS),$(person_detection_TEST_HDRS))) + +# Tests the image provider module. +$(eval $(call microlite_test,image_provider_test,\ +$(IMAGE_PROVIDER_TEST_SRCS),$(IMAGE_PROVIDER_TEST_HDRS))) + +# Tests the detection responder module. +$(eval $(call microlite_test,detection_responder_test,\ +$(DETECTION_RESPONDER_TEST_SRCS),$(DETECTION_RESPONDER_TEST_HDRS))) + +# Builds a standalone object recognition binary. +$(eval $(call microlite_test,person_detection,\ +$(person_detection_SRCS),$(person_detection_HDRS))) diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/README.md b/tensorflow/lite/experimental/micro/examples/person_detection/README.md similarity index 95% rename from tensorflow/lite/experimental/micro/examples/micro_vision/README.md rename to tensorflow/lite/experimental/micro/examples/person_detection/README.md index 568d9a89b18..9008050179f 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/README.md +++ b/tensorflow/lite/experimental/micro/examples/person_detection/README.md @@ -25,7 +25,7 @@ This will take a few minutes, and downloads frameworks the code uses like finished, run: ``` -make -f tensorflow/lite/experimental/micro/tools/make/Makefile test_micro_vision_test +make -f tensorflow/lite/experimental/micro/tools/make/Makefile test_person_detection_test ``` You should see a series of files get compiled, followed by some logging output @@ -37,7 +37,7 @@ and checks that the network correctly identifies them. To understand how TensorFlow Lite does this, you can look at the `TestInvoke()` function in -[micro_vision_test.cc](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/experimental/micro/examples/micro_vision/micro_vision_test.cc). +[person_detection_test.cc](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/experimental/micro/examples/person_detection/person_detection_test.cc). It's a fairly small amount of code, creating an interpreter, getting a handle to a model that's been compiled into the program, and then invoking the interpreter with the model and sample inputs. @@ -59,13 +59,13 @@ The following command will download the required dependencies and then compile a binary for the SparkFun Edge: ``` -make -f tensorflow/lite/experimental/micro/tools/make/Makefile TARGET=sparkfun_edge micro_vision_bin +make -f tensorflow/lite/experimental/micro/tools/make/Makefile TARGET=sparkfun_edge person_detection_bin ``` The binary will be created in the following location: ``` -tensorflow/lite/experimental/micro/tools/make/gen/sparkfun_edge_cortex-m4/bin/micro_vision.bin +tensorflow/lite/experimental/micro/tools/make/gen/sparkfun_edge_cortex-m4/bin/person_detection.bin ``` ### Sign the binary @@ -87,7 +87,7 @@ Next, run the following command to create a signed binary: ``` python3 tensorflow/lite/experimental/micro/tools/make/downloads/AmbiqSuite-Rel2.0.0/tools/apollo3_scripts/create_cust_image_blob.py \ ---bin tensorflow/lite/experimental/micro/tools/make/gen/sparkfun_edge_cortex-m4/bin/micro_vision.bin \ +--bin tensorflow/lite/experimental/micro/tools/make/gen/sparkfun_edge_cortex-m4/bin/person_detection.bin \ --load-address 0xC000 \ --magic-num 0xCB \ -o main_nonsecure_ota \ diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/apollo3evb/image_provider.cc b/tensorflow/lite/experimental/micro/examples/person_detection/apollo3evb/image_provider.cc similarity index 90% rename from tensorflow/lite/experimental/micro/examples/micro_vision/apollo3evb/image_provider.cc rename to tensorflow/lite/experimental/micro/examples/person_detection/apollo3evb/image_provider.cc index 53545231ac8..b6a39083870 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/apollo3evb/image_provider.cc +++ b/tensorflow/lite/experimental/micro/examples/person_detection/apollo3evb/image_provider.cc @@ -13,13 +13,13 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/image_provider.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_RAW8_QVGA_8bits_lsb_5fps.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_debug.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_optimized.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/platform_Sparkfun_Edge.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_RAW8_QVGA_8bits_lsb_5fps.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_debug.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_optimized.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/platform_Sparkfun_Edge.h" // These are headers from Ambiq's Apollo3 SDK. #include "am_bsp.h" // NOLINT diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/arduino/main.cc b/tensorflow/lite/experimental/micro/examples/person_detection/arduino/main.cc similarity index 90% rename from tensorflow/lite/experimental/micro/examples/micro_vision/arduino/main.cc rename to tensorflow/lite/experimental/micro/examples/person_detection/arduino/main.cc index ad8c708677d..6d962d91240 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/arduino/main.cc +++ b/tensorflow/lite/experimental/micro/examples/person_detection/arduino/main.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/micro_vision/main_functions.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/main_functions.h" // Arduino automatically calls the setup() and loop() functions in a sketch, so // where other systems need their own main routine in this file, it can be left diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder.cc b/tensorflow/lite/experimental/micro/examples/person_detection/detection_responder.cc similarity index 92% rename from tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder.cc rename to tensorflow/lite/experimental/micro/examples/person_detection/detection_responder.cc index e2ac98fecab..1f39bc316a5 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder.cc +++ b/tensorflow/lite/experimental/micro/examples/person_detection/detection_responder.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/detection_responder.h" // This dummy implementation writes person and no person scores to the error // console. Real applications will want to take some custom action instead, and diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder.h b/tensorflow/lite/experimental/micro/examples/person_detection/detection_responder.h similarity index 83% rename from tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder.h rename to tensorflow/lite/experimental/micro/examples/person_detection/detection_responder.h index a1aca63cf3c..6026549a4c6 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder.h +++ b/tensorflow/lite/experimental/micro/examples/person_detection/detection_responder.h @@ -16,8 +16,8 @@ limitations under the License. // Provides an interface to take an action based on the output from the person // detection model. -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_DETECTION_RESPONDER_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_DETECTION_RESPONDER_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_DETECTION_RESPONDER_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_DETECTION_RESPONDER_H_ #include "tensorflow/lite/c/c_api_internal.h" #include "tensorflow/lite/experimental/micro/micro_error_reporter.h" @@ -31,4 +31,4 @@ limitations under the License. void RespondToDetection(tflite::ErrorReporter* error_reporter, uint8_t person_score, uint8_t no_person_score); -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_DETECTION_RESPONDER_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_DETECTION_RESPONDER_H_ diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder_test.cc b/tensorflow/lite/experimental/micro/examples/person_detection/detection_responder_test.cc similarity index 93% rename from tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder_test.cc rename to tensorflow/lite/experimental/micro/examples/person_detection/detection_responder_test.cc index ec25533e82c..69edc02d791 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder_test.cc +++ b/tensorflow/lite/experimental/micro/examples/person_detection/detection_responder_test.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/detection_responder.h" #include "tensorflow/lite/experimental/micro/testing/micro_test.h" #include "tensorflow/lite/experimental/micro/testing/test_utils.h" diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0.c b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0.c similarity index 100% rename from tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0.c rename to tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0.c diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0.h b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0.h similarity index 97% rename from tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0.h rename to tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0.h index 43feaf91f7d..21a60049287 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0.h +++ b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_H_ #ifdef __cplusplus extern "C" { @@ -402,4 +402,4 @@ uint32_t hm01b0_blocking_read_oneframe(hm01b0_cfg_t *psCfg, uint8_t *pui8Buffer, } #endif -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_H_ diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_RAW8_QVGA_8bits_lsb_5fps.h b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_RAW8_QVGA_8bits_lsb_5fps.h similarity index 96% rename from tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_RAW8_QVGA_8bits_lsb_5fps.h rename to tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_RAW8_QVGA_8bits_lsb_5fps.h index 9a600a8699f..fcde832e655 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_RAW8_QVGA_8bits_lsb_5fps.h +++ b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_RAW8_QVGA_8bits_lsb_5fps.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_RAW8_QVGA_8BITS_LSB_5FPS_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_RAW8_QVGA_8BITS_LSB_5FPS_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_RAW8_QVGA_8BITS_LSB_5FPS_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_RAW8_QVGA_8BITS_LSB_5FPS_H_ #include "HM01B0.h" @@ -477,4 +477,4 @@ const hm_script_t sHM01B0InitScript[] = { // ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; }; -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_RAW8_QVGA_8BITS_LSB_5FPS_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_RAW8_QVGA_8BITS_LSB_5FPS_H_ diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_Walking1s_01.h b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_Walking1s_01.h similarity index 80% rename from tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_Walking1s_01.h rename to tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_Walking1s_01.h index 282aef0e94c..29777236566 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_Walking1s_01.h +++ b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_Walking1s_01.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_WALKING1S_01_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_WALKING1S_01_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_WALKING1S_01_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_WALKING1S_01_H_ #include "HM01B0.h" @@ -53,4 +53,4 @@ const hm_script_t sHM01b0TestModeScript_Walking1s[] = { }, // W 24 0104 01 2 1 ; }; -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_WALKING1S_01_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_WALKING1S_01_H_ diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_Walking1s_01.txt b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_Walking1s_01.txt similarity index 100% rename from tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_Walking1s_01.txt rename to tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_Walking1s_01.txt diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_debug.c b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_debug.c similarity index 100% rename from tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_debug.c rename to tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_debug.c diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_debug.h b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_debug.h similarity index 83% rename from tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_debug.h rename to tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_debug.h index f54a1e9f766..57a8d2331c4 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_debug.h +++ b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_debug.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_DEBUG_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_DEBUG_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_DEBUG_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_DEBUG_H_ #ifdef __cplusplus extern "C" { @@ -46,4 +46,4 @@ void hm01b0_framebuffer_dump(uint8_t* frame, uint32_t len); } #endif -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_DEBUG_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_DEBUG_H_ diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_optimized.c b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_optimized.c similarity index 100% rename from tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_optimized.c rename to tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_optimized.c diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_optimized.h b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_optimized.h similarity index 83% rename from tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_optimized.h rename to tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_optimized.h index ee0d9d8bc93..d3b9e04b5cd 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_optimized.h +++ b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_optimized.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_OPTIMIZED_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_OPTIMIZED_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_OPTIMIZED_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_OPTIMIZED_H_ #ifdef __cplusplus extern "C" { @@ -46,4 +46,4 @@ uint32_t hm01b0_blocking_read_oneframe_scaled(uint8_t* buffer, int w, int h, } #endif -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_HM01B0_OPTIMIZED_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_HM01B0_OPTIMIZED_H_ diff --git a/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/Makefile.inc b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/Makefile.inc new file mode 100644 index 00000000000..50bbf86f01e --- /dev/null +++ b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/Makefile.inc @@ -0,0 +1,14 @@ +ifeq ($(TARGET),$(filter $(TARGET),apollo3evb sparkfun_edge)) + person_detection_SRCS += \ + tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0.c \ + tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_debug.c \ + tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_optimized.c + + person_detection_HDRS += \ + tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0.h \ + tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_debug.h \ + tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_optimized.h \ + tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_RAW8_QVGA_8bits_lsb_5fps.h \ + tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_Walking1s_01.h \ + tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/platform_Sparkfun_Edge.h +endif diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/platform_Sparkfun_Edge.h b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/platform_Sparkfun_Edge.h similarity index 82% rename from tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/platform_Sparkfun_Edge.h rename to tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/platform_Sparkfun_Edge.h index 3a580914987..21c100c2f57 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/platform_Sparkfun_Edge.h +++ b/tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/platform_Sparkfun_Edge.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_PLATFORM_SPARKFUN_EDGE_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_PLATFORM_SPARKFUN_EDGE_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_PLATFORM_SPARKFUN_EDGE_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_PLATFORM_SPARKFUN_EDGE_H_ #ifdef __cplusplus extern "C" { @@ -51,4 +51,4 @@ extern "C" { } #endif -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_HIMAX_DRIVER_PLATFORM_SPARKFUN_EDGE_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_HIMAX_DRIVER_PLATFORM_SPARKFUN_EDGE_H_ diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.cc b/tensorflow/lite/experimental/micro/examples/person_detection/image_provider.cc similarity index 84% rename from tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.cc rename to tensorflow/lite/experimental/micro/examples/person_detection/image_provider.cc index a7060edc07a..517035006be 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.cc +++ b/tensorflow/lite/experimental/micro/examples/person_detection/image_provider.cc @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/image_provider.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/model_settings.h" TfLiteStatus GetImage(tflite::ErrorReporter* error_reporter, int image_width, int image_height, int channels, uint8_t* image_data) { diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.h b/tensorflow/lite/experimental/micro/examples/person_detection/image_provider.h similarity index 87% rename from tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.h rename to tensorflow/lite/experimental/micro/examples/person_detection/image_provider.h index 085e1adb210..56be1635d4d 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.h +++ b/tensorflow/lite/experimental/micro/examples/person_detection/image_provider.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_IMAGE_PROVIDER_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_IMAGE_PROVIDER_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_IMAGE_PROVIDER_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_IMAGE_PROVIDER_H_ #include "tensorflow/lite/c/c_api_internal.h" #include "tensorflow/lite/experimental/micro/micro_error_reporter.h" @@ -36,4 +36,4 @@ limitations under the License. TfLiteStatus GetImage(tflite::ErrorReporter* error_reporter, int image_width, int image_height, int channels, uint8_t* image_data); -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_IMAGE_PROVIDER_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_IMAGE_PROVIDER_H_ diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/image_provider_test.cc b/tensorflow/lite/experimental/micro/examples/person_detection/image_provider_test.cc similarity index 89% rename from tensorflow/lite/experimental/micro/examples/micro_vision/image_provider_test.cc rename to tensorflow/lite/experimental/micro/examples/person_detection/image_provider_test.cc index 43d3ac1e9c5..297211c01dc 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/image_provider_test.cc +++ b/tensorflow/lite/experimental/micro/examples/person_detection/image_provider_test.cc @@ -13,12 +13,12 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/image_provider.h" #include #include "tensorflow/lite/c/c_api_internal.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/model_settings.h" #include "tensorflow/lite/experimental/micro/micro_error_reporter.h" #include "tensorflow/lite/experimental/micro/testing/micro_test.h" diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/main.cc b/tensorflow/lite/experimental/micro/examples/person_detection/main.cc similarity index 91% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/main.cc rename to tensorflow/lite/experimental/micro/examples/person_detection/main.cc index 5a84ceb071d..d2c73eab583 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/main.cc +++ b/tensorflow/lite/experimental/micro/examples/person_detection/main.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/gesture_recognition/main_functions.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/main_functions.h" // This is the default main used on systems that have the standard C entry // point. Other devices (for example FreeRTOS or ESP32) that have different diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/main_functions.cc b/tensorflow/lite/experimental/micro/examples/person_detection/main_functions.cc similarity index 91% rename from tensorflow/lite/experimental/micro/examples/micro_vision/main_functions.cc rename to tensorflow/lite/experimental/micro/examples/person_detection/main_functions.cc index 40169161a72..b2a3f770492 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/main_functions.cc +++ b/tensorflow/lite/experimental/micro/examples/person_detection/main_functions.cc @@ -13,12 +13,12 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/micro_vision/main_functions.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/main_functions.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/person_detect_model_data.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/detection_responder.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/image_provider.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/model_settings.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/person_detect_model_data.h" #include "tensorflow/lite/experimental/micro/micro_error_reporter.h" #include "tensorflow/lite/experimental/micro/micro_interpreter.h" #include "tensorflow/lite/experimental/micro/micro_mutable_op_resolver.h" diff --git a/tensorflow/lite/experimental/micro/examples/gesture_recognition/main_functions.h b/tensorflow/lite/experimental/micro/examples/person_detection/main_functions.h similarity index 78% rename from tensorflow/lite/experimental/micro/examples/gesture_recognition/main_functions.h rename to tensorflow/lite/experimental/micro/examples/person_detection/main_functions.h index af0f1f411fd..a1f49454326 100644 --- a/tensorflow/lite/experimental/micro/examples/gesture_recognition/main_functions.h +++ b/tensorflow/lite/experimental/micro/examples/person_detection/main_functions.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_MAIN_FUNCTIONS_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_MAIN_FUNCTIONS_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_MAIN_FUNCTIONS_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_MAIN_FUNCTIONS_H_ // Initializes all data needed for the example. The name is important, and needs // to be setup() for Arduino compatibility. @@ -25,4 +25,4 @@ void setup(); // compatibility. void loop(); -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_GESTURE_RECOGNITION_MAIN_FUNCTIONS_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_MAIN_FUNCTIONS_H_ diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.cc b/tensorflow/lite/experimental/micro/examples/person_detection/model_settings.cc similarity index 89% rename from tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.cc rename to tensorflow/lite/experimental/micro/examples/person_detection/model_settings.cc index bdd5ba87bc8..24ce3523193 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.cc +++ b/tensorflow/lite/experimental/micro/examples/person_detection/model_settings.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/model_settings.h" const char* kCategoryLabels[kCategoryCount] = { "unused", diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.h b/tensorflow/lite/experimental/micro/examples/person_detection/model_settings.h similarity index 82% rename from tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.h rename to tensorflow/lite/experimental/micro/examples/person_detection/model_settings.h index e3cec7ad03d..408b59fbe8a 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.h +++ b/tensorflow/lite/experimental/micro/examples/person_detection/model_settings.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_MODEL_SETTINGS_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_MODEL_SETTINGS_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_MODEL_SETTINGS_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_MODEL_SETTINGS_H_ // Keeping these as constant expressions allow us to allocate fixed-sized arrays // on the stack for our working memory. @@ -32,4 +32,4 @@ constexpr int kPersonIndex = 1; constexpr int kNotAPersonIndex = 2; extern const char* kCategoryLabels[kCategoryCount]; -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_MODEL_SETTINGS_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_MODEL_SETTINGS_H_ diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/no_person_image_data.h b/tensorflow/lite/experimental/micro/examples/person_detection/no_person_image_data.h similarity index 79% rename from tensorflow/lite/experimental/micro/examples/micro_vision/no_person_image_data.h rename to tensorflow/lite/experimental/micro/examples/person_detection/no_person_image_data.h index 4ebcb0cf5b1..64cc05bfe36 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/no_person_image_data.h +++ b/tensorflow/lite/experimental/micro/examples/person_detection/no_person_image_data.h @@ -19,12 +19,12 @@ limitations under the License. // Skip the 54 byte bmp3 header and add the reset of the bytes to a C array: // xxd -s 54 -i /tmp/noperson.bmp3 > /tmp/noperson.cc -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_NO_PERSON_IMAGE_DATA_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_NO_PERSON_IMAGE_DATA_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_NO_PERSON_IMAGE_DATA_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_NO_PERSON_IMAGE_DATA_H_ #include extern const int g_no_person_data_size; extern const uint8_t g_no_person_data[]; -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_NO_PERSON_IMAGE_DATA_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_NO_PERSON_IMAGE_DATA_H_ diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/person_detect_model_data.h b/tensorflow/lite/experimental/micro/examples/person_detection/person_detect_model_data.h similarity index 78% rename from tensorflow/lite/experimental/micro/examples/micro_vision/person_detect_model_data.h rename to tensorflow/lite/experimental/micro/examples/person_detection/person_detect_model_data.h index b0efd34e85b..5642203d6ac 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/person_detect_model_data.h +++ b/tensorflow/lite/experimental/micro/examples/person_detection/person_detect_model_data.h @@ -18,10 +18,10 @@ limitations under the License. // don't have a file system. It was created using the command: // xxd -i person_detect.tflite > person_detect_model_data.cc -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_PERSON_DETECT_MODEL_DATA_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_PERSON_DETECT_MODEL_DATA_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_DETECT_MODEL_DATA_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_DETECT_MODEL_DATA_H_ extern const unsigned char g_person_detect_model_data[]; extern const int g_person_detect_model_data_len; -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_PERSON_DETECT_MODEL_DATA_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_DETECT_MODEL_DATA_H_ diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/micro_vision_test.cc b/tensorflow/lite/experimental/micro/examples/person_detection/person_detection_test.cc similarity index 94% rename from tensorflow/lite/experimental/micro/examples/micro_vision/micro_vision_test.cc rename to tensorflow/lite/experimental/micro/examples/person_detection/person_detection_test.cc index fedb6a9b888..19bad735a36 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/micro_vision_test.cc +++ b/tensorflow/lite/experimental/micro/examples/person_detection/person_detection_test.cc @@ -14,10 +14,10 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/lite/c/c_api_internal.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/model_settings.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/no_person_image_data.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/person_detect_model_data.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/person_image_data.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/model_settings.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/no_person_image_data.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/person_detect_model_data.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/person_image_data.h" #include "tensorflow/lite/experimental/micro/micro_error_reporter.h" #include "tensorflow/lite/experimental/micro/micro_interpreter.h" #include "tensorflow/lite/experimental/micro/micro_mutable_op_resolver.h" diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/person_image_data.h b/tensorflow/lite/experimental/micro/examples/person_detection/person_image_data.h similarity index 79% rename from tensorflow/lite/experimental/micro/examples/micro_vision/person_image_data.h rename to tensorflow/lite/experimental/micro/examples/person_detection/person_image_data.h index 1287da21d94..02ac2fd60c4 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/person_image_data.h +++ b/tensorflow/lite/experimental/micro/examples/person_detection/person_image_data.h @@ -19,12 +19,12 @@ limitations under the License. // Skip the 54 byte bmp3 header and add the reset of the bytes to a C array: // xxd -s 54 -i /tmp/person.bmp3 > /tmp/person.cc -#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_PERSON_IMAGE_DATA_H_ -#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_PERSON_IMAGE_DATA_H_ +#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_IMAGE_DATA_H_ +#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_IMAGE_DATA_H_ #include extern const int g_person_data_size; extern const uint8_t g_person_data[]; -#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_MICRO_VISION_PERSON_IMAGE_DATA_H_ +#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_IMAGE_DATA_H_ diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/sparkfun_edge/detection_responder.cc b/tensorflow/lite/experimental/micro/examples/person_detection/sparkfun_edge/detection_responder.cc similarity index 95% rename from tensorflow/lite/experimental/micro/examples/micro_vision/sparkfun_edge/detection_responder.cc rename to tensorflow/lite/experimental/micro/examples/person_detection/sparkfun_edge/detection_responder.cc index ff1c9f9f5e5..7a79c4753b7 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/sparkfun_edge/detection_responder.cc +++ b/tensorflow/lite/experimental/micro/examples/person_detection/sparkfun_edge/detection_responder.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/micro_vision/detection_responder.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/detection_responder.h" #include "am_bsp.h" // NOLINT diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/sparkfun_edge/image_provider.cc b/tensorflow/lite/experimental/micro/examples/person_detection/sparkfun_edge/image_provider.cc similarity index 91% rename from tensorflow/lite/experimental/micro/examples/micro_vision/sparkfun_edge/image_provider.cc rename to tensorflow/lite/experimental/micro/examples/person_detection/sparkfun_edge/image_provider.cc index e05dc4d6c53..f906f199c9e 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/sparkfun_edge/image_provider.cc +++ b/tensorflow/lite/experimental/micro/examples/person_detection/sparkfun_edge/image_provider.cc @@ -13,13 +13,13 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "tensorflow/lite/experimental/micro/examples/micro_vision/image_provider.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/image_provider.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_RAW8_QVGA_8bits_lsb_5fps.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_debug.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/HM01B0_optimized.h" -#include "tensorflow/lite/experimental/micro/examples/micro_vision/himax_driver/platform_Sparkfun_Edge.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_RAW8_QVGA_8bits_lsb_5fps.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_debug.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/HM01B0_optimized.h" +#include "tensorflow/lite/experimental/micro/examples/person_detection/himax_driver/platform_Sparkfun_Edge.h" // These are headers from Ambiq's Apollo3 SDK. #include "am_bsp.h" // NOLINT diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/utils/BUILD b/tensorflow/lite/experimental/micro/examples/person_detection/utils/BUILD similarity index 100% rename from tensorflow/lite/experimental/micro/examples/micro_vision/utils/BUILD rename to tensorflow/lite/experimental/micro/examples/person_detection/utils/BUILD diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/utils/raw_to_bitmap.py b/tensorflow/lite/experimental/micro/examples/person_detection/utils/raw_to_bitmap.py similarity index 100% rename from tensorflow/lite/experimental/micro/examples/micro_vision/utils/raw_to_bitmap.py rename to tensorflow/lite/experimental/micro/examples/person_detection/utils/raw_to_bitmap.py diff --git a/tensorflow/lite/experimental/micro/examples/micro_vision/utils/raw_to_bitmap_test.py b/tensorflow/lite/experimental/micro/examples/person_detection/utils/raw_to_bitmap_test.py similarity index 95% rename from tensorflow/lite/experimental/micro/examples/micro_vision/utils/raw_to_bitmap_test.py rename to tensorflow/lite/experimental/micro/examples/person_detection/utils/raw_to_bitmap_test.py index 9cf93af05eb..9dddf3f3fca 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_vision/utils/raw_to_bitmap_test.py +++ b/tensorflow/lite/experimental/micro/examples/person_detection/utils/raw_to_bitmap_test.py @@ -22,8 +22,8 @@ import io import numpy as np -from tensorflow.lite.experimental.micro.examples.micro_vision.utils.raw_to_bitmap import parse_file -from tensorflow.lite.experimental.micro.examples.micro_vision.utils.raw_to_bitmap import reshape_bitmaps +from tensorflow.lite.experimental.micro.examples.person_detection.utils.raw_to_bitmap import parse_file +from tensorflow.lite.experimental.micro.examples.person_detection.utils.raw_to_bitmap import reshape_bitmaps from tensorflow.python.platform import test _RGB_RAW = u""" diff --git a/tensorflow/lite/experimental/micro/tools/ci_build/install_arduino_cli.sh b/tensorflow/lite/experimental/micro/tools/ci_build/install_arduino_cli.sh index 02234bba846..b45a09eb047 100755 --- a/tensorflow/lite/experimental/micro/tools/ci_build/install_arduino_cli.sh +++ b/tensorflow/lite/experimental/micro/tools/ci_build/install_arduino_cli.sh @@ -31,5 +31,5 @@ tar xzf arduino-cli_0.4.0_Linux_64bit.tar.gz /tmp/arduino-cli core update-index /tmp/arduino-cli core install arduino:mbed -# Required by gesture_recognition +# Required by magic_wand /tmp/arduino-cli lib install Arduino_LSM9DS1@1.0.0 diff --git a/tensorflow/lite/experimental/micro/tools/make/fix_arduino_subfolders.py b/tensorflow/lite/experimental/micro/tools/make/fix_arduino_subfolders.py index 5eb633d7515..87434edcac1 100755 --- a/tensorflow/lite/experimental/micro/tools/make/fix_arduino_subfolders.py +++ b/tensorflow/lite/experimental/micro/tools/make/fix_arduino_subfolders.py @@ -41,7 +41,7 @@ def move_person_data(library_dir): 'person_model_grayscale/person_detect_model_data.cpp' ) new_person_data_path = os.path.join( - library_dir, 'examples/micro_vision/person_detect_model_data.cpp') + library_dir, 'examples/person_detection/person_detect_model_data.cpp') if os.path.exists(old_person_data_path): os.rename(old_person_data_path, new_person_data_path) # Update include. @@ -49,7 +49,7 @@ def move_person_data(library_dir): file_contents = source_file.read() file_contents = file_contents.replace( '#include "tensorflow/lite/experimental/micro/examples/' + - 'micro_vision/person_detect_model_data.h"', + 'person_detection/person_detect_model_data.h"', '#include "person_detect_model_data.h"') with open(new_person_data_path, 'w') as source_file: source_file.write(file_contents) diff --git a/tensorflow/lite/experimental/micro/tools/make/fix_arduino_subfolders_test.sh b/tensorflow/lite/experimental/micro/tools/make/fix_arduino_subfolders_test.sh index 114ffdda94a..40864735bdd 100755 --- a/tensorflow/lite/experimental/micro/tools/make/fix_arduino_subfolders_test.sh +++ b/tensorflow/lite/experimental/micro/tools/make/fix_arduino_subfolders_test.sh @@ -28,8 +28,8 @@ touch ${EXAMPLES_SUBDIR_FILE} TENSORFLOW_SRC_DIR=${LIBRARY_DIR}/src/ PERSON_DATA_FILE=${TENSORFLOW_SRC_DIR}tensorflow/lite/experimental/micro/tools/make/downloads/person_model_grayscale/person_detect_model_data.cpp mkdir -p `dirname ${PERSON_DATA_FILE}` -echo '#include "tensorflow/lite/experimental/micro/examples/micro_vision/person_detect_model_data.h"' > ${PERSON_DATA_FILE} -mkdir -p ${LIBRARY_DIR}/examples/micro_vision +echo '#include "tensorflow/lite/experimental/micro/examples/person_detection/person_detect_model_data.h"' > ${PERSON_DATA_FILE} +mkdir -p ${LIBRARY_DIR}/examples/person_detection EXAMPLE_INO_FILE=${LIBRARY_DIR}/examples/something/main.ino mkdir -p `dirname ${EXAMPLE_INO_FILE}` @@ -44,7 +44,7 @@ if [[ ! -f ${EXPECTED_EXAMPLES_SUBDIR_FILE} ]]; then exit 1 fi -EXPECTED_PERSON_DATA_FILE=${LIBRARY_DIR}/examples/micro_vision/person_detect_model_data.cpp +EXPECTED_PERSON_DATA_FILE=${LIBRARY_DIR}/examples/person_detection/person_detect_model_data.cpp if [[ ! -f ${EXPECTED_PERSON_DATA_FILE} ]]; then echo "${EXPECTED_PERSON_DATA_FILE} wasn't created." exit 1 diff --git a/tensorflow/lite/experimental/micro/tools/make/third_party_downloads.inc b/tensorflow/lite/experimental/micro/tools/make/third_party_downloads.inc index 6027131f1b0..1744c06b3d6 100644 --- a/tensorflow/lite/experimental/micro/tools/make/third_party_downloads.inc +++ b/tensorflow/lite/experimental/micro/tools/make/third_party_downloads.inc @@ -52,5 +52,5 @@ SIFIVE_FE310_LIB_MD5 := "06ee24c4956f8e21670ab3395861fe64" KISSFFT_URL="https://github.com/mborgerding/kissfft/archive/v130.zip" KISSFFT_MD5="438ba1fef5783cc5f5f201395cc477ca" -PERSON_MODEL_URL := "https://storage.googleapis.com/download.tensorflow.org/data/tf_lite_micro_person_data_grayscale.zip" -PERSON_MODEL_MD5 := "cd1059dd1c94afadd59608202732ad63" +PERSON_MODEL_URL := "https://storage.googleapis.com/download.tensorflow.org/data/tf_lite_micro_person_data_grayscale_2019_11_07.zip" +PERSON_MODEL_MD5 := "e6430de25aa92bcb807d07278a1b5b90" diff --git a/tensorflow/lite/g3doc/microcontrollers/get_started.md b/tensorflow/lite/g3doc/microcontrollers/get_started.md index 9b126b5c02e..535bcc4a55c 100644 --- a/tensorflow/lite/g3doc/microcontrollers/get_started.md +++ b/tensorflow/lite/g3doc/microcontrollers/get_started.md @@ -81,8 +81,8 @@ This example shows how you can use TensorFlow Lite to run a 250 kilobyte neural network to recognize people in images captured by a camera. It is designed to run on systems with small amounts of memory such as microcontrollers and DSPs. -Micro -Vision example +Person +detection example The example is tested on the following platforms: