This file contains 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
#!/usr/bin/env python | |
import device_patches # Device specific patches for Jetson Nano (needs to be before importing cv2) | |
import cv2 | |
import os | |
import sys, getopt | |
import numpy as np | |
from edge_impulse_linux.image import ImageImpulseRunner |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# This works for gym 0.26.2. It might not work on previous versions. | |
import gym | |
import cv2 | |
fps = 30 | |
# Create environment | |
env = gym.make('CartPole-v1', render_mode='rgb_array') |
This file contains 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
/** | |
* 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) |
This file contains 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
""" | |
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 |
This file contains 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 <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); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# 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) |
This file contains 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 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) |
This file contains 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
""" | |
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 |
NewerOlder