make sure those file names are meaningful """ print(introduction) input("Are you ready? ") data_files = os.listdir("data") data_files = [file for file in data_files if ".mp4" in file] if len(data_files) < 1: print("You data folder doesn't have any file!") exit() split_lines() # 2. get json data if len(t.run_command("ls data/*.json -l").split("\n")) == len( t.run_command("ls data/*.mp4 -l").split("\n")): anser = input( "You alread have all those data, would you like to collect it again? (y/n)" ) if "y" in anser: 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(
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")