Skip to content

Instantly share code, notes, and snippets.

Avatar

Shawn Hymel ShawnHymel

View GitHub Profile
@ShawnHymel
ShawnHymel / time_series_dataset_curation.ipynb
Last active Aug 11, 2022
CSV Time Series Dataset Curation and Standardization
View time_series_dataset_curation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ShawnHymel
ShawnHymel / quantized-inference-example.py
Last active Jul 2, 2022
TensorFlow Lite (TFLite) Python Inference Example with Quantization
View quantized-inference-example.py
# TFLite quantized inference example
#
# Based on:
# https://www.tensorflow.org/lite/performance/post_training_integer_quant
# https://www.tensorflow.org/lite/api_docs/java/org/tensorflow/lite/Tensor.QuantizationParams
import numpy as np
import tensorflow as tf
# Location of tflite model file (float32 or int8 quantized)
@ShawnHymel
ShawnHymel / eye_test_01.py
Last active Dec 30, 2021
Adafruit HT16K33 LED matrix backpack test for Raspberry Pi
View eye_test_01.py
import board
import busio
import time
from random import random
from adafruit_ht16k33 import matrix
# Initialize LED matrix
i2c = busio.I2C(board.SCL, board.SDA)
eye =matrix.Matrix8x8(i2c)
@ShawnHymel
ShawnHymel / cnn-live-inference-lcd.py
Created Sep 26, 2021
OpenMV Electronic Component CNN Live Classification with LCD
View cnn-live-inference-lcd.py
"""
OpenMV Live Image Inference
Continuously captures images and performs image using provided TFLite model
file. Outputs probabilities in console. Displays preview on LCD backpack along
with predicted label.
Author: EdgeImpulse, Inc.
Modified: Shawn Hymel
Date: September 26, 2021
@ShawnHymel
ShawnHymel / tflite_sinewave_training.ipynb
Created Mar 18, 2020
TensorFlow Lite Sinewave Regression Training and Conversion
View tflite_sinewave_training.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View tflite-micro-wake-word-train-04.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View read_msa301_binho.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ShawnHymel
ShawnHymel / arduino_msa301_daq.ino
Created Feb 25, 2020
Low Cost Arduino DAQ Example
View arduino_msa301_daq.ino
#include <Wire.h>
#include <Adafruit_MSA301.h>
#include <Adafruit_Sensor.h>
Adafruit_MSA301 msa;
void setup() {
// Open serial port
Serial.begin(250000);
@ShawnHymel
ShawnHymel / stop_mono_16k.h
Last active Feb 24, 2020
TensorFlow Lite KissFFT Test
View stop_mono_16k.h
#if !defined(STOP_MONO_16K_H)
#define STOP_MONO_16K_H
const int waveform_len = 16000;
const int16_t waveform[] = {
-14, -12, -5, 1, -4, -14, -19, -16, -6, -2, -8, -19, -19, -12, -1, 4, 0, -8, -10, -7, 1, 4, 1, -5, -6, 0, 9, 7, 2, -1, 2, 10, 15, 14, 11, 11, 12, 14, 13, 10, 6, 7, 11, 13, 12, 10, 12, 9, 7, 7, 10, 17, 18, 13, 4, 3, 11, 22, 26, 20, 10, 9, 16, 24, 23, 14, 9, 11, 18, 20, 15, 8, 7, 13, 18, 15, 10, 5, 8, 15, 19, 16, 9, 4, 8, 16, 19, 13, 6, 0, 2, 8, 12, 12, 12, 9, 10, 12, 9, 4, 0, -1, 0, 0, 0, 1, 2, 3, 1, -2, -6, -5, -3, -1, -1, -3, -5, -6, -7, -9, -9, -8, -9, -8, -6, -2, 0, 0, -3, -6, -10, -12, -9, -8, -5, -2, -1, 0, 0, -3, -7, -7, -7, -6, -6, -8, -8, -3, 5, 11, 6, -3, -5, 2, 9, 8, 3, -1, 2, 13, 15, 8, -1, -1, 10, 22, 26, 20, 12, 12, 17, 21, 17, 8, 6, 10, 19, 28, 30, 24, 22, 26, 28, 27, 24, 22, 26, 28, 26, 27, 34, 39, 36, 24, 12, 13, 23, 29, 30, 24, 22, 25, 31, 33, 27, 23, 25, 33, 35, 29, 19, 15, 19, 25, 30, 28, 22, 15, 17, 28, 37, 35, 26, 16, 13, 17, 21, 23, 21, 19, 17, 20, 25, 28, 28, 24, 20, 12, 9
@ShawnHymel
ShawnHymel / webthings-temperature-node.ino
Created Feb 8, 2020
Mozilla WebThings - ESP8266 Temperature Sensor (Arduino)
View webthings-temperature-node.ino
/**
* Mozilla WebThings BME280 example
* Date: August 25, 2019
* Author: Shawn Hymel
*
* Notes:
* - Install ArduinoJSON latest v5 (not v6!)
* - Install ESPAsyncTCP
*/