Skip to content

Instantly share code, notes, and snippets.

Avatar

Shawn Hymel ShawnHymel

View GitHub Profile
@ShawnHymel
ShawnHymel / ei_json_to_csv.ipynb
Last active Nov 16, 2022
Edge Impulse JSON to CSV
View ei_json_to_csv.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ShawnHymel
ShawnHymel / gym-recorder-demo.py
Created Nov 6, 2022
OpenAI Gym Video Recorder
View gym-recorder-demo.py
import gym
import cv2
fps = 30
# Create environment
env = gym.make('CartPole-v1', render_mode='rgb_array')
# Get initial observation and frame
obs = env.reset()
@ShawnHymel
ShawnHymel / magic_wand_standardized_inference.ino
Created Oct 10, 2022
Edge Impulse magic wand inference example
View magic_wand_standardized_inference.ino
/**
* Magic Wand Inference Demo
*
* Attach a button to pin 2. Press button to start collection. Raw data will be
* collected and fed to the impulse for inference. Inference results are printed
* to the serial terminal.
*
* Author: Shawn Hymel (EdgeImpulse, Inc.)
* Date: October 10, 2022
* License: Apache-2.0 (apache.org/licenses/LICENSE-2.0)
View pygame-display-test.py
"""
PyGame Display Test
Run to see if you can draw things in Pygame. Press 'esc` to exit. Run with
root privileges to draw on external monitor (e.g. from SSH).
"""
import pygame
# Initialize pygame
@ShawnHymel
ShawnHymel / printf_test.ino
Created Aug 28, 2022
Arduino printf test
View printf_test.ino
#include <stdarg.h>
// Makeshift printf for the Serial terminal
void aprintf(const char *format, ...) {
static char print_buf[1024] = { 0 };
va_list args;
va_start(args, format);
int r = vsnprintf(print_buf, sizeof(print_buf), format, args);
va_end(args);
@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 Oct 17, 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.