Skip to content

Instantly share code, notes, and snippets.

PonDad PonDad

View GitHub Profile
@PonDad
PonDad / app.py
Created Nov 11, 2017
【Movidius™NCS&RaspberryPi】リアルタイム物体認識【TensorFlow】
View app.py
#! /usr/bin/env python3
from mvnc import mvncapi as mvnc
import sys
import numpy
import cv2
path_to_networks = './'
path_to_images = '../../data/images/'
graph_filename = 'graph'
#image_filename = path_to_images + 'cat.jpg'
@PonDad
PonDad / index.js
Created Oct 8, 2017
Googleホームアプリ「宿題の時間」のGoogle Cloud Functions実行ファイル
View index.js
'use strict';
process.env.DEBUG = 'actions-on-google:*';
const App = require('actions-on-google').ApiAiApp;
const exec = require('child_process').exec;
const kinako_adress = "https://xxxxxxxx.ap.ngrok.io/kinako_today"
const anko_adress = "https://xxxxxxxx.ap.ngrok.io/anko_today"
const kinako_adress_2 = "https://xxxxxxxx.ap.ngrok.io/kinako_month"
const anko_adress_2 = "https://xxxxxxxx.ap.ngrok.io/anko_month"
@PonDad
PonDad / index.js
Created Jun 11, 2017
Samuel L Jackson's face recognition with Google Assistant & Raspberry Pi
View index.js
'use strict';
process.env.DEBUG = 'actions-on-google:*';
const App = require('actions-on-google').ApiAiApp;
const exec = require('child_process').exec;
const camera_adress = "https://7bdaf661.ap.ngrok.io/camera"
const what_adress = "https://7bdaf661.ap.ngrok.io/what"
const face_adress = "https://7bdaf661.ap.ngrok.io/face"
const who_adress = "https://7bdaf661.ap.ngrok.io/who"
@PonDad
PonDad / apple_keras.py
Last active May 31, 2017
Google Assistant で 深層学習 - KerasをRaspberry Piで音声操作する
View apple_keras.py
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras.utils import np_utils
root_dir = "./image/"
categories = ["red_apple", "green_apple"]
nb_classes = len(categories)
image_size = 32
@PonDad
PonDad / app.py
Created Apr 29, 2017
Raspberry Pi にGoogle Assistant SDKを搭載して「OK Google」してみる
View app.py
# -*- coding:utf-8 -*-
from bottle import route, run
import irm
import os
@route('/light_on')
def light_on():
irm.playIR("room_light_on.json")
irm.playIR("stand_light_on.json")
print("Light On!")
@PonDad
PonDad / agent.py
Last active Oct 25, 2017
reinforcement-learning
View agent.py
import numpy as np
import pandas as pd
class QLearning:
def __init__(self, actions, learning_rate=0.01, reward_decay=0.9, e_greedy=0.9):
# actions = [0, 1, 2, 3]
self.actions = actions
self.alpha = learning_rate
self.discount_factor = reward_decay
View simple3-q-learning.py
# -*- coding: utf-8 -*-
"""
Created on Thu May 5, 2016
@author: jonki
https://github.com/jojonki/reinforcement-practice/blob/master/simple-q-learning.py
こちらをPython3で動作する様に一部改変しました
"""
import numpy as np
import random
@PonDad
PonDad / PCA9685.py
Last active Apr 3, 2017
Raspberry Pi 人工無脳ロボットに感情モデルを持たせる
View PCA9685.py
# Copyright (c) 2016 Adafruit Industries
# Author: Tony DiCola
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@PonDad
PonDad / app.py
Created Mar 25, 2017
Raspberry Pi ロボットをゼスチャーで操作する【GrovePi/Python3】
View app.py
import grove_gesture_sensor
from grove_rgb_lcd import *
import time
import Adafruit_PCA9685
import grove_i2c_motor_driver
pwm = Adafruit_PCA9685.PCA9685()
pwm.set_pwm_freq(60)
m= grove_i2c_motor_driver.motor_driver()
@PonDad
PonDad / gesture.py
Last active Mar 21, 2017
Raspberry Pi ゼスチャーセンサーで操作する【GrovePi+】
View gesture.py
import grove_gesture_sensor
from grove_rgb_lcd import *
import time
def main():
g=grove_gesture_sensor.gesture()
g.init()
setText("-\nNewtral")
setRGB(255,255,255) #White
while True:
You can’t perform that action at this time.