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)
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)
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)
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)
def _unpacked_cache_dir(self): if self._unpacked_temp_dir is None: self._unpacked_temp_dir = TempDirectory.create_new() return self._unpacked_temp_dir
def _unpacked_cache_dir(self): if self._unpacked_temp_dir is None: self._unpacked_temp_dir = TempDirectory.create_new() return self._unpacked_temp_dir