This file contains hidden or 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 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: |
This file contains hidden or 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 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() |
This file contains hidden or 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) 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: | |
| # |
This file contains hidden or 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
| # -*- 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 |
This file contains hidden or 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 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 |
This file contains hidden or 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
| # -*- 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!") |
This file contains hidden or 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 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 |
This file contains hidden or 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
| '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" |
This file contains hidden or 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
| '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" |
This file contains hidden or 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 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' |