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
# @anoken2017 | |
# demo_face_recognition m5-custom firm needed | |
# fork https://github.com/sipeed/MaixPy_scripts/blob/master/machine_vision/demo_face_recognition.py | |
import sensor,image,lcd #関連ライブラリ | |
import KPU as kpu | |
import time | |
from Maix import FPIOA,GPIO,utils | |
from fpioa_manager import fm | |
from board import board_info |
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
## M5StickV MPU6886 maixpy | |
## Referred to the following | |
## https://github.com/m5stack/M5StickC/blob/master/src/utility/MPU6886.cpp | |
##https://github.com/m5stack/M5-Schematic/blob/master/datasheet/MPU-6886-000193%2Bv1.1_GHIC.PDF.pdf | |
from machine import I2C | |
MPU6886_ADDRESS=0x68 | |
MPU6886_WHOAMI=0x75 | |
MPU6886_ACCEL_INTEL_CTRL= 0x69 |
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
// Copyright (c) 2019 aNoken | |
#include <M5StickC.h> | |
HardwareSerial serial_ext(2); | |
typedef struct { | |
uint32_t length; | |
uint8_t *buf; | |
} jpeg_data_t; | |
jpeg_data_t jpeg_data; |
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
Test Code | |
------ | |
import wifiCfg | |
import urequests | |
import gc | |
import micropython | |
micropython.mem_info() | |
print('Initial free: {} allocated: {}'.format(gc.mem_free(), gc.mem_alloc())) | |
wifiCfg.autoConnect() |
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
# https://github.com/sipeed/MaixPy_scripts/blob/master/multimedia/speech_recognizer/speech_recognizer.py | |
from Maix import I2S, GPIO | |
from fpioa_manager import fm | |
from modules import SpeechRecognizer | |
import utime, time | |
# register i2s(i2s0) pin | |
fm.register(20, fm.fpioa.I2S0_IN_D0, force=True) | |
fm.register(18, fm.fpioa.I2S0_SCLK, force=True) |
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"LIS3DHTR.h" | |
LIS3DHTR<TwoWire> lis(I2C_MODE); | |
void setup() { | |
Serial.begin(115200); | |
lis.begin(Wire1, LIS3DHTR_DEFAULT_ADDRESS); //I2C Address | |
if (!lis) { | |
Serial.println("ERROR"); | |
while (1); |
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
from keras.models import Sequential | |
from keras.layers import Activation, Dense, Dropout,Conv2D,MaxPooling2D,Flatten,ZeroPadding2D | |
from keras.utils.np_utils import to_categorical | |
from keras.optimizers import Adagrad | |
from keras.optimizers import Adam | |
import numpy as np | |
from PIL import Image | |
import os | |
import tensorflow as tf | |
from matplotlib import pyplot as plt |
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
## @anoken | |
## MaixPy Thread Test | |
## MicroPython v0.4.0-50-gcafae9d | |
import lcd | |
from Maix import GPIO | |
from fpioa_manager import fm | |
import _thread, time | |
lcd.init() |
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
from Maix import GPIO, I2S, FFT | |
import image, lcd, math,array | |
from board import board_info | |
from fpioa_manager import fm | |
import audio | |
sample_rate = 44100 | |
SAMPLES_PER_SECOND = 1024 | |
BITS_PER_SAMPLE=16 |
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 | |
#from __future__ import print_function | |
# | |
#https://mlblr.com/includes/mlai/index.html#yolov2 | |
#https://github.com/snakers4/yolov2-fish | |
from keras.models import Sequential, Model | |
from keras.layers import Reshape, Activation, Conv2D, Input, MaxPooling2D, BatchNormalization, Flatten, Dense, Lambda | |
from keras.layers.advanced_activations import LeakyReLU | |
from keras.callbacks import EarlyStopping, ModelCheckpoint, TensorBoard |
NewerOlder