Пример #1
0
    def __call__(self, img_generator):
        test_path = TempDirectory.create_new() / 'menpobench_test_images'
        # Save images down to mat file
        images_to_mat(img_generator, test_path)

        # Call matlab bridge to test file - will drop out a result mat
        invoke_matlab(
            "addpath('{}'); menpobench_matlab_fit('{}', '{}');".format(
                matlab_functions_dir(), self.method_path, test_path))

        return load_matlab_results(test_path)
Пример #2
0
    def __call__(self, img_generator):
        test_path = TempDirectory.create_new() / "menpobench_test_images"
        # Save images down to mat file
        images_to_mat(img_generator, test_path)

        # Call matlab bridge to test file - will drop out a result mat
        invoke_matlab(
            "addpath('{}'); menpobench_matlab_fit('{}', '{}');".format(
                matlab_functions_dir(), self.method_path, test_path
            )
        )

        return load_matlab_results(test_path)
Пример #3
0
def run_test_suite(verbose=False):
    ts = generate_test_suite()
    path = str(TempDirectory.create_new() / 'mb.py')
    with open(path, 'wt') as f:
        f.write(ts)
    args = ['', path]
    if verbose:
        args.append('-v')
    tests_passed = nose.run(argv=args)
    TempDirectory.delete_all()
    if tests_passed:
        sys.exit(0)
    else:
        sys.exit(1)
Пример #4
0
def run_test_suite(verbose=False):
    ts = generate_test_suite()
    path = str(TempDirectory.create_new() / 'mb.py')
    with open(path, 'wt') as f:
        f.write(ts)
    args = ['', path]
    if verbose:
        args.append('-v')
    tests_passed = nose.run(argv=args)
    TempDirectory.delete_all()
    if tests_passed:
        sys.exit(0)
    else:
        sys.exit(1)
Пример #5
0
 def _unpacked_cache_dir(self):
     if self._unpacked_temp_dir is None:
         self._unpacked_temp_dir = TempDirectory.create_new()
     return self._unpacked_temp_dir
Пример #6
0
 def _unpacked_cache_dir(self):
     if self._unpacked_temp_dir is None:
         self._unpacked_temp_dir = TempDirectory.create_new()
     return self._unpacked_temp_dir