This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sensor, lcd, image | |
| sensor.reset() | |
| sensor.set_framesize(sensor.QVGA) | |
| sensor.set_pixformat(sensor.RGB565) | |
| sensor.set_hmirror(False) | |
| lcd.init(freq=15000000) | |
| face_cascade = image.HaarCascade("frontalface", stages=25) | |
| while (True): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [env:m5stack-fire] | |
| platform = espressif32 | |
| board = m5stack-fire | |
| framework = arduino | |
| board_build.partitions = custom.csv | |
| lib_deps = tfmicro | |
| build_flags = -Ilib/tfmicro/third_party/gemmlowp -Ilib/tfmicro/third_party/flatbuffers/include |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<Arduino.h> | |
| #include<math.h> | |
| #include "tensorflow/lite/experimental/micro/kernels/all_ops_resolver.h" | |
| #include "tensorflow/lite/experimental/micro/micro_error_reporter.h" | |
| #include "tensorflow/lite/experimental/micro/micro_interpreter.h" | |
| #include "sine_model_data.h" | |
| #include <M5Stack.h> | |
| #define BLACK 0x0000 | |
| #define WHITE 0xFFFF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [env:m5stack-fire] | |
| platform = espressif32 | |
| board = m5stack-fire | |
| framework = arduino | |
| build_flags = -Ilib/tfmicro/third_party/gemmlowp -Ilib/tfmicro/third_party/flatbuffers/include |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "accelerometer_handler.h" | |
| #include "constants.h" | |
| #include <Arduino.h> | |
| #include <M5Stack.h> | |
| #include "utility/MPU9250.h" | |
| MPU9250 IMU; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extern TfLiteStatus SetupAccelerometer(tflite::ErrorReporter* error_reporter); | |
| extern bool ReadAccelerometer(tflite::ErrorReporter* error_reporter, | |
| float* input, int length, bool reset_buffer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [env:m5stack-fire] | |
| platform = espressif32 | |
| board = m5stack-fire | |
| framework = arduino | |
| monitor_speed = 115200 | |
| build_flags = -DARDUINOSTL_M_H -Ilib/tfmicro/third_party/gemmlowp -Ilib/tfmicro/third_party/flatbuffers/include |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tensorflow as tf | |
| seq_length = 128 | |
| model = tf.keras.Sequential([ | |
| tf.keras.layers.Conv2D( | |
| 8, (4, 3), | |
| padding="same", | |
| activation="relu", | |
| input_shape=(seq_length, 3, 1)), # output_shape=(batch, 128, 3, 8) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void loop() { | |
| // Attempt to read new data from the accelerometer | |
| bool got_data = ReadAccelerometer(error_reporter, model_input->data.f, | |
| input_length, should_clear_buffer); | |
| // Don't try to clear the buffer again | |
| should_clear_buffer = false; | |
| // If there was no new data, wait until next time | |
| if (!got_data) return; | |
| // Run inference, and report any error | |
| TfLiteStatus invoke_status = interpreter->Invoke(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "output_handler.h" | |
| #include <Arduino.h> | |
| #include <M5Stack.h> | |
| void DrawWing() { | |
| int x = 60; | |
| int y = 20; | |
| int w = 200; | |
| int h = 200; | |
| int t = 20; |