def benchmark_distance(id_distance, testcases, repeat): library_testcases = get_conftools_testcases() testcases = map(library_testcases.instance, testcases) d = get_conftools_uncertain_image_distances().instance(id_distance) fps = InAWhile() for _ in range(repeat): for tc in testcases: fps.its_time() result = d.distance(tc.y0, tc.y1) print('%s / %s: %s (%s)' % (id_distance, tc.id_tc, result, tc.true_plan)) print('%s: frames per second: %s' % (id_distance, fps.fps()))
def define_jobs_context(self, context): library = get_conftools_uncertain_image_distances() distances = library.expand_names(self.options.distances) library = get_conftools_testcases() testcases = library.expand_names(self.options.testcases) self.info('Using distances: %s' % distances) self.info('Using testcases: %s' % testcases) for c, id_distance in iterate_context_names(context, distances): c.comp_config(benchmark_distance, id_distance, testcases, repeat=self.options.repeat)
def instantiate_testcase(id_tc): warnings.warn('make sure it it called with comp_config') return get_conftools_testcases().instance(id_tc)
# def check_symdiffeo_dummy(id_symdiffeo, symdiffeo): # pass # # # @for_all_dds # def check_dds_dummy(id_dds, dds): # pass # # # @for_all_images # def check_image_dummy(id_image, image): # pass for_all_planning_algos = comptests_for_all(get_conftools_planning_algos()) for_all_test_cases = comptests_for_all(get_conftools_testcases()) for_all_batches = comptests_for_all(get_conftools_batches()) @for_all_planning_algos def check_planning_algo(id_ob, ob): pass @for_all_test_cases def check_testcase(id_ob, ob): pass @for_all_batches def check_batch(id_ob, ob): pass
# @for_all_symdiffeos # def check_symdiffeo_dummy(id_symdiffeo, symdiffeo): # pass # # # @for_all_dds # def check_dds_dummy(id_dds, dds): # pass # # # @for_all_images # def check_image_dummy(id_image, image): # pass for_all_planning_algos = comptests_for_all(get_conftools_planning_algos()) for_all_test_cases = comptests_for_all(get_conftools_testcases()) for_all_batches = comptests_for_all(get_conftools_batches()) @for_all_planning_algos def check_planning_algo(id_ob, ob): pass @for_all_test_cases def check_testcase(id_ob, ob): pass @for_all_batches def check_batch(id_ob, ob):