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))
from time import sleep from auto_everything.base import Terminal t = Terminal() from auto_everything.gui import GUI gui = GUI() pyautogui = gui.autogui 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")
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")