Skip to content

Commit

Permalink
[Benchmark] Update benchmark (PaddlePaddle#488)
Browse files Browse the repository at this point in the history
* add paddle_trt in benchmark

* update benchmark in device

* update benchmark
  • Loading branch information
wjj19950828 authored Nov 3, 2022
1 parent 22d60fd commit 1db85e0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 52 deletions.
16 changes: 3 additions & 13 deletions benchmark/benchmark_ppcls.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,9 @@
import time


def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() == 'true':
return True
elif v.lower() == 'false':
return False
else:
raise argparse.ArgumentTypeError('Boolean value expected.')


def parse_arguments():
import argparse
import ast
parser = argparse.ArgumentParser()
parser.add_argument(
"--model", required=True, help="Path of PaddleClas model.")
Expand Down Expand Up @@ -64,12 +54,12 @@ def parse_arguments():
help="inference backend, default, ort, ov, trt, paddle, paddle_trt.")
parser.add_argument(
"--enable_trt_fp16",
type=str2bool,
type=ast.literal_eval,
default=False,
help="whether enable fp16 in trt backend")
parser.add_argument(
"--enable_collect_memory_info",
type=str2bool,
type=ast.literal_eval,
default=False,
help="whether enable collect memory info")
args = parser.parse_args()
Expand Down
16 changes: 3 additions & 13 deletions benchmark/benchmark_ppdet.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,9 @@
import time


def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() == 'true':
return True
elif v.lower() == 'false':
return False
else:
raise argparse.ArgumentTypeError('Boolean value expected.')


def parse_arguments():
import argparse
import ast
parser = argparse.ArgumentParser()
parser.add_argument(
"--model", required=True, help="Path of PaddleDetection model.")
Expand Down Expand Up @@ -66,12 +56,12 @@ def parse_arguments():
help="inference backend, default, ort, ov, trt, paddle, paddle_trt.")
parser.add_argument(
"--enable_trt_fp16",
type=str2bool,
type=ast.literal_eval,
default=False,
help="whether enable fp16 in trt backend")
parser.add_argument(
"--enable_collect_memory_info",
type=str2bool,
type=ast.literal_eval,
default=False,
help="whether enable collect memory info")
args = parser.parse_args()
Expand Down
16 changes: 3 additions & 13 deletions benchmark/benchmark_ppseg.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,9 @@
import time


def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() == 'true':
return True
elif v.lower() == 'false':
return False
else:
raise argparse.ArgumentTypeError('Boolean value expected.')


def parse_arguments():
import argparse
import ast
parser = argparse.ArgumentParser()
parser.add_argument(
"--model", required=True, help="Path of PaddleSeg model.")
Expand Down Expand Up @@ -64,12 +54,12 @@ def parse_arguments():
help="inference backend, default, ort, ov, trt, paddle, paddle_trt.")
parser.add_argument(
"--enable_trt_fp16",
type=str2bool,
type=ast.literal_eval,
default=False,
help="whether enable fp16 in trt backend")
parser.add_argument(
"--enable_collect_memory_info",
type=str2bool,
type=ast.literal_eval,
default=False,
help="whether enable collect memory info")
args = parser.parse_args()
Expand Down
16 changes: 3 additions & 13 deletions benchmark/benchmark_yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,9 @@
import time


def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() == 'true':
return True
elif v.lower() == 'false':
return False
else:
raise argparse.ArgumentTypeError('Boolean value expected.')


def parse_arguments():
import argparse
import ast
parser = argparse.ArgumentParser()
parser.add_argument(
"--model", required=True, help="Path of Yolo onnx model.")
Expand Down Expand Up @@ -66,12 +56,12 @@ def parse_arguments():
help="inference backend, default, ort, ov, trt, paddle, paddle_trt.")
parser.add_argument(
"--enable_trt_fp16",
type=str2bool,
type=ast.literal_eval,
default=False,
help="whether enable fp16 in trt backend")
parser.add_argument(
"--enable_collect_memory_info",
type=str2bool,
type=ast.literal_eval,
default=False,
help="whether enable collect memory info")
args = parser.parse_args()
Expand Down

0 comments on commit 1db85e0

Please sign in to comment.