Skip to content

Instantly share code, notes, and snippets.

View kaeton's full-sized avatar

Tatsuya Hanyu kaeton

View GitHub Profile
#!/usr/bin/env python
# coding: utf-8
import json
# import joblib
import requests
# result1 = open('result1.json')
# result2 = open('result2.json')
# result3 = open('result3.json')
"""
A simple selenium test example written by python
"""
import unittest
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
class TestTemplate(unittest.TestCase):
"""Include test cases on a given url"""
"""
A simple selenium test example written by python
"""
import unittest
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
class TestTemplate(unittest.TestCase):
"""Include test cases on a given url"""
import numpy as np
import cv2
FILE_ORG = "calibrated_output_background2.m4v"
WINDOW_ORG = "Orginal_frame"
FRAME_RATE = 30 # fps
class LocationDetector:
def __init__(self,
import cv2
import numpy as np
#動画ファイルパス
ESC_KEY = 27 # Escキー
INTERVAL= 33 # インターバル
FRAME_RATE = 30 # fps
#ウインドウ名の定義
@kaeton
kaeton / usb_camera_save.py
Created July 11, 2018 02:42
usbカメラのデータ取得用
import cv2
from datetime import datetime
# camera number
class CaptureMethod:
def __init__(self, imagesize, x_axis=False, y_axis=False):
self.x_axis = x_axis
self.y_axis = y_axis
self.fourcc = cv2.VideoWriter_fourcc('m','p','4','v')
self.imagesize = imagesize
import cv2
# camera number
class CaptureMethod:
def __init__(self, number=2, x_axis=False, y_axis=False):
self.camera_number = number
self.x_axis = x_axis
self.y_axis = y_axis
def capture_camera(self, mirror=True, size=None):
@kaeton
kaeton / make_dummies
Created February 19, 2018 07:26
ダミー変数を作成する際のpythonコード
import pandas as pd
origin_data = pd.read_csv("使用するデータ.csv")
weekday_dummy = pd.get_dummies(origin_data['曜日'], drop_first = True)
dummy_data = pd.merge(origin_data, weekday_dummy, left_index=True, right_index=True)
dummy_data.to_csv("put_true_dummy_weekday.csv", index=False)
#include <ArduinoJson.h>
const int BUTTON = 11; // プッシュボタンが接続されているピン
const int led_1 = 9; // 7segLED the one's place
const int led_10 = 10; // 7segLED the ten's place
const int led_100 = 11;
const int led_1000 = 12;
int val = 0; // 入力ピンの状態がこの変数(val)に記憶される
int old_val = 0; // valの前の値を保存しておく変数