예제 #1
0
from parinya import LINE
import time
import cv2
import numpy as np
import os

recognizer = cv2.face.LBPHFaceRecognizer_create()
recognizer.read('trainer/classifier_face.xml')
cascadePath = "Cascade/haarcascade_frontalface_default.xml"
faceCascade = cv2.CascadeClassifier(cascadePath)
line = LINE('cdAJfHOi8LLFdXY9RtzEnLTO33cOid62cpvKr69PNDc')

font = cv2.FONT_HERSHEY_SIMPLEX

id = 0
names = ['None', 'Precha', 'Steve Job', 'Toey']

# Initialize and start realtime video capture
camera = cv2.VideoCapture(0)
camera.set(3, 640)  # set video widht
camera.set(4, 480)  # set video height

# Define min window size to be recognized as a face
minW = 0.1 * camera.get(3)
minH = 0.1 * camera.get(4)
# Define the codec and create VideoWriter object
fourcc = cv2.VideoWriter_fourcc(*'XVID')  # กำหนด FourCC code
out = cv2.VideoWriter('output.avi', fourcc, 5.0, (640, 480))

while (True):
    ret, img = camera.read()
예제 #2
0
# token id  group myloan= "d3dVYwoTtmtGtLrDGXz491ZZlzogquSTAgVAa0bF7bI"
from parinya import LINE
line = LINE("d3dVYwoTtmtGtLrDGXz491ZZlzogquSTAgVAa0bF7bI")
#line.sendtext("hello you")
line.sendsticker(1, 1)
예제 #3
0
import requests
import time
from bs4 import BeautifulSoup
from parinya import LINE
line = LINE("d3dVYwoTtmtGtLrDGXz491ZZlzogquSTAgVAa0bF7bI")
web = "https://www.huay.com/login"


def send():
    page = requests.get(web)
    page.encoding = 'utf-8'
    soup = BeautifulSoup(page.content, 'lxml')
    soup1 = soup.find('div', class_='card-body p-2')
    header = soup1.find(class_="text-danger").text
    header1 = header[:25]  # จับยี่กี่รอบที่ ....
    soup2 = soup1.find_all('p', class_="number text-center m-0")
    soup3 = []  # สามตัวบนกับสองตัวล่าง
    for i in soup2:
        soup3.append(i.text)
    post = header1 + 'สามตัวบน  ' + str(soup3[0]) + '  สองตัวล่าง   ' + str(
        soup3[1])
    print(post)
    line.sendtext(post)


def check():
    page = requests.get(web)
    page.encoding = 'utf-8'
    soup = BeautifulSoup(page.content, 'lxml')
    soup1 = soup.find('div', class_='card-body p-2')
    header = soup1.find(class_="text-danger").text
예제 #4
0
    
    # Parameters
    
    
    df = df[df['Tag'].isin(tags)]
    df = df.reset_index(drop=True)
    
    return df




# Hyperparameters
url = 'https://xrpscan.com/account/rPFXvVo2fYXVPdV9gCHQouHsMgMhQ2aUwM'
tags = ['2197236416', '102086525']
line = LINE('')

# Algorithm

driver = webdriver.Chrome()


while True:
    try:
        df = get_data(driver, url, tags) 
        
        if len(df) > 0:
            
            df_alert = pd.read_csv(r'.\log\alert_log.csv')
            df_alert['Date'] = pd.to_datetime(df_alert['Date'])
            
예제 #5
0
from parinya import LINE
import time
import cv2
import numpy as np
import os 

recognizer = cv2.face.LBPHFaceRecognizer_create()
recognizer.read('trainer/classifier_face.xml')
cascadePath = "Cascade/haarcascade_frontalface_default.xml"
faceCascade = cv2.CascadeClassifier(cascadePath);
line = LINE('cdAJfHOi8LLFdXY9RtzEnLTO33cOid62cpvKr69PNDc')

font = cv2.FONT_HERSHEY_SIMPLEX

id = 0
names = ['None', 'Precha', 'Steve Job','Toey'] 

# Initialize and start realtime video capture
camera = cv2.VideoCapture(0)
camera.set(3, 640) # set video widht
camera.set(4, 480) # set video height

# Define min window size to be recognized as a face
minW = 0.1*camera.get(3)
minH = 0.1*camera.get(4)
# Define the codec and create VideoWriter object
fourcc = cv2.VideoWriter_fourcc(*'XVID') # กำหนด FourCC code
out = cv2.VideoWriter('output.avi',fourcc, 5.0, (640,480))


while (True):
예제 #6
0
from parinya import LINE
import datetime
import csv
import time as Time

def make_csv():
    with open('homeWork.csv', mode='w',encoding='utf-8',newline="") as cvs_file:
        csv_writer = csv.writer(cvs_file, delimiter=',')
        for i in range(len(data)):
            csv_writer.writerow(data[i])

line = LINE("4vV3B81Wt7BLoVytgmE2U4H7o8ZaYSFCx0LL1X9gQzJ")
data = []
with open("homeWork.csv",mode="r",encoding='utf-8')as cvs_file:
    csv_reader = csv.reader(cvs_file, delimiter=',')
    for row in csv_reader:
        data.append(row)
    print(data)
while True:
    now = datetime.datetime.now()
    day = str(now.day)+"/"+str(now.month)+"/"+str(now.year)
    time = str(now.now().hour)+":"+str(now.minute)+":"+str(now.second)
    if time != "6:0:0":
        for i in range(len(data)):
            subject =str("วิชา :"+data[i][0])
            sent_time = str("วันที่ส่ง :"+data[i][1])
            discrip =str("รายละเอียด :"+data[i][2])
            text = day+"\n"+subject+"\n"+sent_time+"\n"+discrip
            line.sendtext(text)
            if str(data[i][1]) == str(day):
                del data[i]
예제 #7
0
import datetime
import imutils
import time
import cv2
import os
import datetime
from pathlib import Path
import arrow
from flask_cors import CORS
import base64
# filesPath = r"/var/www/html/image/"
from parinya import YOLOv3
from parinya import LINE
# criticalTime = arrow.now().shift(hours=+7).shift(days=-1)
yolo = YOLOv3('coco.names','yolov3-tiny.cfg','yolov3-tiny.weights')
line = LINE('IlxhXDiH1r1avlZkK8n5vMGpwsKZLkHee5gL3Im9yUm')
base64_message = None
# for item in Path(filesPath).glob('*'):
#     if item.is_file():
#         print (str(item.absolute()))
#         itemTime = arrow.get(item.stat().st_mtime)
#           # if itemTime < criticalTime:
#           #   #remove it
#           # pass




# for filename in os.listdir(path):
#     print(filen ame)
#     # if os.stat(os.path.join(path, filename)).st_mtime < now - 7 * 86400:
예제 #8
0
from parinya import LINE
import time
import datetime
import psycopg2
conn = psycopg2.connect(
host="localhost",
database="postgres",
user="******",
password="******")
token_kmitl = 'SuWZzmcKMMH5RvFaglsCT8jWlIDEBltqjEwhNR7aepd'
x = datetime.datetime.now()
print(x.strftime("%x"))   #ex. 	12/31/18
print(x.strftime("%A"))  #Weekday, full version	Wednesday
line = LINE(token_kmitl)
msg ='''Morning report 3/19/2021
Name    Arrival Status
Tachrat 9.00    on time
Kree    9.45    late
'''
line.sendtext(msg)
def line_guest(data): #มีรูปมีข้อความรับ 3 ค่า
    return


def Morning_report(): #รับค่าดาต้าbaseรายวัน
    txt = "Morning report"+ x.strftime("%x") +"\n" +"Name  Arrival Status" +"\n"
    # if Arrival > 9.30:
    #     txt += " late"
    # elif Arrival < 9.30:
    #     txt += " on time"
    # elif Arrival == null:
예제 #9
0
import tensorflow as tf
import cv2
import multiprocessing as _mp
from src.utils import load_graph, mario, detect_hands, predict
from src.config import BLUE, RED, GREEN
from parinya import LINE
line = LINE('m9urUawCA7xtS43PmP6fKCmcmtFOPdiRpa7u9vSnxwb')
tf.flags.DEFINE_integer("width", 640, "Screen width")
tf.flags.DEFINE_integer("height", 480, "Screen height")
tf.flags.DEFINE_float("threshold", 0.6, "Threshold for score")
tf.flags.DEFINE_float("alpha", 0.3, "Transparent level")
tf.flags.DEFINE_string("pre_trained_model_path", "src/pretrained_model.pb",
                       "Path to pre-trained model")

FLAGS = tf.flags.FLAGS


def main():
    graph, sess = load_graph(FLAGS.pre_trained_model_path)
    cap = cv2.VideoCapture(0)
    cap.set(cv2.CAP_PROP_FRAME_WIDTH, FLAGS.width)
    cap.set(cv2.CAP_PROP_FRAME_HEIGHT, FLAGS.height)
    mp = _mp.get_context("spawn")
    v = mp.Value('i', 0)
    lock = mp.Lock()
    process = mp.Process(target=mario, args=(v, lock))
    process.start()
    line.sendtext('Start Game')
    while True:
        key = cv2.waitKey(1)
        if key == ord("q"):