Fix trial option and calculation
@@ -118,7 +118,7 @@ def _timerfunc(func, extraArgs, trial):
return value, runtime / trial
-def run_prediction(input_image, model, config_file, max_percent_incorrect_values=0.1, trial=1):
+def run_prediction(input_image, model, config_file, trial=1):
if not input_image or not model or not config_file:
logger.error('Please check usage with --help option')
exit(1)
@@ -155,10 +155,10 @@ def run_prediction(input_image, model, config_file, max_percent_incorrect_values
image_size=config.IMAGE_SIZE,
data_format=config.DATA_FORMAT,
bench={
- "total": (bench_pre + bench_post + bench_inference) / trial,
- "pre": bench_pre / trial,
- "post": bench_post / trial,
- "inference": bench_inference / trial,
+ "total": bench_pre + bench_post + bench_inference,
+ "pre": bench_pre,
+ "post": bench_post,
+ "inference": bench_inference,
},
)
@@ -213,7 +213,7 @@ def run_prediction(input_image, model, config_file, max_percent_incorrect_values
)
def main(input_image, model, config_file, trial):
_check_deprecated_arguments()
- run_prediction(input_image, model, config_file, trial)
+ run_prediction(input_image, model, config_file, trial=trial)
def _check_deprecated_arguments():
