예제 #1
0
    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(
                "\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?")
예제 #2
0
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")