print( "You have to make sure you got chrome and terminator installed. (Press enter to continue)" ) # 1. start chrome t.kill("chrome") t.run_program("google-chrome-stable --force-device-scale-factor=1.5") sleep(2) pyautogui.press("f11") """ pyautogui.moveTo(0,0) while 1: if gui.exists("chrome_new_tab"): gui.click_after_exists("chrome_new_tab") break if gui.exists("chrome_untitled"): gui.click_after_exists("chrome_untitled") break pyautogui.typewrite("https://google.com") pyautogui.press("enter") if gui.exists("chrome_x"): gui.click_after_exists("chrome_x") """ # 2. run terminator t.run("terminator --profile=mine", cwd=t.fix_path("~"), wait=False) sleep(2) pyautogui.press("f11") print("Done!")
move_files("js", "../") for file in data_files: t.run_command("cp data/{name} ../demo.mp4".format(name=file)) t.run_py("py/websockets_server.py") time.sleep(2) basename = file.split(".")[0] if basename + '.json' in os.listdir('data'): anwser = input( "\n\nYou alread collected {basename} data, would you like to do it again? (y/n)" .format(basename=basename + ".json")) if 'y' not in anwser: continue t.run(""" cd ../.. yarn video """, wait=False) input("\n\nIs the video finished?") t.kill("webpack_for_video") t.run("python3 py/websockets_end.py {name}".format(name=basename), wait=True) time.sleep(2) t.kill("websockets_server.py") t.kill("chrome") t.kill("firefox") time.sleep(2) t.run_py("py/generate_js_index.py", wait=True) move_files("js", "../") t.run_command("rm ../demo.mp4".format(name=file))
#!usr/bin/python3 from flutter_ocr_server import Server import os from auto_everything.base import Terminal t = Terminal() from multiprocessing import Process server = Server() p = Process(target=server.start, args=()) p.start() #os.system("$SNAP/bin/flutter_ocr") t.run("$SNAP/bin/flutter_ocr") p.terminate() exit()
t = Terminal() def split_lines(): print('\n\n' + '-'*12 + '\n\n') # 0. make sure running in the right place if "3.use_opencv" not in t.current_dir: print("You must run this script at 3.use_opencv folder!") exit() split_lines() t.run_command("cp ../1.pose_detect_training/data/sitting.mp4 ../demo.mp4") t.run_command("cp js/video_index.js ../video_index.js") t.run_py("py/websockets_server.py") t.run(""" cd ../.. yarn video """, wait=False) input("Do we finished?") t.kill("webpack") t.kill("websockets_server.py") t.run_command("rm ../demo.mp4")
from PIL import Image from auto_everything.base import Terminal from time import sleep import os t = Terminal() t.run("sudo apt-get install imagemagick") from pynput.keyboard import Listener as KeyboardListener from pynput.keyboard import Controller as KeyboardController from pynput.mouse import Controller as MouseController from pynput.mouse import Button from pynput.keyboard import Key mouseControl = MouseController() keyboardControl = KeyboardController() def on_release(key): try: k = key.char except: k = key.name if k == "1" or k == "0": sleep(0.3) keyboardControl.press(Key.enter) keyboardControl.release(Key.enter) keyListen = KeyboardListener(on_release=on_release) keyListen.start()