Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] add codes for inference speed statistics #86

Merged
merged 7 commits into from
Mar 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix errors in linting
  • Loading branch information
heiyuxiaokai committed Mar 10, 2022
commit dfcea3fee3fa8bf4d5fd05a173e2ee0f2f5990af
10 changes: 5 additions & 5 deletions tools/analysis_tools/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ def parse_args():

def measure_inference_speed(cfg, checkpoint, max_iter, log_interval,
is_fuse_conv_bn, use_fp16):
""" inference speed statistics
""" inference speed statistics
Args:
cfg (object): Test config object.
checkpoint (str): Checkpoint file path.
max_iter (int): Num of max iter.
log_interval (int): Interval of logging.
is_fuse_conv_bn (bool): Whether to fuse conv and bn,
is_fuse_conv_bn (bool): Whether to fuse conv and bn,
this will slightly increase the inference speed
use_fp16 (bool): Whether to use fp16 to inference.
Returns:
Expand Down Expand Up @@ -161,14 +161,14 @@ def repeat_measure_inference_speed(cfg,
checkpoint (str): Checkpoint file path.
max_iter (int): Num of max iter.
log_interval (int): Interval of logging.
is_fuse_conv_bn (bool): Whether to fuse conv and bn,
is_fuse_conv_bn (bool): Whether to fuse conv and bn,
this will slightly increase the inference speed
use_fp16 (bool): Whether to use fp16 to inference.
repeat_num (int): Number of repeat times of measurement
for averaging the results.
Returns:
fps (float of list(float)): Inference speed(fps) or
list of inference speed(fps) for repeating measurements.
fps (float of list(float)): Inference speed(fps) or
list of inference speed(fps) for repeating measurements.
"""
assert repeat_num >= 1

Expand Down