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

修改print为logging.info #1558

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Changes from all commits
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
8 changes: 4 additions & 4 deletions paddlex/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ def info(self, average=False):
) * self.img_num + self.inference_time_s.value(
) + self.postprocess_time_s.value() * self.img_num
total_time = round(total_time, 4)
print("------------------ Inference Time Info ----------------------")
print("total_time(ms): {}, img_num: {}, batch_size: {}".format(
logging.info("------------------ Inference Time Info ----------------------")
logging.info("total_time(ms): {}, img_num: {}, batch_size: {}".format(
total_time * 1000, self.img_num, self.img_num))
preprocess_time = round(
self.preprocess_time_s.value() / self.repeats,
Expand All @@ -195,9 +195,9 @@ def info(self, average=False):
4) if average else self.inference_time_s.value()

average_latency = total_time / self.repeats
print("average latency time(ms): {:.2f}, QPS: {:2f}".format(
logging.info("average latency time(ms): {:.2f}, QPS: {:2f}".format(
average_latency * 1000, 1 / average_latency))
print("preprocess_time_per_im(ms): {:.2f}, "
logging.info("preprocess_time_per_im(ms): {:.2f}, "
"inference_time_per_batch(ms): {:.2f}, "
"postprocess_time_per_im(ms): {:.2f}".format(
preprocess_time * 1000, inference_time * 1000,
Expand Down