Пример #1
0
def test_eval_all():
    """
    Tests the evaluation of the complete pipeline.

    :return:
    """

    eval_args(create_argparser(), ["evaluate"])
Пример #2
0
def test_eval_frameid():
    """
    Test the evaluation of the frame identification.

    :return:
    """

    eval_args(create_argparser(), ["evaluate", "--frameid"])
Пример #3
0
def test_eval_feeid():
    """
    Test for evaluating the frame evoking element identification.

    :return:
    """

    eval_args(create_argparser(), ["evaluate", "--feeid"])
Пример #4
0
def test_train_feeid():
    """
    Test for training the frame evoking element identification

    NOTE: This stage can not be trained, though for completeness it needs to be tested.

    :return:
    """

    eval_args(create_argparser(), ["train", "--feeid"])
Пример #5
0
def test_train():
    """
    Test for training the complete pipeline

    NOTE: Might take a long time!

    :return:
    """

    eval_args(create_argparser(), ["train"])
Пример #6
0
def test_train_frameid():
    """
    Test for training the frame identification

    NOTE: Might take a long time!

    :return:
    """

    eval_args(create_argparser(), ["train", "--frameid"])
Пример #7
0
def test_config_arg():
    """
    Test the usage of a specified config file.

    :return:
    """

    path = "config.test"
    cM.create_config(path)

    eval_args(create_argparser(), ["evaluate", "--feeid", "--config", path])

    os.remove(path)
Пример #8
0
def test_predict_all(run: int):
    """
    Test for a complete pipeline prediction of a random raw file.

    NOTE: randomized!

    :param run: Number of random repeats
    :return:
    """

    with RandomFiles(10, True) as m_rndfiles:
        path = m_rndfiles.files[0]
        eval_args(create_argparser(), ["predict", "--path", path])
Пример #9
0
def test_predict_frameid(run: int):
    """
    Test the frame identification of a random raw file.

    NOTE: randomized!

    :param run: Number of random repeats
    :return:
    """

    with RandomFiles(10, True) as m_rndfiles:
        path = m_rndfiles.files[0]
        eval_args(create_argparser(), ["predict", "--frameid", "--path", path])
Пример #10
0
def test_train_frameid_batchsize():
    """
    Test for training the frame identification with a manually set batchsize.

    NOTE: Might take a long time!
    NOTE: Randomized!

    :return:
    """

    batch_size = random.randint(50, 500)

    eval_args(create_argparser(),
              ["train", "--frameid", "--batchsize",
               str(batch_size)])
Пример #11
0
def test_predict_all_out_path(run: int):
    """
    Test for a complete pipeline prediction of a random raw file,
    including writing the results to a file.

    NOTE: randomized!

    :param run: Number of random repeats
    :return:
    """

    out_path = create_random_string(string.ascii_lowercase, 8)

    with RandomFiles(10, True) as m_rndfiles:
        path = m_rndfiles.files[0]
        eval_args(create_argparser(),
                  ["predict", "--path", path, "--out_path", out_path])

    os.remove(out_path)
Пример #12
0
def test_predict_feeid_out_path(run: int):
    """
    Test the frame evoking element predicting of a random raw file,
    including writing the results to a file.

    NOTE: randomized!

    :param run: Number of random repeats
    :return:
    """

    out_path = create_random_string(string.ascii_lowercase, 8)

    with RandomFiles(10, True) as m_rndfiles:
        path = m_rndfiles.files[0]
        eval_args(
            create_argparser(),
            ["predict", "--feeid", "--path", path, "--out_path", out_path],
        )

    os.remove(out_path)